diff --git a/dbt_project.yml b/dbt_project.yml index f5ffcecd1..0a995899b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -57,140 +57,140 @@ seeds: the_tuva_project: terminology: terminology__admit_source: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_source.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_source.csv',compression=true,null_marker=true) }}" terminology__admit_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_type.csv',compression=true,null_marker=true) }}" terminology__ansi_fips_state: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ansi_fips_state.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ansi_fips_state.csv',compression=true,null_marker=true) }}" terminology__apr_drg: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','apr_drg.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','apr_drg.csv',compression=true,null_marker=true) }}" terminology__bill_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','bill_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','bill_type.csv',compression=true,null_marker=true) }}" terminology__calendar: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','calendar.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','calendar.csv',compression=true,null_marker=true) }}" terminology__claim_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','claim_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','claim_type.csv',compression=true,null_marker=true) }}" terminology__code_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','code_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','code_type.csv',compression=true,null_marker=true) }}" terminology__discharge_disposition: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','discharge_disposition.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','discharge_disposition.csv',compression=true,null_marker=true) }}" terminology__encounter_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','encounter_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','encounter_type.csv',compression=true,null_marker=true) }}" terminology__ethnicity: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ethnicity.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ethnicity.csv',compression=true,null_marker=true) }}" terminology__fips_county: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','fips_county.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','fips_county.csv',compression=true,null_marker=true) }}" terminology__gender: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','gender.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','gender.csv',compression=true,null_marker=true) }}" terminology__hcpcs_level_2: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','hcpcs_level_2.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','hcpcs_level_2.csv',compression=true,null_marker=true) }}" terminology__icd_10_cm: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_cm.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_cm.csv',compression=true,null_marker=true) }}" terminology__icd_10_pcs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_pcs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_pcs.csv',compression=true,null_marker=true) }}" terminology__icd_9_cm: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_cm.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_cm.csv',compression=true,null_marker=true) }}" terminology__icd_9_pcs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_pcs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_pcs.csv',compression=true,null_marker=true) }}" terminology__loinc: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc.csv',compression=true,null_marker=true) }}" terminology__loinc_deprecated_mapping: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}" terminology__mdc: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','mdc.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','mdc.csv',compression=true,null_marker=true) }}" terminology__medicare_dual_eligibility: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}" terminology__medicare_orec: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_orec.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_orec.csv',compression=true,null_marker=true) }}" terminology__medicare_status: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_status.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_status.csv',compression=true,null_marker=true) }}" terminology__ms_drg: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ms_drg.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ms_drg.csv',compression=true,null_marker=true) }}" terminology__ndc: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ndc.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ndc.csv',compression=true,null_marker=true) }}" terminology__other_provider_taxonomy: +post-hook: "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}" terminology__payer_type: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','payer_type.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','payer_type.csv',compression=true,null_marker=true) }}" terminology__place_of_service: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','place_of_service.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','place_of_service.csv',compression=true,null_marker=true) }}" terminology__present_on_admission: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','present_on_admission.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','present_on_admission.csv',compression=true,null_marker=true) }}" terminology__provider: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_provider_data/0_8_1','provider.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_provider_data/0.8.2','provider.csv',compression=true,null_marker=true) }}" terminology__race: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','race.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','race.csv',compression=true,null_marker=true) }}" terminology__revenue_center: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','revenue_center.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','revenue_center.csv',compression=true,null_marker=true) }}" terminology__rxnorm_to_atc: +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','rxnorm_to_atc.csv',compression=true,null_marker=true) }}" terminology__snomed_ct: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','snomed_ct.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct.csv',compression=true,null_marker=true) }}" terminology__snomed_ct_transitive_closures: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','snomed_ct_transitive_closures.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct_transitive_closures.csv',compression=true,null_marker=true) }}" terminology__snomed_icd_10_map: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','snomed_icd_10_map.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_icd_10_map.csv',compression=true,null_marker=true) }}" terminology__ssa_fips_state: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ssa_fips_state.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ssa_fips_state.csv',compression=true,null_marker=true) }}" value_sets: ccsr: ccsr__dxccsr_v2023_1_body_systems: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}" ccsr__dxccsr_v2023_1_cleaned_map: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}" ccsr__prccsr_v2023_1_cleaned_map: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}" chronic_conditions: chronic_conditions__cms_chronic_conditions_hierarchy: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}" chronic_conditions__tuva_chronic_conditions_hierarchy: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}" clinical_concept_library: clinical_concepts: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}" coding_systems: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_coding_systems.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_coding_systems.csv',compression=true,null_marker=true) }}" value_set_members: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_value_set_members.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_value_set_members.csv',compression=true,null_marker=true) }}" cms_hcc: cms_hcc__adjustment_rates: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}" cms_hcc__cpt_hcpcs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cpt_hcpcs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cpt_hcpcs.csv',compression=true,null_marker=true) }}" cms_hcc__demographic_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}" cms_hcc__disabled_interaction_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}" cms_hcc__disease_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}" cms_hcc__disease_interaction_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}" cms_hcc__enrollment_interaction_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}" cms_hcc__icd_10_cm_mappings: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}" cms_hcc__payment_hcc_count_factors: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}" data_quality: data_quality__test_catalog: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','data_quality_test_catalog.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','data_quality_test_catalog.csv',compression=true,null_marker=true) }}" ed_classification: ed_classification__categories: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','ed_classification_categories.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','ed_classification_categories.csv',compression=true,null_marker=true) }}" ed_classification__icd_10_cm_to_ccs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}" ed_classification__johnston_icd10: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd10',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd10',compression=true,null_marker=true) }}" ed_classification__johnston_icd9: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd9',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd9',compression=true,null_marker=true) }}" hcc_suspecting: hcc_suspecting__clinical_concepts: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}" hcc_suspecting__hcc_descriptions: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}" hcc_suspecting__icd_10_cm_mappings: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}" quality_measures: quality_measures__concepts: +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_concepts.csv',compression=true,null_marker=true) }}" @@ -200,27 +200,27 @@ seeds: +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_value_set_codes.csv',compression=true,null_marker=true) }}" readmissions: readmissions__acute_diagnosis_ccs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}" readmissions__acute_diagnosis_icd_10_cm: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}" readmissions__always_planned_ccs_diagnosis_cateogry: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','always_planned_ccs_diagnosis_cateogry.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','always_planned_ccs_diagnosis_cateogry.csv',compression=true,null_marker=true) }}" readmissions__always_planned_ccs_procedure_cateogry: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','always_planned_ccs_procedure_cateogry.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','always_planned_ccs_procedure_cateogry.csv',compression=true,null_marker=true) }}" readmissions__exclusion_ccs_diagnosis_category: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}" readmissions__icd_10_cm_to_ccs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}" readmissions__icd_10_pcs_to_ccs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}" readmissions__potentially_planned_ccs_procedure_category: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}" readmissions__potentially_planned_icd_10_pcs: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}" readmissions__specialty_cohort: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','specialty_cohort.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','specialty_cohort.csv',compression=true,null_marker=true) }}" readmissions__surgery_gyncology_cohort: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','surgery_gyncology_cohort.csv',compression=true,null_marker=true) }}" + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','surgery_gyncology_cohort.csv',compression=true,null_marker=true) }}" service_categories: service_category__service_categories: - +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','service_category_service_categories.csv',compression=true,null_marker=true) }}" \ No newline at end of file + +post-hook: "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','service_category_service_categories.csv',compression=true,null_marker=true) }}" \ No newline at end of file diff --git a/docs/catalog.json b/docs/catalog.json index 9771b106b..1ff9f5771 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.5.0", "generated_at": "2024-05-10T13:57:46.159301Z", "invocation_id": "e50d9557-e0ce-4212-8187-4b7de7f3a0f5", "env": {}}, "nodes": {"model.input_layer.procedure": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PROCEDURE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.procedure"}, "model.input_layer.patient": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PATIENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.patient"}, "model.input_layer.location": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LOCATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.location"}, "model.input_layer.condition": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.condition"}, "model.input_layer.observation": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "OBSERVATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.observation"}, "model.input_layer.encounter": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ENCOUNTER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.encounter"}, "model.input_layer.lab_result": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LAB_RESULT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.lab_result"}, "model.input_layer.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PHARMACY_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.pharmacy_claim"}, "model.input_layer.medical_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICAL_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medical_claim"}, "model.input_layer.eligibility": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ELIGIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.eligibility"}, "model.input_layer.medication": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medication"}, "model.input_layer.practitioner": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PRACTITIONER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.practitioner"}, "model.the_tuva_project.quality_measures__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "PERFORMANCE_FLAG": {"type": "NUMBER", "index": 5, "name": "PERFORMANCE_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 6, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 7, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 8, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 9, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 11, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 12, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 13, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 14, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 5, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 6, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 7, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 8, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 9, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 10, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 11, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 12, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 13, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 15, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 16, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 17, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 18, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 19, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 20, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 21, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 22, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 23, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 24, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 25, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 26, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 27, "name": "DIAGNOSIS_CODE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_BODY_SYSTEMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"BODY_SYSTEM": {"type": "TEXT", "index": 1, "name": "BODY_SYSTEM", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 2, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 22.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "TEXT", "index": 3, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 4, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "NUMBER", "index": 1, "name": "MODEL_VERSION", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "DESCRIPTION": {"type": "NUMBER", "index": 3, "name": "DESCRIPTION", "comment": null}, "HCCS_TO_EXCLUDE": {"type": "TEXT", "index": 4, "name": "HCCS_TO_EXCLUDE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_HCC_DESCRIPTIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"HCC_CODE": {"type": "TEXT", "index": 1, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "HCC_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 115.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "TEXT", "index": 2, "name": "PAYMENT_YEAR", "comment": null}, "NORMALIZATION_FACTOR": {"type": "TEXT", "index": 3, "name": "NORMALIZATION_FACTOR", "comment": null}, "MA_CODING_PATTERN_ADJUSTMENT": {"type": "TEXT", "index": 4, "name": "MA_CODING_PATTERN_ADJUSTMENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, "model.the_tuva_project.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_MEDICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 22, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, "model.the_tuva_project.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, "model.the_tuva_project.quality_measures__int_nqf0059_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_PLAUSIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 7, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_summary": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 3, "name": "COUNTS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 10.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "LOOKBACK_PERIOD_JUNE": {"type": "DATE", "index": 6, "name": "LOOKBACK_PERIOD_JUNE", "comment": null}, "LOOKBACK_PERIOD_DECEMBER": {"type": "DATE", "index": 7, "name": "LOOKBACK_PERIOD_DECEMBER", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"}, "model.the_tuva_project.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_1", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 5, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, "model.the_tuva_project.normalized_input__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "TEXT", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__medical_claim"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, "seed.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FULL_DATE": {"type": "DATE", "index": 1, "name": "FULL_DATE", "comment": null}, "YEAR": {"type": "NUMBER", "index": 2, "name": "YEAR", "comment": null}, "MONTH": {"type": "NUMBER", "index": 3, "name": "MONTH", "comment": null}, "DAY": {"type": "NUMBER", "index": 4, "name": "DAY", "comment": null}, "MONTH_NAME": {"type": "TEXT", "index": 5, "name": "MONTH_NAME", "comment": null}, "DAY_OF_WEEK_NUMBER": {"type": "NUMBER", "index": 6, "name": "DAY_OF_WEEK_NUMBER", "comment": null}, "DAY_OF_WEEK_NAME": {"type": "TEXT", "index": 7, "name": "DAY_OF_WEEK_NAME", "comment": null}, "WEEK_OF_YEAR": {"type": "NUMBER", "index": 8, "name": "WEEK_OF_YEAR", "comment": null}, "DAY_OF_YEAR": {"type": "NUMBER", "index": 9, "name": "DAY_OF_YEAR", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "YEAR_MONTH", "comment": null}, "FIRST_DAY_OF_MONTH": {"type": "DATE", "index": 11, "name": "FIRST_DAY_OF_MONTH", "comment": null}, "LAST_DAY_OF_MONTH": {"type": "DATE", "index": 12, "name": "LAST_DAY_OF_MONTH", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 80000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 882176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__calendar"}, "model.the_tuva_project.service_category__duplicate_bill_types": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_BILL_TYPES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CNT": {"type": "NUMBER", "index": 2, "name": "CNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_PLAUSIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 9, "name": "COUNTS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility"}, "model.the_tuva_project.quality_measures__int_nqf0053_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "AGE": {"type": "NUMBER", "index": 3, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator"}, "model.the_tuva_project.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, "model.the_tuva_project.normalized_input__int_procedure_date_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 3, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 4, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 6, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 7, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 8, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 9, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 10, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 11, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 12, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 13, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 14, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 15, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 16, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 17, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 18, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 19, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 20, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 21, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 22, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 23, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 24, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 25, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 26, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 27, "name": "PROCEDURE_DATE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final"}, "model.the_tuva_project.quality_measures__int_nqf0059_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 8, "name": "EVIDENCE_VALUE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator"}, "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PAYER_PLAN", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 2, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 3, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 5, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 8, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 9, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 10, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 11, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 12, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 13, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 14, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 15, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 16, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 17, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 18, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 19, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 20, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 21, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 22, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 23, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 24, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 25, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 28, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 29, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 30, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 31, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 32, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 33, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 36, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 38, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 40, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 41, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 42, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 43, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 44, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 45, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 46, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 48, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 49, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 50, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 51, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 52, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 53, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 54, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 55, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan"}, "model.the_tuva_project.normalized_input__int_undetermined_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_UNDETERMINED_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type"}, "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"}, "model.the_tuva_project.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 6, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}, "BODY_SYSTEM": {"type": "TEXT", "index": 8, "name": "BODY_SYSTEM", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 9, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, "seed.the_tuva_project.quality_measures__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CODES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "CODE": {"type": "TEXT", "index": 3, "name": "CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 11485.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 107520.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, "model.the_tuva_project.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 4, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 80493.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1416192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_PRCCSR_V2023_1_CLEANED_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "ICD_10_PCS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ICD_10_PCS_DESCRIPTION", "comment": null}, "PRCCSR": {"type": "TEXT", "index": 3, "name": "PRCCSR", "comment": null}, "PRCCSR_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "PRCCSR_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 5, "name": "CLINICAL_DOMAIN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1539584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_FRAILTY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty"}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD10": {"type": "TEXT", "index": 1, "name": "ICD10", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 47132.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 304128.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, "model.the_tuva_project.core__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__location"}, "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DISCHARGE_DISPOSITION_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "PLAN_SEGMENT": {"type": "TEXT", "index": 4, "name": "PLAN_SEGMENT", "comment": null}, "GENDER": {"type": "TEXT", "index": 5, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 6, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 7, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 8, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 9, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 10, "name": "INSTITUTIONAL_STATUS", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 11, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 848.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 13312.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ELIGIBILITY_DATES_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PATIENT_ID_KEY": {"type": "TEXT", "index": 2, "name": "PATIENT_ID_KEY", "comment": null}, "NORMALIZED_BIRTH_DATE": {"type": "DATE", "index": 3, "name": "NORMALIZED_BIRTH_DATE", "comment": null}, "NORMALIZED_DEATH_DATE": {"type": "DATE", "index": 4, "name": "NORMALIZED_DEATH_DATE", "comment": null}, "NORMALIZED_ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "NORMALIZED_ENROLLMENT_START_DATE", "comment": null}, "NORMALIZED_ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "NORMALIZED_ENROLLMENT_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"}, "model.the_tuva_project.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, "seed.the_tuva_project.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"GENDER": {"type": "TEXT", "index": 1, "name": "GENDER", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__gender"}, "model.the_tuva_project.normalized_input__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__eligibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_TEST_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_ADVANCED_ILLNESS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 5, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_END_DATE", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 7, "name": "PROCEDURE_DATE", "comment": null}, "PATIENT_TYPE": {"type": "TEXT", "index": 8, "name": "PATIENT_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness"}, "seed.the_tuva_project.terminology__ndc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "NDC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NDC": {"type": "TEXT", "index": 1, "name": "NDC", "comment": null}, "RXCUI": {"type": "TEXT", "index": 2, "name": "RXCUI", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "RXNORM_DESCRIPTION", "comment": null}, "FDA_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "FDA_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 821853.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7463936.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ndc"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 2, "name": "OBESITY", "comment": null}, "OSTEOARTHRITIS": {"type": "NUMBER", "index": 3, "name": "OSTEOARTHRITIS", "comment": null}, "COPD": {"type": "NUMBER", "index": 4, "name": "COPD", "comment": null}, "ANXIETY_DISORDERS": {"type": "NUMBER", "index": 5, "name": "ANXIETY_DISORDERS", "comment": null}, "CKD": {"type": "NUMBER", "index": 6, "name": "CKD", "comment": null}, "T2D": {"type": "NUMBER", "index": 7, "name": "T2D", "comment": null}, "CLL": {"type": "NUMBER", "index": 8, "name": "CLL", "comment": null}, "DYSPLIPIDEMIAS": {"type": "NUMBER", "index": 9, "name": "DYSPLIPIDEMIAS", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 10, "name": "HYPERTENSION", "comment": null}, "ATHEROSCLEROSIS": {"type": "NUMBER", "index": 11, "name": "ATHEROSCLEROSIS", "comment": null}, "DEMENTIA": {"type": "NUMBER", "index": 12, "name": "DEMENTIA", "comment": null}, "RHEUMATOID_ARTHRITIS": {"type": "NUMBER", "index": 13, "name": "RHEUMATOID_ARTHRITIS", "comment": null}, "CELIAC": {"type": "NUMBER", "index": 14, "name": "CELIAC", "comment": null}, "HIP_FRACTURE": {"type": "NUMBER", "index": 15, "name": "HIP_FRACTURE", "comment": null}, "IMMUNODEFICIENCIES_AND_WHITE_BLOOD_CELL_DISORDERS": {"type": "NUMBER", "index": 16, "name": "IMMUNODEFICIENCIES_AND_WHITE_BLOOD_CELL_DISORDERS", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 17, "name": "ASTHMA", "comment": null}, "T1D": {"type": "NUMBER", "index": 18, "name": "T1D", "comment": null}, "ULCERATIVE_COLITIS": {"type": "NUMBER", "index": 19, "name": "ULCERATIVE_COLITIS", "comment": null}, "CHROHNS": {"type": "NUMBER", "index": 20, "name": "CHROHNS", "comment": null}, "HOLICOBACTER": {"type": "NUMBER", "index": 21, "name": "HOLICOBACTER", "comment": null}, "BIPOLAR": {"type": "NUMBER", "index": 22, "name": "BIPOLAR", "comment": null}, "HEART_FAILURE": {"type": "NUMBER", "index": 23, "name": "HEART_FAILURE", "comment": null}, "TABACCO": {"type": "NUMBER", "index": 24, "name": "TABACCO", "comment": null}, "LYME": {"type": "NUMBER", "index": 25, "name": "LYME", "comment": null}, "BREAST_CANCER": {"type": "NUMBER", "index": 26, "name": "BREAST_CANCER", "comment": null}, "OSTEOPOROSIS": {"type": "NUMBER", "index": 27, "name": "OSTEOPOROSIS", "comment": null}, "PULMONARY_EMBOLISM": {"type": "NUMBER", "index": 28, "name": "PULMONARY_EMBOLISM", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 29, "name": "SCHIZOPHRENIA", "comment": null}, "ATRIAL_FIBRILLATION": {"type": "NUMBER", "index": 30, "name": "ATRIAL_FIBRILLATION", "comment": null}, "COLORECTAL_CANCER": {"type": "NUMBER", "index": 31, "name": "COLORECTAL_CANCER", "comment": null}, "DEPRESSION": {"type": "NUMBER", "index": 32, "name": "DEPRESSION", "comment": null}, "DEEP_VEIN_THROMBOSIS": {"type": "NUMBER", "index": 33, "name": "DEEP_VEIN_THROMBOSIS", "comment": null}, "ALZHEIMER": {"type": "NUMBER", "index": 34, "name": "ALZHEIMER", "comment": null}, "STROKE": {"type": "NUMBER", "index": 35, "name": "STROKE", "comment": null}, "MYOCARDIAL_INFRACTION": {"type": "NUMBER", "index": 36, "name": "MYOCARDIAL_INFRACTION", "comment": null}, "OPIOD_USE_DISORDER": {"type": "NUMBER", "index": 37, "name": "OPIOD_USE_DISORDER", "comment": null}, "LUNG_CANCER": {"type": "NUMBER", "index": 38, "name": "LUNG_CANCER", "comment": null}, "HERPES": {"type": "NUMBER", "index": 39, "name": "HERPES", "comment": null}, "RICKETTSIOSIS": {"type": "NUMBER", "index": 40, "name": "RICKETTSIOSIS", "comment": null}, "MS": {"type": "NUMBER", "index": 41, "name": "MS", "comment": null}, "ALCHOHOL": {"type": "NUMBER", "index": 42, "name": "ALCHOHOL", "comment": null}, "ADHD": {"type": "NUMBER", "index": 43, "name": "ADHD", "comment": null}, "HIV": {"type": "NUMBER", "index": 44, "name": "HIV", "comment": null}, "PTSD": {"type": "NUMBER", "index": 45, "name": "PTSD", "comment": null}, "LUPUS": {"type": "NUMBER", "index": 46, "name": "LUPUS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 47, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "seed.the_tuva_project.quality_measures__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_MEASURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ID": {"type": "TEXT", "index": 1, "name": "ID", "comment": null}, "NAME": {"type": "TEXT", "index": 2, "name": "NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 3, "name": "DESCRIPTION", "comment": null}, "VERSION": {"type": "TEXT", "index": 4, "name": "VERSION", "comment": null}, "STEWARD": {"type": "TEXT", "index": 5, "name": "STEWARD", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, "seed.the_tuva_project.terminology__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 1, "name": "MEDICARE_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "MEDICARE_STATUS_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, "seed.the_tuva_project.terminology__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ANSI_FIPS_STATE_CODE": {"type": "TEXT", "index": 1, "name": "ANSI_FIPS_STATE_CODE", "comment": null}, "ANSI_FIPS_STATE_ABBREVIATION": {"type": "TEXT", "index": 2, "name": "ANSI_FIPS_STATE_ABBREVIATION", "comment": null}, "ANSI_FIPS_STATE_NAME": {"type": "TEXT", "index": 3, "name": "ANSI_FIPS_STATE_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 55.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 1, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "NEWBORN_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "NEWBORN_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 16.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, "model.the_tuva_project.core__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 4, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 5, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 7, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 8, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 9, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 10, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 11, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 13, "name": "MEDICARE_STATUS_CODE", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 14, "name": "SUBSCRIBER_RELATION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__eligibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"}, "model.the_tuva_project.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "OBSERVATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__observation"}, "model.the_tuva_project.normalized_input__int_ms_drg_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MS_DRG_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting"}, "model.the_tuva_project.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID_A": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID_A", "comment": null}, "ENCOUNTER_ID_B": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID_B", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_PAYMENT_HCC_COUNT_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "PAYMENT_HCC_COUNT": {"type": "TEXT", "index": 8, "name": "PAYMENT_HCC_COUNT", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 10, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 73.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_CODE_AND_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "CCS_CODE_AND_DESCRIPTION", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 4, "name": "SPECIALTY_COHORT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, "model.the_tuva_project.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 13, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_COLUMN": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_COLUMN", "comment": null}, "NORMALIZED_PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "PRESENT_ON_ADMIT_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"}, "model.the_tuva_project.normalized_input__int_procedure_date_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_COLUMN": {"type": "TEXT", "index": 3, "name": "PROCEDURE_COLUMN", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 4, "name": "PROCEDURE_DATE", "comment": null}, "PROCEDURE_DATE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "PROCEDURE_DATE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize"}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, "seed.the_tuva_project.quality_measures__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 3, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 4, "name": "MEASURE_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 157.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "model.the_tuva_project.normalized_input__int_procedure_code_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 3, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_COLUMN": {"type": "TEXT", "index": 4, "name": "PROCEDURE_COLUMN", "comment": null}, "NORMALIZED_PROCEDURE_CODE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_PROCEDURE_CODE", "comment": null}, "PROCEDURE_CODE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "PROCEDURE_CODE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize"}, "model.the_tuva_project.core__stg_claims_practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 3, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DATES_INST", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst"}, "model.the_tuva_project.core__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_ICD_10_CM_MAPPINGS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DIAGNOSIS_CODE": {"type": "TEXT", "index": 1, "name": "DIAGNOSIS_CODE", "comment": null}, "CMS_HCC_ESRD_V21": {"type": "TEXT", "index": 2, "name": "CMS_HCC_ESRD_V21", "comment": null}, "CMS_HCC_ESRD_V24": {"type": "TEXT", "index": 3, "name": "CMS_HCC_ESRD_V24", "comment": null}, "CMS_HCC_V22": {"type": "TEXT", "index": 4, "name": "CMS_HCC_V22", "comment": null}, "CMS_HCC_V24": {"type": "TEXT", "index": 5, "name": "CMS_HCC_V24", "comment": null}, "CMS_HCC_V28": {"type": "TEXT", "index": 6, "name": "CMS_HCC_V28", "comment": null}, "RX_HCC_V05": {"type": "TEXT", "index": 7, "name": "RX_HCC_V05", "comment": null}, "RX_HCC_V08": {"type": "TEXT", "index": 8, "name": "RX_HCC_V08", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 11687.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 89088.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"}, "model.the_tuva_project.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 2, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 3, "name": "HCC_CODE_2", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 5, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 7, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 8, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INVALID_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 9, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"}, "seed.the_tuva_project.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "HEADER_FLAG": {"type": "TEXT", "index": 2, "name": "HEADER_FLAG", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "LONG_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 97296.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2130944.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, "model.the_tuva_project.normalized_input__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim"}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_ICD_10_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 2521.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, "seed.the_tuva_project.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SSA_FIPS_STATE_CODE": {"type": "TEXT", "index": 1, "name": "SSA_FIPS_STATE_CODE", "comment": null}, "SSA_FIPS_STATE_NAME": {"type": "TEXT", "index": 2, "name": "SSA_FIPS_STATE_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 78.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 4, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 5, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 6, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_PAID_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 13, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 16, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_PAID", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 4, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 8, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 9, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 14.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MIN_AGE": {"type": "NUMBER", "index": 2, "name": "MIN_AGE", "comment": null}, "MAX_AGE": {"type": "NUMBER", "index": 3, "name": "MAX_AGE", "comment": null}, "QUALIFYING_TYPES": {"type": "TEXT", "index": 4, "name": "QUALIFYING_TYPES", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, "seed.the_tuva_project.terminology__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ADMIT_TYPE_CODE": {"type": "TEXT", "index": 1, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_ALLOWED_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 13, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 16, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, "model.the_tuva_project.hcc_suspecting__int_prep_conditions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PREP_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 6, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions"}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_FILTER_ENCOUNTER_WITH_CLASSIFICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 21, "name": "CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, "model.the_tuva_project.normalized_input__int_revenue_center_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_REVENUE_CENTER_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize"}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ICD_10_CM_MAPPINGS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYMENT_YEAR": {"type": "NUMBER", "index": 1, "name": "PAYMENT_YEAR", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "CMS_HCC_V24": {"type": "TEXT", "index": 3, "name": "CMS_HCC_V24", "comment": null}, "CMS_HCC_V24_FLAG": {"type": "TEXT", "index": 4, "name": "CMS_HCC_V24_FLAG", "comment": null}, "CMS_HCC_V28": {"type": "TEXT", "index": 5, "name": "CMS_HCC_V28", "comment": null}, "CMS_HCC_V28_FLAG": {"type": "TEXT", "index": 6, "name": "CMS_HCC_V28_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 78932.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 459776.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_EXCLUDE_PROCEDURES_MEDICATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications"}, "model.the_tuva_project.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, "model.the_tuva_project.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, "model.the_tuva_project.hcc_suspecting__int_all_conditions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_ALL_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions"}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_PATIENT_SPEND_WITH_SERVICE_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 6, "name": "SERVICE_CATEGORY_2", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 7, "name": "TOTAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 9, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_CLEANED_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM_CODE": {"type": "TEXT", "index": 1, "name": "ICD_10_CM_CODE", "comment": null}, "ICD_10_CM_CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ICD_10_CM_CODE_DESCRIPTION", "comment": null}, "DEFAULT_CCSR_CATEGORY_IP": {"type": "TEXT", "index": 3, "name": "DEFAULT_CCSR_CATEGORY_IP", "comment": null}, "DEFAULT_CCSR_CATEGORY_DESCRIPTION_IP": {"type": "TEXT", "index": 4, "name": "DEFAULT_CCSR_CATEGORY_DESCRIPTION_IP", "comment": null}, "DEFAULT_CCSR_CATEGORY_OP": {"type": "TEXT", "index": 5, "name": "DEFAULT_CCSR_CATEGORY_OP", "comment": null}, "DEFAULT_CCSR_CATEGORY_DESCRIPTION_OP": {"type": "TEXT", "index": 6, "name": "DEFAULT_CCSR_CATEGORY_DESCRIPTION_OP", "comment": null}, "CCSR_CATEGORY_1": {"type": "TEXT", "index": 7, "name": "CCSR_CATEGORY_1", "comment": null}, "CCSR_CATEGORY_1_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "CCSR_CATEGORY_1_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_2": {"type": "TEXT", "index": 9, "name": "CCSR_CATEGORY_2", "comment": null}, "CCSR_CATEGORY_2_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "CCSR_CATEGORY_2_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_3": {"type": "TEXT", "index": 11, "name": "CCSR_CATEGORY_3", "comment": null}, "CCSR_CATEGORY_3_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "CCSR_CATEGORY_3_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_4": {"type": "TEXT", "index": 13, "name": "CCSR_CATEGORY_4", "comment": null}, "CCSR_CATEGORY_4_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "CCSR_CATEGORY_4_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_5": {"type": "TEXT", "index": 15, "name": "CCSR_CATEGORY_5", "comment": null}, "CCSR_CATEGORY_5_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "CCSR_CATEGORY_5_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_6": {"type": "TEXT", "index": 17, "name": "CCSR_CATEGORY_6", "comment": null}, "CCSR_CATEGORY_6_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "CCSR_CATEGORY_6_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 74549.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1899008.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NPI": {"type": "TEXT", "index": 1, "name": "NPI", "comment": null}, "ENTITY_TYPE_CODE": {"type": "TEXT", "index": 2, "name": "ENTITY_TYPE_CODE", "comment": null}, "ENTITY_TYPE_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "ENTITY_TYPE_DESCRIPTION", "comment": null}, "PRIMARY_TAXONOMY_CODE": {"type": "TEXT", "index": 4, "name": "PRIMARY_TAXONOMY_CODE", "comment": null}, "PRIMARY_SPECIALTY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "PRIMARY_SPECIALTY_DESCRIPTION", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 6, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 7, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 8, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 9, "name": "PARENT_ORGANIZATION_NAME", "comment": null}, "PRACTICE_ADDRESS_LINE_1": {"type": "TEXT", "index": 10, "name": "PRACTICE_ADDRESS_LINE_1", "comment": null}, "PRACTICE_ADDRESS_LINE_2": {"type": "TEXT", "index": 11, "name": "PRACTICE_ADDRESS_LINE_2", "comment": null}, "PRACTICE_CITY": {"type": "TEXT", "index": 12, "name": "PRACTICE_CITY", "comment": null}, "PRACTICE_STATE": {"type": "TEXT", "index": 13, "name": "PRACTICE_STATE", "comment": null}, "PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 14, "name": "PRACTICE_ZIP_CODE", "comment": null}, "LAST_UPDATED": {"type": "DATE", "index": 15, "name": "LAST_UPDATED", "comment": null}, "DEACTIVATION_DATE": {"type": "DATE", "index": 16, "name": "DEACTIVATION_DATE", "comment": null}, "DEACTIVATION_FLAG": {"type": "TEXT", "index": 17, "name": "DEACTIVATION_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 8274652.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 255586304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__provider"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_TEST_DETAIL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "GRAIN": {"type": "TEXT", "index": 4, "name": "GRAIN", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 7, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_ICD_10_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 12333.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 183808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_CLAIM_DATE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CLAIM_START_DATE": {"type": "DATE", "index": 5, "name": "NORMALIZED_CLAIM_START_DATE", "comment": null}, "NORMALIZED_CLAIM_END_DATE": {"type": "DATE", "index": 6, "name": "NORMALIZED_CLAIM_END_DATE", "comment": null}, "NORMALIZED_CLAIM_LINE_START_DATE": {"type": "DATE", "index": 7, "name": "NORMALIZED_CLAIM_LINE_START_DATE", "comment": null}, "NORMALIZED_CLAIM_LINE_END_DATE": {"type": "DATE", "index": 8, "name": "NORMALIZED_CLAIM_LINE_END_DATE", "comment": null}, "NORMALIZED_ADMISSION_DATE": {"type": "DATE", "index": 9, "name": "NORMALIZED_ADMISSION_DATE", "comment": null}, "NORMALIZED_DISCHARGE_DATE": {"type": "DATE", "index": 10, "name": "NORMALIZED_DISCHARGE_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"}, "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_COMORBIDITY_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "CONDITION_1_CONCEPT_NAME": {"type": "TEXT", "index": 5, "name": "CONDITION_1_CONCEPT_NAME", "comment": null}, "CONDITION_1_CODE": {"type": "TEXT", "index": 6, "name": "CONDITION_1_CODE", "comment": null}, "CONDITION_1_RECORDED_DATE": {"type": "DATE", "index": 7, "name": "CONDITION_1_RECORDED_DATE", "comment": null}, "CONDITION_2_CONCEPT_NAME": {"type": "TEXT", "index": 8, "name": "CONDITION_2_CONCEPT_NAME", "comment": null}, "CONDITION_2_CODE": {"type": "TEXT", "index": 9, "name": "CONDITION_2_CODE", "comment": null}, "CONDITION_2_RECORDED_DATE": {"type": "DATE", "index": 10, "name": "CONDITION_2_RECORDED_DATE", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 11, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 12, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 13, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 14, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects"}, "model.the_tuva_project.normalized_input__int_bill_type_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_BILL_TYPE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final"}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_FIRST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ENCOUNTER_DATA_FOR_MEDICAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 7, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 8, "name": "ENCOUNTER_END_DATE", "comment": null}, "ENCOUNTER_ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 9, "name": "ENCOUNTER_ADMIT_SOURCE_CODE", "comment": null}, "ENCOUNTER_ADMIT_TYPE_CODE": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ADMIT_TYPE_CODE", "comment": null}, "ENCOUNTER_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "ENCOUNTER_DISCHARGE_DISPOSITION_CODE", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 12, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 13, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_HIV_AIDS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "model.the_tuva_project.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 15, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 16, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 17, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 18, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 19, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 20, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 21, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 22, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 23, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 24, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 25, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, "seed.the_tuva_project.terminology__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__race"}, "model.the_tuva_project.normalized_input__int_admit_type_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_TYPE_NORMALIZE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting"}, "model.the_tuva_project.normalized_input__int_medical_npi_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_NPI_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_RENDERING_NPI": {"type": "TEXT", "index": 5, "name": "NORMALIZED_RENDERING_NPI", "comment": null}, "NORMALIZED_BILLING_NPI": {"type": "TEXT", "index": 6, "name": "NORMALIZED_BILLING_NPI", "comment": null}, "NORMALIZED_FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "NORMALIZED_FACILITY_NPI", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_INSTITUTIONAL_SNP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates"}, "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PATIENT_HCC_HISTORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 3, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 5, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 6, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "HCC_DESCRIPTION", "comment": null}, "FIRST_RECORDED": {"type": "DATE", "index": 8, "name": "FIRST_RECORDED", "comment": null}, "LAST_RECORDED": {"type": "DATE", "index": 9, "name": "LAST_RECORDED", "comment": null}, "LAST_BILLED": {"type": "DATE", "index": 10, "name": "LAST_BILLED", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 11, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 12, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 13, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 14, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"}, "model.the_tuva_project.normalized_input__int_ms_drg_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MS_DRG_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final"}, "seed.input_layer.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, "model.the_tuva_project.core__stg_claims_location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, "model.the_tuva_project.hcc_suspecting__int_lab_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_LAB_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 3, "name": "RESULT_DATE", "comment": null}, "RESULT": {"type": "NUMBER", "index": 4, "name": "RESULT", "comment": null}, "LAB_CODE": {"type": "TEXT", "index": 5, "name": "LAB_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 6, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "HCC_DESCRIPTION", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 8, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 9, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 10, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 11, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects"}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NPI": {"type": "TEXT", "index": 1, "name": "NPI", "comment": null}, "TAXONOMY_CODE": {"type": "TEXT", "index": 2, "name": "TAXONOMY_CODE", "comment": null}, "MEDICARE_SPECIALTY_CODE": {"type": "TEXT", "index": 3, "name": "MEDICARE_SPECIALTY_CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "PRIMARY_FLAG": {"type": "NUMBER", "index": 5, "name": "PRIMARY_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 9662399.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 70063104.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, "model.the_tuva_project.quality_measures__int_cqm236_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 7, "name": "OBSERVATION_DATE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_PROF_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values"}, "model.the_tuva_project.core__stg_claims_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, "model.the_tuva_project.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ACUTE_MYOCARDIAL_INFARCTION": {"type": "NUMBER", "index": 2, "name": "ACUTE_MYOCARDIAL_INFARCTION", "comment": null}, "ADHD_CONDUCT_DISORDERS_AND_HYPERKINETIC_SYNDROME": {"type": "NUMBER", "index": 3, "name": "ADHD_CONDUCT_DISORDERS_AND_HYPERKINETIC_SYNDROME", "comment": null}, "ALCOHOL_USE_DISORDERS": {"type": "NUMBER", "index": 4, "name": "ALCOHOL_USE_DISORDERS", "comment": null}, "ALZHEIMERS_DISEASE": {"type": "NUMBER", "index": 5, "name": "ALZHEIMERS_DISEASE", "comment": null}, "ANEMIA": {"type": "NUMBER", "index": 6, "name": "ANEMIA", "comment": null}, "ANXIETY_DISORDERS": {"type": "NUMBER", "index": 7, "name": "ANXIETY_DISORDERS", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 8, "name": "ASTHMA", "comment": null}, "ATRIAL_FIBRILLATION_AND_FLUTTER": {"type": "NUMBER", "index": 9, "name": "ATRIAL_FIBRILLATION_AND_FLUTTER", "comment": null}, "AUTISM_SPECTRUM_DISORDERS": {"type": "NUMBER", "index": 10, "name": "AUTISM_SPECTRUM_DISORDERS", "comment": null}, "BENIGN_PROSTATIC_HYPERPLASIA": {"type": "NUMBER", "index": 11, "name": "BENIGN_PROSTATIC_HYPERPLASIA", "comment": null}, "BIPOLAR_DISORDER": {"type": "NUMBER", "index": 12, "name": "BIPOLAR_DISORDER", "comment": null}, "CANCER_BREAST": {"type": "NUMBER", "index": 13, "name": "CANCER_BREAST", "comment": null}, "CANCER_COLORECTAL": {"type": "NUMBER", "index": 14, "name": "CANCER_COLORECTAL", "comment": null}, "CANCER_ENDOMETRIAL": {"type": "NUMBER", "index": 15, "name": "CANCER_ENDOMETRIAL", "comment": null}, "CANCER_LUNG": {"type": "NUMBER", "index": 16, "name": "CANCER_LUNG", "comment": null}, "CANCER_PROSTATE": {"type": "NUMBER", "index": 17, "name": "CANCER_PROSTATE", "comment": null}, "CANCER_UROLOGIC_KIDNEY_RENAL_PELVIS_AND_URETER": {"type": "NUMBER", "index": 18, "name": "CANCER_UROLOGIC_KIDNEY_RENAL_PELVIS_AND_URETER", "comment": null}, "CATARACT": {"type": "NUMBER", "index": 19, "name": "CATARACT", "comment": null}, "CEREBRAL_PALSY": {"type": "NUMBER", "index": 20, "name": "CEREBRAL_PALSY", "comment": null}, "CHRONIC_KIDNEY_DISEASE": {"type": "NUMBER", "index": 21, "name": "CHRONIC_KIDNEY_DISEASE", "comment": null}, "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE": {"type": "NUMBER", "index": 22, "name": "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE", "comment": null}, "CYSTIC_FIBROSIS_AND_OTHER_METABOLIC_DEVELOPMENTAL_DISORDERS": {"type": "NUMBER", "index": 23, "name": "CYSTIC_FIBROSIS_AND_OTHER_METABOLIC_DEVELOPMENTAL_DISORDERS", "comment": null}, "DEPRESSION_BIPOLAR_OR_OTHER_DEPRESSIVE_MOOD_DISORDERS": {"type": "NUMBER", "index": 24, "name": "DEPRESSION_BIPOLAR_OR_OTHER_DEPRESSIVE_MOOD_DISORDERS", "comment": null}, "DEPRESSIVE_DISORDERS": {"type": "NUMBER", "index": 25, "name": "DEPRESSIVE_DISORDERS", "comment": null}, "DIABETES": {"type": "NUMBER", "index": 26, "name": "DIABETES", "comment": null}, "DRUG_USE_DISORDERS": {"type": "NUMBER", "index": 27, "name": "DRUG_USE_DISORDERS", "comment": null}, "EPILEPSY": {"type": "NUMBER", "index": 28, "name": "EPILEPSY", "comment": null}, "FIBROMYALGIA_AND_CHRONIC_PAIN_AND_FATIGUE": {"type": "NUMBER", "index": 29, "name": "FIBROMYALGIA_AND_CHRONIC_PAIN_AND_FATIGUE", "comment": null}, "GLAUCOMA": {"type": "NUMBER", "index": 30, "name": "GLAUCOMA", "comment": null}, "HEART_FAILURE_AND_NON_ISCHEMIC_HEART_DISEASE": {"type": "NUMBER", "index": 31, "name": "HEART_FAILURE_AND_NON_ISCHEMIC_HEART_DISEASE", "comment": null}, "HEPATITIS_A": {"type": "NUMBER", "index": 32, "name": "HEPATITIS_A", "comment": null}, "HEPATITIS_B_ACUTE_OR_UNSPECIFIED": {"type": "NUMBER", "index": 33, "name": "HEPATITIS_B_ACUTE_OR_UNSPECIFIED", "comment": null}, "HEPATITIS_B_CHRONIC": {"type": "NUMBER", "index": 34, "name": "HEPATITIS_B_CHRONIC", "comment": null}, "HEPATITIS_C_ACUTE": {"type": "NUMBER", "index": 35, "name": "HEPATITIS_C_ACUTE", "comment": null}, "HEPATITIS_C_CHRONIC": {"type": "NUMBER", "index": 36, "name": "HEPATITIS_C_CHRONIC", "comment": null}, "HEPATITIS_C_UNSPECIFIED": {"type": "NUMBER", "index": 37, "name": "HEPATITIS_C_UNSPECIFIED", "comment": null}, "HEPATITIS_D": {"type": "NUMBER", "index": 38, "name": "HEPATITIS_D", "comment": null}, "HEPATITIS_E": {"type": "NUMBER", "index": 39, "name": "HEPATITIS_E", "comment": null}, "HIP_PELVIC_FRACTURE": {"type": "NUMBER", "index": 40, "name": "HIP_PELVIC_FRACTURE", "comment": null}, "HUMAN_IMMUNODEFICIENCY_VIRUS_AND_OR_ACQUIRED_IMMUNODEFICIENCY_SYNDROME_HIV_AIDS": {"type": "NUMBER", "index": 41, "name": "HUMAN_IMMUNODEFICIENCY_VIRUS_AND_OR_ACQUIRED_IMMUNODEFICIENCY_SYNDROME_HIV_AIDS", "comment": null}, "HYPERLIPIDEMIA": {"type": "NUMBER", "index": 42, "name": "HYPERLIPIDEMIA", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 43, "name": "HYPERTENSION", "comment": null}, "HYPOTHYROIDISM": {"type": "NUMBER", "index": 44, "name": "HYPOTHYROIDISM", "comment": null}, "INTELLECTUAL_DISABILITIES_AND_RELATED_CONDITIONS": {"type": "NUMBER", "index": 45, "name": "INTELLECTUAL_DISABILITIES_AND_RELATED_CONDITIONS", "comment": null}, "ISCHEMIC_HEART_DISEASE": {"type": "NUMBER", "index": 46, "name": "ISCHEMIC_HEART_DISEASE", "comment": null}, "LEARNING_DISABILITIES": {"type": "NUMBER", "index": 47, "name": "LEARNING_DISABILITIES", "comment": null}, "LEUKEMIAS_AND_LYMPHOMAS": {"type": "NUMBER", "index": 48, "name": "LEUKEMIAS_AND_LYMPHOMAS", "comment": null}, "LIVER_DISEASE_CIRRHOSIS_AND_OTHER_LIVER_CONDITIONS_EXCEPT_VIRAL_HEPATITIS": {"type": "NUMBER", "index": 49, "name": "LIVER_DISEASE_CIRRHOSIS_AND_OTHER_LIVER_CONDITIONS_EXCEPT_VIRAL_HEPATITIS", "comment": null}, "MIGRAINE_AND_CHRONIC_HEADACHE": {"type": "NUMBER", "index": 50, "name": "MIGRAINE_AND_CHRONIC_HEADACHE", "comment": null}, "MOBILITY_IMPAIRMENTS": {"type": "NUMBER", "index": 51, "name": "MOBILITY_IMPAIRMENTS", "comment": null}, "MULTIPLE_SCLEROSIS_AND_TRANSVERSE_MYELITIS": {"type": "NUMBER", "index": 52, "name": "MULTIPLE_SCLEROSIS_AND_TRANSVERSE_MYELITIS", "comment": null}, "MUSCULAR_DYSTROPHY": {"type": "NUMBER", "index": 53, "name": "MUSCULAR_DYSTROPHY", "comment": null}, "NON_ALZHEIMERS_DEMENTIA": {"type": "NUMBER", "index": 54, "name": "NON_ALZHEIMERS_DEMENTIA", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 55, "name": "OBESITY", "comment": null}, "OPIOID_USE_DISORDER_OUD": {"type": "NUMBER", "index": 56, "name": "OPIOID_USE_DISORDER_OUD", "comment": null}, "OSTEOPOROSIS_WITH_OR_WITHOUT_PATHOLOGICAL_FRACTURE": {"type": "NUMBER", "index": 57, "name": "OSTEOPOROSIS_WITH_OR_WITHOUT_PATHOLOGICAL_FRACTURE", "comment": null}, "OTHER_DEVELOPMENTAL_DELAYS": {"type": "NUMBER", "index": 58, "name": "OTHER_DEVELOPMENTAL_DELAYS", "comment": null}, "PARKINSONS_DISEASE_AND_SECONDARY_PARKINSONISM": {"type": "NUMBER", "index": 59, "name": "PARKINSONS_DISEASE_AND_SECONDARY_PARKINSONISM", "comment": null}, "PERIPHERAL_VASCULAR_DISEASE_PVD": {"type": "NUMBER", "index": 60, "name": "PERIPHERAL_VASCULAR_DISEASE_PVD", "comment": null}, "PERSONALITY_DISORDERS": {"type": "NUMBER", "index": 61, "name": "PERSONALITY_DISORDERS", "comment": null}, "PNEUMONIA_ALL_CAUSE": {"type": "NUMBER", "index": 62, "name": "PNEUMONIA_ALL_CAUSE", "comment": null}, "POST_TRAUMATIC_STRESS_DISORDER_PTSD": {"type": "NUMBER", "index": 63, "name": "POST_TRAUMATIC_STRESS_DISORDER_PTSD", "comment": null}, "PRESSURE_AND_CHRONIC_ULCERS": {"type": "NUMBER", "index": 64, "name": "PRESSURE_AND_CHRONIC_ULCERS", "comment": null}, "RHEUMATOID_ARTHRITIS_OSTEOARTHRITIS": {"type": "NUMBER", "index": 65, "name": "RHEUMATOID_ARTHRITIS_OSTEOARTHRITIS", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 66, "name": "SCHIZOPHRENIA", "comment": null}, "SCHIZOPHRENIA_AND_OTHER_PSYCHOTIC_DISORDERS": {"type": "NUMBER", "index": 67, "name": "SCHIZOPHRENIA_AND_OTHER_PSYCHOTIC_DISORDERS", "comment": null}, "SENSORY_BLINDNESS_AND_VISUAL_IMPAIRMENT": {"type": "NUMBER", "index": 68, "name": "SENSORY_BLINDNESS_AND_VISUAL_IMPAIRMENT", "comment": null}, "SENSORY_DEAFNESS_AND_HEARING_IMPAIRMENT": {"type": "NUMBER", "index": 69, "name": "SENSORY_DEAFNESS_AND_HEARING_IMPAIRMENT", "comment": null}, "SICKLE_CELL_DISEASE": {"type": "NUMBER", "index": 70, "name": "SICKLE_CELL_DISEASE", "comment": null}, "SPINA_BIFIDA_AND_OTHER_CONGENITAL_ANOMALIES_OF_THE_NERVOUS_SYSTEM": {"type": "NUMBER", "index": 71, "name": "SPINA_BIFIDA_AND_OTHER_CONGENITAL_ANOMALIES_OF_THE_NERVOUS_SYSTEM", "comment": null}, "SPINAL_CORD_INJURY": {"type": "NUMBER", "index": 72, "name": "SPINAL_CORD_INJURY", "comment": null}, "STROKE_TRANSIENT_ISCHEMIC_ATTACK": {"type": "NUMBER", "index": 73, "name": "STROKE_TRANSIENT_ISCHEMIC_ATTACK", "comment": null}, "TOBACCO_USE": {"type": "NUMBER", "index": 74, "name": "TOBACCO_USE", "comment": null}, "TRAUMATIC_BRAIN_INJURY_AND_NONPSYCHOTIC_MENTAL_DISORDERS_DUE_TO_BRAIN_DAMAGE": {"type": "NUMBER", "index": 75, "name": "TRAUMATIC_BRAIN_INJURY_AND_NONPSYCHOTIC_MENTAL_DISORDERS_DUE_TO_BRAIN_DAMAGE", "comment": null}, "VIRAL_HEPATITIS_GENERAL": {"type": "NUMBER", "index": 76, "name": "VIRAL_HEPATITIS_GENERAL", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 77, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "model.the_tuva_project.service_category__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, "model.the_tuva_project.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, "seed.input_layer.lab_result_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "LAB_RESULT_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.lab_result_seed"}, "model.the_tuva_project.quality_measures__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "NQF_2372": {"type": "NUMBER", "index": 2, "name": "NQF_2372", "comment": null}, "NQF_0034": {"type": "NUMBER", "index": 3, "name": "NQF_0034", "comment": null}, "NQF_0059": {"type": "NUMBER", "index": 4, "name": "NQF_0059", "comment": null}, "CQM_236": {"type": "NUMBER", "index": 5, "name": "CQM_236", "comment": null}, "NQF_0053": {"type": "NUMBER", "index": 6, "name": "NQF_0053", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "model.the_tuva_project.normalized_input__int_procedure_date_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "DATE", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting"}, "model.the_tuva_project.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, "model.the_tuva_project.medical_claim_expanded": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_EXPANDED", "name": "MEDICAL_CLAIM_EXPANDED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.medical_claim_expanded"}, "model.the_tuva_project.service_category__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DISTINCT_SERVICE_CATEGORY_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_SERVICE_CATEGORY_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, "seed.the_tuva_project.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_9_CM": {"type": "TEXT", "index": 1, "name": "ICD_9_CM", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 14567.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 390144.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DISTINCT_SERVICE_CATEGORY_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_SERVICE_CATEGORY_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "ORPHAN_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_CATEGORY": {"type": "TEXT", "index": 1, "name": "CLAIM_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, "model.the_tuva_project.service_category__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"}, "model.the_tuva_project.quality_measures__int_cqm236_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long"}, "seed.the_tuva_project.terminology__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_TYPE": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, "model.the_tuva_project.emergency_department__int_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_LINE_NUMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers"}, "model.the_tuva_project.normalized_input__int_present_on_admit_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting"}, "model.the_tuva_project.hcc_suspecting__int_all_medications": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_ALL_MEDICATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 2, "name": "DISPENSING_DATE", "comment": null}, "DRUG_CODE": {"type": "TEXT", "index": 3, "name": "DRUG_CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications"}, "seed.the_tuva_project.clinical_concepts": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "CLINICAL_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_ID": {"type": "TEXT", "index": 1, "name": "CONCEPT_ID", "comment": null}, "CONCEPT_NAME": {"type": "TEXT", "index": 2, "name": "CONCEPT_NAME", "comment": null}, "STATUS": {"type": "TEXT", "index": 3, "name": "STATUS", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 4, "name": "CONCEPT_OID", "comment": null}, "LAST_UPDATE_DATE": {"type": "DATE", "index": 5, "name": "LAST_UPDATE_DATE", "comment": null}, "LAST_UPDATE_NOTE": {"type": "TEXT", "index": 6, "name": "LAST_UPDATE_NOTE", "comment": null}, "CONCEPT_TYPE": {"type": "TEXT", "index": 7, "name": "CONCEPT_TYPE", "comment": null}, "CONTENT_SOURCE": {"type": "TEXT", "index": 8, "name": "CONTENT_SOURCE", "comment": null}, "EXTERNAL_SOURCE_DETAIL": {"type": "TEXT", "index": 9, "name": "EXTERNAL_SOURCE_DETAIL", "comment": null}, "CONCEPT_SCOPE": {"type": "TEXT", "index": 10, "name": "CONCEPT_SCOPE", "comment": null}, "VALUE_SET_SEARCH_NOTES": {"type": "TEXT", "index": 11, "name": "VALUE_SET_SEARCH_NOTES", "comment": null}, "CODE": {"type": "TEXT", "index": 12, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CODE_DESCRIPTION", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 14, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_VERSION": {"type": "TEXT", "index": 15, "name": "CODING_SYSTEM_VERSION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 86.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.clinical_concepts"}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_CLAIM_TYPE_MAPPING_FAILURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures"}, "model.the_tuva_project.quality_measures__int_nqf0053_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long"}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 8, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 9, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 10, "name": "FACILITY_NPI", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 11, "name": "CLAIM_TYPE", "comment": null}, "START_DATE": {"type": "DATE", "index": 12, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 13, "name": "END_DATE", "comment": null}, "DATE_USED_AS_START_DATE": {"type": "TEXT", "index": 14, "name": "DATE_USED_AS_START_DATE", "comment": null}, "DATE_USED_AS_END_DATE": {"type": "TEXT", "index": 15, "name": "DATE_USED_AS_END_DATE", "comment": null}, "DQ_PROBLEM": {"type": "NUMBER", "index": 16, "name": "DQ_PROBLEM", "comment": null}, "DQ_INSIGHT": {"type": "NUMBER", "index": 17, "name": "DQ_INSIGHT", "comment": null}, "START_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 18, "name": "START_DATE_NOT_DETERMINED", "comment": null}, "END_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 19, "name": "END_DATE_NOT_DETERMINED", "comment": null}, "START_DATE_AFTER_END_DATE": {"type": "NUMBER", "index": 20, "name": "START_DATE_AFTER_END_DATE", "comment": null}, "PATIENT_ID_NOT_UNIQUE": {"type": "NUMBER", "index": 21, "name": "PATIENT_ID_NOT_UNIQUE", "comment": null}, "PATIENT_ID_MISSING": {"type": "NUMBER", "index": 22, "name": "PATIENT_ID_MISSING", "comment": null}, "CLAIM_START_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 23, "name": "CLAIM_START_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_START_DATE_MISSING": {"type": "NUMBER", "index": 24, "name": "CLAIM_START_DATE_MISSING", "comment": null}, "CLAIM_END_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 25, "name": "CLAIM_END_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_END_DATE_MISSING": {"type": "NUMBER", "index": 26, "name": "CLAIM_END_DATE_MISSING", "comment": null}, "CLAIM_START_DATE_AFTER_CLAIM_END_DATE": {"type": "NUMBER", "index": 27, "name": "CLAIM_START_DATE_AFTER_CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 28, "name": "ADMISSION_DATE_NOT_UNIQUE", "comment": null}, "ADMISSION_DATE_MISSING": {"type": "NUMBER", "index": 29, "name": "ADMISSION_DATE_MISSING", "comment": null}, "DISCHARGE_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 30, "name": "DISCHARGE_DATE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DATE_MISSING": {"type": "NUMBER", "index": 31, "name": "DISCHARGE_DATE_MISSING", "comment": null}, "ADMISSION_DATE_AFTER_DISCHARGE_DATE": {"type": "NUMBER", "index": 32, "name": "ADMISSION_DATE_AFTER_DISCHARGE_DATE", "comment": null}, "ADMIT_TYPE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 33, "name": "ADMIT_TYPE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_TYPE_CODE_MISSING": {"type": "NUMBER", "index": 34, "name": "ADMIT_TYPE_CODE_MISSING", "comment": null}, "ADMIT_SOURCE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 35, "name": "ADMIT_SOURCE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_SOURCE_CODE_MISSING": {"type": "NUMBER", "index": 36, "name": "ADMIT_SOURCE_CODE_MISSING", "comment": null}, "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 37, "name": "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DISPOSITION_CODE_MISSING": {"type": "NUMBER", "index": 38, "name": "DISCHARGE_DISPOSITION_CODE_MISSING", "comment": null}, "FACILITY_NPI_NOT_UNIQUE": {"type": "NUMBER", "index": 39, "name": "FACILITY_NPI_NOT_UNIQUE", "comment": null}, "FACILITY_NPI_MISSING": {"type": "NUMBER", "index": 40, "name": "FACILITY_NPI_MISSING", "comment": null}, "CLAIM_TYPE_NOT_UNIQUE": {"type": "NUMBER", "index": 41, "name": "CLAIM_TYPE_NOT_UNIQUE", "comment": null}, "CLAIM_TYPE_MISSING": {"type": "NUMBER", "index": 42, "name": "CLAIM_TYPE_MISSING", "comment": null}, "CLAIM_TYPE_NOT_INSTITUTIONAL": {"type": "NUMBER", "index": 43, "name": "CLAIM_TYPE_NOT_INSTITUTIONAL", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 44, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 45, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"BILL_TYPE_CODE": {"type": "TEXT", "index": 1, "name": "BILL_TYPE_CODE", "comment": null}, "BILL_TYPE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "BILL_TYPE_DESCRIPTION", "comment": null}, "DEPRECATED": {"type": "NUMBER", "index": 3, "name": "DEPRECATED", "comment": null}, "DEPRECATED_DATE": {"type": "DATE", "index": 4, "name": "DEPRECATED_DATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1701.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 22016.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, "model.the_tuva_project.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_OBSERVATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, "seed.the_tuva_project.value_set_members": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "VALUE_SET_MEMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"VALUE_SET_MEMBER_ID": {"type": "TEXT", "index": 1, "name": "VALUE_SET_MEMBER_ID", "comment": null}, "CONCEPT_ID": {"type": "TEXT", "index": 2, "name": "CONCEPT_ID", "comment": null}, "STATUS": {"type": "TEXT", "index": 3, "name": "STATUS", "comment": null}, "LAST_UPDATE_DATE": {"type": "DATE", "index": 4, "name": "LAST_UPDATE_DATE", "comment": null}, "LAST_UPDATE_NOTE": {"type": "TEXT", "index": 5, "name": "LAST_UPDATE_NOTE", "comment": null}, "CODE": {"type": "TEXT", "index": 6, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "CODE_DESCRIPTION", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 8, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_VERSION": {"type": "TEXT", "index": 9, "name": "CODING_SYSTEM_VERSION", "comment": null}, "INCLUDE_DESCENDANTS": {"type": "TEXT", "index": 10, "name": "INCLUDE_DESCENDANTS", "comment": null}, "COMMENT": {"type": "TEXT", "index": 11, "name": "COMMENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4602.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.value_set_members"}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, "model.the_tuva_project.hcc_suspecting__int_medication_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_MEDICATION_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 5, "name": "DISPENSING_DATE", "comment": null}, "DRUG_CODE": {"type": "TEXT", "index": 6, "name": "DRUG_CODE", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 7, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 8, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 9, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 10, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects"}, "seed.the_tuva_project.hcc_suspecting__clinical_concepts": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_CLINICAL_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "CODE": {"type": "TEXT", "index": 3, "name": "CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 25472.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 188928.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts"}, "model.the_tuva_project.readmissions__encounter_data_quality": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_DATA_QUALITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 3, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 4, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 5, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 6, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 7, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 8, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 9, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 11, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 12, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 13, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, "seed.the_tuva_project.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MS_DRG_CODE": {"type": "TEXT", "index": 1, "name": "MS_DRG_CODE", "comment": null}, "MDC_CODE": {"type": "TEXT", "index": 2, "name": "MDC_CODE", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 3, "name": "MEDICAL_SURGICAL", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "MS_DRG_DESCRIPTION", "comment": null}, "DEPRECATED": {"type": "NUMBER", "index": 5, "name": "DEPRECATED", "comment": null}, "DEPRECATED_DATE": {"type": "DATE", "index": 6, "name": "DEPRECATED_DATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 812.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 16896.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_TUVA_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_FAMILY": {"type": "TEXT", "index": 1, "name": "CONDITION_FAMILY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 3, "name": "ICD_10_CM_CODE", "comment": null}, "ICD_10_CM_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_DESCRIPTION", "comment": null}, "CONDITION_COLUMN_NAME": {"type": "TEXT", "index": 5, "name": "CONDITION_COLUMN_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1583.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 35840.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "model.the_tuva_project.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DUAL_STATUS_CODE": {"type": "TEXT", "index": 1, "name": "DUAL_STATUS_CODE", "comment": null}, "DUAL_STATUS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DUAL_STATUS_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 11.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates"}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "DETERMINED_ENCOUNTER_START_DATE": {"type": "DATE", "index": 5, "name": "DETERMINED_ENCOUNTER_START_DATE", "comment": null}, "DETERMINED_ENCOUNTER_END_DATE": {"type": "DATE", "index": 6, "name": "DETERMINED_ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, "model.the_tuva_project.normalized_input__int_medical_date_aggregation": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_DATE_AGGREGATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "MINIMUM_CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "MINIMUM_CLAIM_START_DATE", "comment": null}, "MAXIMUM_CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "MAXIMUM_CLAIM_END_DATE", "comment": null}, "MINIMUM_ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "MINIMUM_ADMISSION_DATE", "comment": null}, "MAXIMUM_DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "MAXIMUM_DISCHARGE_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation"}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "NUMERATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, "seed.the_tuva_project.terminology__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, "model.the_tuva_project.service_category__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, "model.the_tuva_project.hcc_suspecting__int_observation_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_OBSERVATION_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 3, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_RESULT": {"type": "TEXT", "index": 4, "name": "OBSERVATION_RESULT", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 5, "name": "CONDITION_CODE", "comment": null}, "CONDITION_DATE": {"type": "DATE", "index": 6, "name": "CONDITION_DATE", "comment": null}, "CONDITION_CONCEPT_NAME": {"type": "TEXT", "index": 7, "name": "CONDITION_CONCEPT_NAME", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 8, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "HCC_DESCRIPTION", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 10, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 11, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 12, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 13, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects"}, "model.the_tuva_project.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, "model.the_tuva_project.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 5, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 6, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 7, "name": "READMIT_30_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, "model.the_tuva_project.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LAB_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "TEXT", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "TEXT", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__lab_result"}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 2, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 3, "name": "PAYMENT_YEAR", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 4, "name": "HCC_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, "seed.the_tuva_project.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_9_PCS": {"type": "TEXT", "index": 1, "name": "ICD_9_PCS", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3882.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 105984.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, "model.the_tuva_project.normalized_input__int_place_of_service_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PLACE_OF_SERVICE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 8, "name": "SHORT_NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 10, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 11, "name": "HCC_CODE_2", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 12, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 961.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 16384.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"}, "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 6, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 9, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_ALLOWED_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 10, "name": "OTHER_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 11, "name": "PHARMACY_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy"}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_CLAIM_TYPE_UNMAPPED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped"}, "model.the_tuva_project.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, "model.the_tuva_project.quality_measures__int_cqm236_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 5, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 6, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 7, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 80.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 2, "name": "CONDITION_CODE", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 3, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"}, "seed.the_tuva_project.terminology__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"REVENUE_CENTER_CODE": {"type": "TEXT", "index": 1, "name": "REVENUE_CENTER_CODE", "comment": null}, "REVENUE_CENTER_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "REVENUE_CENTER_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 526.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "EXCLUSION_CATEGORY": {"type": "TEXT", "index": 3, "name": "EXCLUSION_CATEGORY", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 47.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values"}, "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 9, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 12, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYMENT_YEAR": {"type": "NUMBER", "index": 1, "name": "PAYMENT_YEAR", "comment": null}, "HCPCS_CPT_CODE": {"type": "TEXT", "index": 2, "name": "HCPCS_CPT_CODE", "comment": null}, "INCLUDED_FLAG": {"type": "TEXT", "index": 3, "name": "INCLUDED_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 39364.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 94208.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 78638.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1001472.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, "model.the_tuva_project.normalized_input__int_admit_source_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_SOURCE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final"}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 13, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 14, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 15, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 16, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_LINE_NUMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"}, "model.the_tuva_project.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__condition"}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 2, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE": {"type": "TEXT", "index": 3, "name": "EVIDENCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, "model.the_tuva_project.quality_measures__int_cqm236_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions"}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC_DEPRECATED_MAPPING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "MAP_TO": {"type": "TEXT", "index": 2, "name": "MAP_TO", "comment": null}, "COMMENT": {"type": "TEXT", "index": 3, "name": "COMMENT", "comment": null}, "FINAL_MAP_TO": {"type": "TEXT", "index": 4, "name": "FINAL_MAP_TO", "comment": null}, "ALL_COMMENTS": {"type": "TEXT", "index": 5, "name": "ALL_COMMENTS", "comment": null}, "DEPTH": {"type": "TEXT", "index": 6, "name": "DEPTH", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4613.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 2, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 3, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 5, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 8, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 9, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 10, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 10, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 11, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 12, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 13, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 14, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 15, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 16, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 17, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 18, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 19, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 20, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 21, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 22, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 23, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 24, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 27, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 28, "name": "URGENT_CARE_PAID", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 29, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 30, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 31, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 32, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 33, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 36, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 38, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 40, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 41, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 42, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 43, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 44, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 45, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 46, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 48, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 49, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 50, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 51, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 52, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 53, "name": "MEDICAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 54, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 55, "name": "MEDICAL_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "model.the_tuva_project.hcc_suspecting__summary": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 2, "name": "PATIENT_SEX", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 3, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 4, "name": "PATIENT_AGE", "comment": null}, "SUSPECTING_GAPS": {"type": "NUMBER", "index": 5, "name": "SUSPECTING_GAPS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__summary"}, "model.the_tuva_project.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CODE_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 6, "name": "CONDITION_RANK", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 7, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "BODY_SYSTEM": {"type": "TEXT", "index": 8, "name": "BODY_SYSTEM", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 10, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_RANK": {"type": "NUMBER", "index": 12, "name": "CCSR_CATEGORY_RANK", "comment": null}, "IS_IP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 13, "name": "IS_IP_DEFAULT_CATEGORY", "comment": null}, "IS_OP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 14, "name": "IS_OP_DEFAULT_CATEGORY", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 15, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DENOMINATORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DENOMINATOR_NAME": {"type": "TEXT", "index": 1, "name": "TEST_DENOMINATOR_NAME", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"}, "model.the_tuva_project.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter"}, "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"}, "model.the_tuva_project.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LAB_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "TEXT", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "TEXT", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, "model.the_tuva_project.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, "model.the_tuva_project.normalized_input__int_admit_source_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_SOURCE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting"}, "model.the_tuva_project.insights__count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PREP_EGFR_LABS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 3, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 4, "name": "CODE", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 5, "name": "RESULT_DATE", "comment": null}, "RESULT": {"type": "NUMBER", "index": 6, "name": "RESULT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_PAID_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 10, "name": "OTHER_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 11, "name": "PHARMACY_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, "model.the_tuva_project.financial_pmpm__pmpm_payer": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PAYER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 2, "name": "PAYER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 4, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 6, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 8, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 9, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 10, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 11, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 12, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 13, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 14, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 15, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 16, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 17, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 18, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 19, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 20, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 21, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 22, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 23, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 24, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 28, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 29, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 30, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 31, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 32, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 33, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 35, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 36, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 37, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 38, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 39, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 40, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 41, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 42, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 43, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 44, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 45, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 46, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 47, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 48, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 49, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 50, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 51, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 52, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 53, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 54, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 55, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer"}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 1, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_1YP": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN_1YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_2YP": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN_2YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_4YP": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN_4YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_9YP": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_BEGIN_9YP", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 8, "name": "HCC_CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 10, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1369.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 24576.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, "seed.the_tuva_project.terminology__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 1, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "PLACE_OF_SERVICE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "PLACE_OF_SERVICE_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 50.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, "model.the_tuva_project.quality_measures__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "DENOMINATOR_SUM": {"type": "NUMBER", "index": 6, "name": "DENOMINATOR_SUM", "comment": null}, "NUMERATOR_SUM": {"type": "NUMBER", "index": 7, "name": "NUMERATOR_SUM", "comment": null}, "EXCLUSION_SUM": {"type": "NUMBER", "index": 8, "name": "EXCLUSION_SUM", "comment": null}, "PERFORMANCE_RATE": {"type": "NUMBER", "index": 9, "name": "PERFORMANCE_RATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, "model.the_tuva_project.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__encounter"}, "seed.input_layer.observation_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "OBSERVATION_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.observation_seed"}, "model.the_tuva_project.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, "seed.the_tuva_project.terminology__loinc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 2, "name": "SHORT_NAME", "comment": null}, "LONG_COMMON_NAME": {"type": "TEXT", "index": 3, "name": "LONG_COMMON_NAME", "comment": null}, "COMPONENT": {"type": "TEXT", "index": 4, "name": "COMPONENT", "comment": null}, "PROPERTY": {"type": "TEXT", "index": 5, "name": "PROPERTY", "comment": null}, "TIME_ASPECT": {"type": "TEXT", "index": 6, "name": "TIME_ASPECT", "comment": null}, "SYSTEM": {"type": "TEXT", "index": 7, "name": "SYSTEM", "comment": null}, "SCALE_TYPE": {"type": "TEXT", "index": 8, "name": "SCALE_TYPE", "comment": null}, "METHOD_TYPE": {"type": "TEXT", "index": 9, "name": "METHOD_TYPE", "comment": null}, "CLASS_CODE": {"type": "TEXT", "index": 10, "name": "CLASS_CODE", "comment": null}, "CLASS_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CLASS_DESCRIPTION", "comment": null}, "CLASS_TYPE_CODE": {"type": "TEXT", "index": 12, "name": "CLASS_TYPE_CODE", "comment": null}, "CLASS_TYPE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CLASS_TYPE_DESCRIPTION", "comment": null}, "EXTERNAL_COPYRIGHT_NOTICE": {"type": "TEXT", "index": 14, "name": "EXTERNAL_COPYRIGHT_NOTICE", "comment": null}, "STATUS": {"type": "TEXT", "index": 15, "name": "STATUS", "comment": null}, "VERSION_FIRST_RELEASED": {"type": "TEXT", "index": 16, "name": "VERSION_FIRST_RELEASED", "comment": null}, "VERSION_LAST_CHANGED": {"type": "TEXT", "index": 17, "name": "VERSION_LAST_CHANGED", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 101632.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4118528.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc"}, "seed.the_tuva_project.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FIPS_CODE": {"type": "TEXT", "index": 1, "name": "FIPS_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 2, "name": "COUNTY", "comment": null}, "STATE": {"type": "TEXT", "index": 3, "name": "STATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3232.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 31232.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, "model.the_tuva_project.value_set_member_relevant_fields": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "VALUE_SET_MEMBER_RELEVANT_FIELDS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_ID": {"type": "TEXT", "index": 1, "name": "CONCEPT_ID", "comment": null}, "CONCEPT_NAME": {"type": "TEXT", "index": 2, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_TYPE": {"type": "TEXT", "index": 3, "name": "CONCEPT_TYPE", "comment": null}, "VALUE_SET_MEMBER_ID": {"type": "TEXT", "index": 4, "name": "VALUE_SET_MEMBER_ID", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 6, "name": "CODING_SYSTEM_ID", "comment": null}, "INCLUDE_DESCENDANTS": {"type": "TEXT", "index": 7, "name": "INCLUDE_DESCENDANTS", "comment": null}, "CODING_SYSTEM_NAME": {"type": "TEXT", "index": 8, "name": "CODING_SYSTEM_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4602.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 56320.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.value_set_member_relevant_fields"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, "model.the_tuva_project.quality_measures__int_cqm236__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period"}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, "model.the_tuva_project.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, "seed.the_tuva_project.terminology__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE_TYPE": {"type": "TEXT", "index": 1, "name": "CODE_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__code_type"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"APR_DRG_CODE": {"type": "TEXT", "index": 1, "name": "APR_DRG_CODE", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 2, "name": "MEDICAL_SURGICAL", "comment": null}, "MDC_CODE": {"type": "TEXT", "index": 3, "name": "MDC_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "APR_DRG_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 316.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 65.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 2, "name": "SPECIALTY_COHORT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "V24_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "V24_RISK_SCORE", "comment": null}, "V28_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "V28_RISK_SCORE", "comment": null}, "BLENDED_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "BLENDED_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 5, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 6, "name": "PAYMENT_RISK_SCORE", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "model.the_tuva_project.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DQ_PROBLEM": {"type": "TEXT", "index": 2, "name": "DQ_PROBLEM", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, "model.the_tuva_project.normalized_input__int_present_on_admit_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 5, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 6, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 7, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 8, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 9, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 10, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 11, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 12, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 13, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 15, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 16, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 17, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 18, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 19, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 20, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 21, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 22, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 23, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 24, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 25, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 26, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 27, "name": "DIAGNOSIS_POA_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final"}, "model.the_tuva_project.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "FIRST_DIAGNOSIS_DATE": {"type": "DATE", "index": 3, "name": "FIRST_DIAGNOSIS_DATE", "comment": null}, "LAST_DIAGNOSIS_DATE": {"type": "DATE", "index": 4, "name": "LAST_DIAGNOSIS_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_CMS_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "CONDITION_COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "CONDITION_COLUMN_NAME", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "ADDITIONAL_LOGIC": {"type": "TEXT", "index": 6, "name": "ADDITIONAL_LOGIC", "comment": null}, "CLAIMS_QUALIFICATION": {"type": "TEXT", "index": 7, "name": "CLAIMS_QUALIFICATION", "comment": null}, "INCLUSION_TYPE": {"type": "TEXT", "index": 8, "name": "INCLUSION_TYPE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 9, "name": "CODE_SYSTEM", "comment": null}, "CODE": {"type": "TEXT", "index": 10, "name": "CODE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 6532.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 143360.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, "model.the_tuva_project.insights__count_claim_by_date_column": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_DATE_COLUMN", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "NUMBER", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 8, "name": "DISPENSING_DATE", "comment": null}, "PHARMACY_PAID_DATE": {"type": "NUMBER", "index": 9, "name": "PHARMACY_PAID_DATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, "model.the_tuva_project.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 3, "name": "NORMALIZED_CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 5, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 6, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 8, "name": "CLINICAL_DOMAIN", "comment": null}, "PRCCSR_VERSION": {"type": "TEXT", "index": 9, "name": "PRCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 1, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 2, "name": "CONDITION_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 4, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 5, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, "model.the_tuva_project.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__patient"}, "seed.input_layer.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.medical_claim_seed"}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_RANK": {"type": "NUMBER", "index": 6, "name": "CCSR_CATEGORY_RANK", "comment": null}, "IS_IP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 7, "name": "IS_IP_DEFAULT_CATEGORY", "comment": null}, "IS_OP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 8, "name": "IS_OP_DEFAULT_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 86288.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2376192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD9": {"type": "TEXT", "index": 1, "name": "ICD9", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 7443.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 53248.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "seed.the_tuva_project.data_quality__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_VALUE_SET_TEST_CATALOG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "TEST_FIELD": {"type": "TEXT", "index": 4, "name": "TEST_FIELD", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 299.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7680.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.data_quality__test_catalog"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"}, "model.the_tuva_project.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medical_claim"}, "model.the_tuva_project.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 15, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 16, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 17, "name": "READMIT_30_FLAG", "comment": null}, "UNPLANNED_READMIT_30_FLAG": {"type": "NUMBER", "index": 18, "name": "UNPLANNED_READMIT_30_FLAG", "comment": null}, "READMISSION_ENCOUNTER_ID": {"type": "TEXT", "index": 19, "name": "READMISSION_ENCOUNTER_ID", "comment": null}, "READMISSION_ADMIT_DATE": {"type": "DATE", "index": 20, "name": "READMISSION_ADMIT_DATE", "comment": null}, "READMISSION_DISCHARGE_DATE": {"type": "DATE", "index": 21, "name": "READMISSION_DISCHARGE_DATE", "comment": null}, "READMISSION_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 22, "name": "READMISSION_DISCHARGE_DISPOSITION_CODE", "comment": null}, "READMISSION_FACILITY": {"type": "TEXT", "index": 23, "name": "READMISSION_FACILITY", "comment": null}, "READMISSION_MS_DRG": {"type": "TEXT", "index": 24, "name": "READMISSION_MS_DRG", "comment": null}, "READMISSION_LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "READMISSION_LENGTH_OF_STAY", "comment": null}, "READMISSION_INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 26, "name": "READMISSION_INDEX_ADMISSION_FLAG", "comment": null}, "READMISSION_PLANNED_FLAG": {"type": "NUMBER", "index": 27, "name": "READMISSION_PLANNED_FLAG", "comment": null}, "READMISSION_SPECIALTY_COHORT": {"type": "TEXT", "index": 28, "name": "READMISSION_SPECIALTY_COHORT", "comment": null}, "READMISSION_DIED_FLAG": {"type": "NUMBER", "index": 29, "name": "READMISSION_DIED_FLAG", "comment": null}, "READMISSION_DIAGNOSIS_CCS": {"type": "TEXT", "index": 30, "name": "READMISSION_DIAGNOSIS_CCS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, "model.the_tuva_project.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DQ_PROBLEM": {"type": "TEXT", "index": 1, "name": "DQ_PROBLEM", "comment": null}, "DISTINCT_CLAIMS": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIMS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_COLUMN": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_COLUMN", "comment": null}, "NORMALIZED_DIAGNOSIS_CODE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_CODE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "DIAGNOSIS_CODE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MDC_CODE": {"type": "TEXT", "index": 1, "name": "MDC_CODE", "comment": null}, "MDC_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "MDC_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 25.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__mdc"}, "model.the_tuva_project.normalized_input__int_discharge_disposition_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DISCHARGE_DISPOSITION_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final"}, "model.the_tuva_project.quality_measures__int_nqf0053_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 8, "name": "EVIDENCE_VALUE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator"}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, "model.the_tuva_project.emergency_department__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "EMERGENCY_DEPARTMENT_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__summary"}, "model.the_tuva_project.normalized_input__int_procedure_code_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting"}, "model.the_tuva_project.service_category__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_CLAIMS_WITH_ENCOUNTER_DATA", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 6, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 7, "name": "ENCOUNTER_END_DATE", "comment": null}, "ENCOUNTER_ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "ENCOUNTER_ADMIT_SOURCE_CODE", "comment": null}, "ENCOUNTER_ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ENCOUNTER_ADMIT_TYPE_CODE", "comment": null}, "ENCOUNTER_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_DISCHARGE_DISPOSITION_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FIELD": {"type": "TEXT", "index": 1, "name": "FIELD", "comment": null}, "TOTAL_COUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 29.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, "model.the_tuva_project.core__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 3, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__practitioner"}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_FIRST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 22, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medication"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYER_TYPE": {"type": "TEXT", "index": 1, "name": "PAYER_TYPE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, "seed.the_tuva_project.coding_systems": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "CODING_SYSTEMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODING_SYSTEM_ID": {"type": "TEXT", "index": 1, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_NAME": {"type": "TEXT", "index": 2, "name": "CODING_SYSTEM_NAME", "comment": null}, "CODING_SYSTEM_URI": {"type": "TEXT", "index": 3, "name": "CODING_SYSTEM_URI", "comment": null}, "CODING_SYSTEM_OID": {"type": "TEXT", "index": 4, "name": "CODING_SYSTEM_OID", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.coding_systems"}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 4, "name": "INSTITUTIONAL_STATUS", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 5, "name": "SHORT_NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 7, "name": "HCC_CODE", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 8, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 40.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"}, "seed.the_tuva_project.terminology__medicare_orec": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_OREC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 1, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, "model.the_tuva_project.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_INVALID_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 7, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "GENDER": {"type": "TEXT", "index": 9, "name": "GENDER", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 10, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_HOSPICE_PALLIATIVE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"}, "model.the_tuva_project.hcc_suspecting__list_rollup": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "LIST_ROLLUP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "REASON": {"type": "TEXT", "index": 4, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 5, "name": "CONTRIBUTING_FACTOR", "comment": null}, "LATEST_SUSPECT_DATE": {"type": "DATE", "index": 6, "name": "LATEST_SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup"}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_LAST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_DEMENTIA", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 5, "name": "DISPENSING_DATE", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 6, "name": "PAID_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"}, "model.the_tuva_project.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_DENOMINATORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DENOMINATOR_NAME": {"type": "TEXT", "index": 1, "name": "TEST_DENOMINATOR_NAME", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"}, "model.the_tuva_project.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, "seed.the_tuva_project.terminology__rxnorm_to_atc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RXNORM_TO_ATC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"RXCUI": {"type": "TEXT", "index": 1, "name": "RXCUI", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_1_NAME": {"type": "TEXT", "index": 3, "name": "ATC_1_NAME", "comment": null}, "ATC_2_NAME": {"type": "TEXT", "index": 4, "name": "ATC_2_NAME", "comment": null}, "ATC_3_NAME": {"type": "TEXT", "index": 5, "name": "ATC_3_NAME", "comment": null}, "ATC_4_NAME": {"type": "TEXT", "index": 6, "name": "ATC_4_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 24210.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 836096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc"}, "model.the_tuva_project.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ED_CLASSIFICATION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ED_CLASSIFICATION_DESCRIPTION", "comment": null}, "ED_CLASSIFICATION_ORDER": {"type": "TEXT", "index": 3, "name": "ED_CLASSIFICATION_ORDER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 6, "name": "YEAR_MONTH", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 12, "name": "FACILITY_NPI", "comment": null}, "FACILITY_NAME": {"type": "TEXT", "index": 13, "name": "FACILITY_NAME", "comment": null}, "FACILITY_STATE": {"type": "TEXT", "index": 14, "name": "FACILITY_STATE", "comment": null}, "FACILITY_CITY": {"type": "TEXT", "index": 15, "name": "FACILITY_CITY", "comment": null}, "FACILITY_ZIP_CODE": {"type": "TEXT", "index": 16, "name": "FACILITY_ZIP_CODE", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 17, "name": "PATIENT_SEX", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 18, "name": "PATIENT_AGE", "comment": null}, "PATIENT_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PATIENT_ZIP_CODE", "comment": null}, "PATIENT_LATITUDE": {"type": "FLOAT", "index": 20, "name": "PATIENT_LATITUDE", "comment": null}, "PATIENT_LONGITUDE": {"type": "FLOAT", "index": 21, "name": "PATIENT_LONGITUDE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 22, "name": "PATIENT_RACE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__summary"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, "model.the_tuva_project.normalized_input__int_admit_type_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_TYPE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final"}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_WITH_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 11, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 1, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 41.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, "model.the_tuva_project.normalized_input__int_apr_drg_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_APR_DRG_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_COLECTOMY_CANCER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_LAST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates"}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, "model.the_tuva_project.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PROCEDURE_CODE": {"type": "TEXT", "index": 2, "name": "PROCEDURE_CODE", "comment": null}, "VALID_ICD_10_PCS_FLAG": {"type": "NUMBER", "index": 3, "name": "VALID_ICD_10_PCS_FLAG", "comment": null}, "CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, "model.the_tuva_project.hcc_suspecting__list": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "LIST", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "REASON": {"type": "TEXT", "index": 5, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 6, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 7, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__list"}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "model.the_tuva_project.quality_measures__int_nqf0059_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 5, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 6, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 7, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator"}, "model.the_tuva_project.normalized_input__int_apr_drg_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_APR_DRG_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"HCPCS": {"type": "TEXT", "index": 1, "name": "HCPCS", "comment": null}, "SEQNUM": {"type": "TEXT", "index": 2, "name": "SEQNUM", "comment": null}, "RECID": {"type": "TEXT", "index": 3, "name": "RECID", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 7501.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 368640.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, "seed.the_tuva_project.terminology__snomed_icd_10_map": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SNOMED_ICD_10_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ID": {"type": "TEXT", "index": 1, "name": "ID", "comment": null}, "EFFECTIVE_TIME": {"type": "TEXT", "index": 2, "name": "EFFECTIVE_TIME", "comment": null}, "ACTIVE": {"type": "TEXT", "index": 3, "name": "ACTIVE", "comment": null}, "MODULE_ID": {"type": "TEXT", "index": 4, "name": "MODULE_ID", "comment": null}, "REF_SET_ID": {"type": "TEXT", "index": 5, "name": "REF_SET_ID", "comment": null}, "REFERENCED_COMPONENT_ID": {"type": "TEXT", "index": 6, "name": "REFERENCED_COMPONENT_ID", "comment": null}, "REFERENCED_COMPONENT_NAME": {"type": "TEXT", "index": 7, "name": "REFERENCED_COMPONENT_NAME", "comment": null}, "MAP_GROUP": {"type": "TEXT", "index": 8, "name": "MAP_GROUP", "comment": null}, "MAP_PRIORITY": {"type": "TEXT", "index": 9, "name": "MAP_PRIORITY", "comment": null}, "MAP_RULE": {"type": "TEXT", "index": 10, "name": "MAP_RULE", "comment": null}, "MAP_ADVICE": {"type": "TEXT", "index": 11, "name": "MAP_ADVICE", "comment": null}, "MAP_TARGET": {"type": "TEXT", "index": 12, "name": "MAP_TARGET", "comment": null}, "MAP_TARGET_NAME": {"type": "TEXT", "index": 13, "name": "MAP_TARGET_NAME", "comment": null}, "CORRELATION_ID": {"type": "TEXT", "index": 14, "name": "CORRELATION_ID", "comment": null}, "MAP_CATEGORY_ID": {"type": "TEXT", "index": 15, "name": "MAP_CATEGORY_ID", "comment": null}, "MAP_CATEGORY_NAME": {"type": "TEXT", "index": 16, "name": "MAP_CATEGORY_NAME", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 256479.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 11658240.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map"}, "seed.the_tuva_project.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_1": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, "seed.input_layer.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.eligibility_seed"}, "model.the_tuva_project.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, "model.the_tuva_project.core__stg_clinical_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, "model.the_tuva_project.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, "model.the_tuva_project.core__stg_claims_encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 4, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 5, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 7, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 8, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 9, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 10, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 11, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 13, "name": "MEDICARE_STATUS_CODE", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 14, "name": "SUBSCRIBER_RELATION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_EXCLUDE_PROCEDURES_OBSERVATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 5, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"}, "model.the_tuva_project.core__stg_claims_condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_OUD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:56UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "model.the_tuva_project.normalized_input__int_bill_type_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_BILL_TYPE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting"}, "model.the_tuva_project.core__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__procedure"}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.data_quality__claims_preprocessing_use_case": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_USE_CASE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"USE_CASE": {"type": "TEXT", "index": 1, "name": "USE_CASE", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 4, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 5, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INVALID_NPI", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 9, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 8, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 9, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 10, "name": "FACILITY_NPI", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 11, "name": "CLAIM_TYPE", "comment": null}, "START_DATE": {"type": "DATE", "index": 12, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 13, "name": "END_DATE", "comment": null}, "DATE_USED_AS_START_DATE": {"type": "TEXT", "index": 14, "name": "DATE_USED_AS_START_DATE", "comment": null}, "DATE_USED_AS_END_DATE": {"type": "TEXT", "index": 15, "name": "DATE_USED_AS_END_DATE", "comment": null}, "DQ_PROBLEM": {"type": "NUMBER", "index": 16, "name": "DQ_PROBLEM", "comment": null}, "DQ_INSIGHT": {"type": "NUMBER", "index": 17, "name": "DQ_INSIGHT", "comment": null}, "START_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 18, "name": "START_DATE_NOT_DETERMINED", "comment": null}, "END_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 19, "name": "END_DATE_NOT_DETERMINED", "comment": null}, "START_DATE_AFTER_END_DATE": {"type": "NUMBER", "index": 20, "name": "START_DATE_AFTER_END_DATE", "comment": null}, "PATIENT_ID_NOT_UNIQUE": {"type": "NUMBER", "index": 21, "name": "PATIENT_ID_NOT_UNIQUE", "comment": null}, "PATIENT_ID_MISSING": {"type": "NUMBER", "index": 22, "name": "PATIENT_ID_MISSING", "comment": null}, "CLAIM_START_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 23, "name": "CLAIM_START_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_START_DATE_MISSING": {"type": "NUMBER", "index": 24, "name": "CLAIM_START_DATE_MISSING", "comment": null}, "CLAIM_END_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 25, "name": "CLAIM_END_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_END_DATE_MISSING": {"type": "NUMBER", "index": 26, "name": "CLAIM_END_DATE_MISSING", "comment": null}, "CLAIM_START_DATE_AFTER_CLAIM_END_DATE": {"type": "NUMBER", "index": 27, "name": "CLAIM_START_DATE_AFTER_CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 28, "name": "ADMISSION_DATE_NOT_UNIQUE", "comment": null}, "ADMISSION_DATE_MISSING": {"type": "NUMBER", "index": 29, "name": "ADMISSION_DATE_MISSING", "comment": null}, "DISCHARGE_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 30, "name": "DISCHARGE_DATE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DATE_MISSING": {"type": "NUMBER", "index": 31, "name": "DISCHARGE_DATE_MISSING", "comment": null}, "ADMISSION_DATE_AFTER_DISCHARGE_DATE": {"type": "NUMBER", "index": 32, "name": "ADMISSION_DATE_AFTER_DISCHARGE_DATE", "comment": null}, "ADMIT_TYPE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 33, "name": "ADMIT_TYPE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_TYPE_CODE_MISSING": {"type": "NUMBER", "index": 34, "name": "ADMIT_TYPE_CODE_MISSING", "comment": null}, "ADMIT_SOURCE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 35, "name": "ADMIT_SOURCE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_SOURCE_CODE_MISSING": {"type": "NUMBER", "index": 36, "name": "ADMIT_SOURCE_CODE_MISSING", "comment": null}, "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 37, "name": "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DISPOSITION_CODE_MISSING": {"type": "NUMBER", "index": 38, "name": "DISCHARGE_DISPOSITION_CODE_MISSING", "comment": null}, "FACILITY_NPI_NOT_UNIQUE": {"type": "NUMBER", "index": 39, "name": "FACILITY_NPI_NOT_UNIQUE", "comment": null}, "FACILITY_NPI_MISSING": {"type": "NUMBER", "index": 40, "name": "FACILITY_NPI_MISSING", "comment": null}, "CLAIM_TYPE_NOT_UNIQUE": {"type": "NUMBER", "index": 41, "name": "CLAIM_TYPE_NOT_UNIQUE", "comment": null}, "CLAIM_TYPE_MISSING": {"type": "NUMBER", "index": 42, "name": "CLAIM_TYPE_MISSING", "comment": null}, "CLAIM_TYPE_NOT_INSTITUTIONAL": {"type": "NUMBER", "index": 43, "name": "CLAIM_TYPE_NOT_INSTITUTIONAL", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 44, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 45, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, "model.the_tuva_project.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 6, "name": "CLINICAL_DOMAIN", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1553408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values"}, "model.the_tuva_project.normalized_input__int_procedure_code_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 3, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 4, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 5, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 6, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 7, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 8, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 9, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 10, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 11, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 12, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 13, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 14, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 15, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 16, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 17, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 18, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 19, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 20, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 21, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 22, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 23, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 24, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 25, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 26, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 27, "name": "PROCEDURE_CODE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final"}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:55UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, "seed.the_tuva_project.readmissions__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS": {"type": "TEXT", "index": 1, "name": "CCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 3, "name": "SPECIALTY_COHORT", "comment": null}, "PROCEDURE_OR_DIAGNOSIS": {"type": "TEXT", "index": 4, "name": "PROCEDURE_OR_DIAGNOSIS", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 277.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-10 13:54UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.5.0", "generated_at": "2024-05-16T18:33:18.997404Z", "invocation_id": "fb3eb4b0-505e-4191-84ff-ade431f461ad", "env": {}}, "nodes": {"model.input_layer.medication": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medication"}, "model.input_layer.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PHARMACY_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.pharmacy_claim"}, "model.input_layer.location": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LOCATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.location"}, "model.input_layer.eligibility": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ELIGIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.eligibility"}, "model.input_layer.encounter": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ENCOUNTER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.encounter"}, "model.input_layer.procedure": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PROCEDURE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.procedure"}, "model.input_layer.lab_result": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LAB_RESULT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.lab_result"}, "model.input_layer.observation": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "OBSERVATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.observation"}, "model.input_layer.medical_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICAL_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medical_claim"}, "model.input_layer.condition": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.condition"}, "model.input_layer.patient": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PATIENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.patient"}, "model.input_layer.practitioner": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PRACTITIONER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.practitioner"}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD10": {"type": "TEXT", "index": 1, "name": "ICD10", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 304128.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47132.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "model.the_tuva_project.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, "seed.the_tuva_project.clinical_concepts": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "CLINICAL_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_ID": {"type": "TEXT", "index": 1, "name": "CONCEPT_ID", "comment": null}, "CONCEPT_NAME": {"type": "TEXT", "index": 2, "name": "CONCEPT_NAME", "comment": null}, "STATUS": {"type": "TEXT", "index": 3, "name": "STATUS", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 4, "name": "CONCEPT_OID", "comment": null}, "LAST_UPDATE_DATE": {"type": "DATE", "index": 5, "name": "LAST_UPDATE_DATE", "comment": null}, "LAST_UPDATE_NOTE": {"type": "TEXT", "index": 6, "name": "LAST_UPDATE_NOTE", "comment": null}, "CONCEPT_TYPE": {"type": "TEXT", "index": 7, "name": "CONCEPT_TYPE", "comment": null}, "CONTENT_SOURCE": {"type": "TEXT", "index": 8, "name": "CONTENT_SOURCE", "comment": null}, "EXTERNAL_SOURCE_DETAIL": {"type": "TEXT", "index": 9, "name": "EXTERNAL_SOURCE_DETAIL", "comment": null}, "CONCEPT_SCOPE": {"type": "TEXT", "index": 10, "name": "CONCEPT_SCOPE", "comment": null}, "VALUE_SET_SEARCH_NOTES": {"type": "TEXT", "index": 11, "name": "VALUE_SET_SEARCH_NOTES", "comment": null}, "CODE": {"type": "TEXT", "index": 12, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CODE_DESCRIPTION", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 14, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_VERSION": {"type": "TEXT", "index": 15, "name": "CODING_SYSTEM_VERSION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 86.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.clinical_concepts"}, "model.the_tuva_project.normalized_input__int_present_on_admit_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting"}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_CLAIM_TYPE_MAPPING_FAILURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures"}, "model.the_tuva_project.normalized_input__int_procedure_date_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 3, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 4, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 6, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 7, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 8, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 9, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 10, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 11, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 12, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 13, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 14, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 15, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 16, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 17, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 18, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 19, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 20, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 21, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 22, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 23, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 24, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 25, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 26, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 27, "name": "PROCEDURE_DATE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final"}, "model.the_tuva_project.ahrq_measures__int_pqi_14_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_14_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_denom"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLASSIFICATION": {"type": "TEXT", "index": 1, "name": "CLASSIFICATION", "comment": null}, "CLASSIFICATION_NAME": {"type": "TEXT", "index": 2, "name": "CLASSIFICATION_NAME", "comment": null}, "CLASSIFICATION_ORDER": {"type": "TEXT", "index": 3, "name": "CLASSIFICATION_ORDER", "comment": null}, "CLASSIFICATION_COLUMN": {"type": "TEXT", "index": 4, "name": "CLASSIFICATION_COLUMN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, "model.the_tuva_project.quality_measures__int_cqm236_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 5, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 6, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 7, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 8, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 9, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 10, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 11, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 12, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 13, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 15, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 16, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 17, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 18, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 19, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 20, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 21, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 22, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 23, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 24, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 25, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 26, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 27, "name": "DIAGNOSIS_CODE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final"}, "model.the_tuva_project.quality_measures__int_nqf0053_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long"}, "model.the_tuva_project.quality_measures__int_nqf0059_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 8, "name": "EVIDENCE_VALUE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator"}, "model.the_tuva_project.quality_measures__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "PERFORMANCE_FLAG": {"type": "NUMBER", "index": 5, "name": "PERFORMANCE_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 6, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 7, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 8, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 9, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 11, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 12, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 13, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 14, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, "model.the_tuva_project.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_OBSERVATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "LOOKBACK_PERIOD_JUNE": {"type": "DATE", "index": 6, "name": "LOOKBACK_PERIOD_JUNE", "comment": null}, "LOOKBACK_PERIOD_DECEMBER": {"type": "DATE", "index": 7, "name": "LOOKBACK_PERIOD_DECEMBER", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, "model.the_tuva_project.quality_measures__int_nqf0053_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "AGE": {"type": "NUMBER", "index": 3, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, "model.the_tuva_project.service_category__duplicate_bill_types": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_BILL_TYPES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CNT": {"type": "NUMBER", "index": 2, "name": "CNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, "model.the_tuva_project.ahrq_measures__int_pqi_01_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_01_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_denom"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_CLEANED_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM_CODE": {"type": "TEXT", "index": 1, "name": "ICD_10_CM_CODE", "comment": null}, "ICD_10_CM_CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ICD_10_CM_CODE_DESCRIPTION", "comment": null}, "DEFAULT_CCSR_CATEGORY_IP": {"type": "TEXT", "index": 3, "name": "DEFAULT_CCSR_CATEGORY_IP", "comment": null}, "DEFAULT_CCSR_CATEGORY_DESCRIPTION_IP": {"type": "TEXT", "index": 4, "name": "DEFAULT_CCSR_CATEGORY_DESCRIPTION_IP", "comment": null}, "DEFAULT_CCSR_CATEGORY_OP": {"type": "TEXT", "index": 5, "name": "DEFAULT_CCSR_CATEGORY_OP", "comment": null}, "DEFAULT_CCSR_CATEGORY_DESCRIPTION_OP": {"type": "TEXT", "index": 6, "name": "DEFAULT_CCSR_CATEGORY_DESCRIPTION_OP", "comment": null}, "CCSR_CATEGORY_1": {"type": "TEXT", "index": 7, "name": "CCSR_CATEGORY_1", "comment": null}, "CCSR_CATEGORY_1_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "CCSR_CATEGORY_1_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_2": {"type": "TEXT", "index": 9, "name": "CCSR_CATEGORY_2", "comment": null}, "CCSR_CATEGORY_2_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "CCSR_CATEGORY_2_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_3": {"type": "TEXT", "index": 11, "name": "CCSR_CATEGORY_3", "comment": null}, "CCSR_CATEGORY_3_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "CCSR_CATEGORY_3_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_4": {"type": "TEXT", "index": 13, "name": "CCSR_CATEGORY_4", "comment": null}, "CCSR_CATEGORY_4_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "CCSR_CATEGORY_4_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_5": {"type": "TEXT", "index": 15, "name": "CCSR_CATEGORY_5", "comment": null}, "CCSR_CATEGORY_5_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "CCSR_CATEGORY_5_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_6": {"type": "TEXT", "index": 17, "name": "CCSR_CATEGORY_6", "comment": null}, "CCSR_CATEGORY_6_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "CCSR_CATEGORY_6_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1899008.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 74549.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, "model.the_tuva_project.normalized_input__int_medical_npi_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_NPI_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_RENDERING_NPI": {"type": "TEXT", "index": 5, "name": "NORMALIZED_RENDERING_NPI", "comment": null}, "NORMALIZED_BILLING_NPI": {"type": "TEXT", "index": 6, "name": "NORMALIZED_BILLING_NPI", "comment": null}, "NORMALIZED_FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "NORMALIZED_FACILITY_NPI", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize"}, "model.the_tuva_project.service_category__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, "model.the_tuva_project.normalized_input__int_bill_type_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_BILL_TYPE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final"}, "model.the_tuva_project.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, "model.the_tuva_project.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 2, "name": "PAYMENT_YEAR", "comment": null}, "NORMALIZATION_FACTOR": {"type": "NUMBER", "index": 3, "name": "NORMALIZATION_FACTOR", "comment": null}, "MA_CODING_PATTERN_ADJUSTMENT": {"type": "NUMBER", "index": 4, "name": "MA_CODING_PATTERN_ADJUSTMENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_08_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "PLAN_SEGMENT": {"type": "TEXT", "index": 4, "name": "PLAN_SEGMENT", "comment": null}, "GENDER": {"type": "TEXT", "index": 5, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 6, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 7, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 8, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 9, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 10, "name": "INSTITUTIONAL_STATUS", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 11, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 13312.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 848.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "model.the_tuva_project.ahrq_measures__int_pqi_05_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_05_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_denom"}, "seed.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FULL_DATE": {"type": "DATE", "index": 1, "name": "FULL_DATE", "comment": null}, "YEAR": {"type": "NUMBER", "index": 2, "name": "YEAR", "comment": null}, "MONTH": {"type": "NUMBER", "index": 3, "name": "MONTH", "comment": null}, "DAY": {"type": "NUMBER", "index": 4, "name": "DAY", "comment": null}, "MONTH_NAME": {"type": "TEXT", "index": 5, "name": "MONTH_NAME", "comment": null}, "DAY_OF_WEEK_NUMBER": {"type": "NUMBER", "index": 6, "name": "DAY_OF_WEEK_NUMBER", "comment": null}, "DAY_OF_WEEK_NAME": {"type": "TEXT", "index": 7, "name": "DAY_OF_WEEK_NAME", "comment": null}, "WEEK_OF_YEAR": {"type": "NUMBER", "index": 8, "name": "WEEK_OF_YEAR", "comment": null}, "DAY_OF_YEAR": {"type": "NUMBER", "index": 9, "name": "DAY_OF_YEAR", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "YEAR_MONTH", "comment": null}, "FIRST_DAY_OF_MONTH": {"type": "DATE", "index": 11, "name": "FIRST_DAY_OF_MONTH", "comment": null}, "LAST_DAY_OF_MONTH": {"type": "DATE", "index": 12, "name": "LAST_DAY_OF_MONTH", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 882176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80000.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__calendar"}, "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_11_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions"}, "model.the_tuva_project.core__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__location"}, "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_HCC_DESCRIPTIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"HCC_CODE": {"type": "TEXT", "index": 1, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "HCC_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 4608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 115.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_MISSING_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates"}, "model.the_tuva_project.normalized_input__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "TEXT", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__medical_claim"}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, "model.the_tuva_project.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_MEDICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 22, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_1", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 5, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_BODY_SYSTEMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"BODY_SYSTEM": {"type": "TEXT", "index": 1, "name": "BODY_SYSTEM", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 2, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 22.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 4, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 5, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 6, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, "model.the_tuva_project.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 15, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 16, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 17, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 18, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 19, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 20, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 21, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 22, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 23, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 24, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 25, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, "seed.the_tuva_project.terminology__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__race"}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_TUVA_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_FAMILY": {"type": "TEXT", "index": 1, "name": "CONDITION_FAMILY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 3, "name": "ICD_10_CM_CODE", "comment": null}, "ICD_10_CM_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_DESCRIPTION", "comment": null}, "CONDITION_COLUMN_NAME": {"type": "TEXT", "index": 5, "name": "CONDITION_COLUMN_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 35840.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1583.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "model.the_tuva_project.service_category__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates"}, "model.the_tuva_project.ahrq_measures__int_pqi_03_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_03_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_denom"}, "model.the_tuva_project.hcc_suspecting__int_all_medications": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_ALL_MEDICATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 2, "name": "DISPENSING_DATE", "comment": null}, "DRUG_CODE": {"type": "TEXT", "index": 3, "name": "DRUG_CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"BILL_TYPE_CODE": {"type": "TEXT", "index": 1, "name": "BILL_TYPE_CODE", "comment": null}, "BILL_TYPE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "BILL_TYPE_DESCRIPTION", "comment": null}, "DEPRECATED": {"type": "NUMBER", "index": 3, "name": "DEPRECATED", "comment": null}, "DEPRECATED_DATE": {"type": "DATE", "index": 4, "name": "DEPRECATED_DATE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 22016.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1701.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, "model.the_tuva_project.normalized_input__int_admit_source_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_SOURCE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final"}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_FIRST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_HIV_AIDS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_ICD_10_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 183808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 12333.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DISTINCT_SERVICE_CATEGORY_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_SERVICE_CATEGORY_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ENCOUNTER_DATA_FOR_MEDICAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 7, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 8, "name": "ENCOUNTER_END_DATE", "comment": null}, "ENCOUNTER_ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 9, "name": "ENCOUNTER_ADMIT_SOURCE_CODE", "comment": null}, "ENCOUNTER_ADMIT_TYPE_CODE": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ADMIT_TYPE_CODE", "comment": null}, "ENCOUNTER_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "ENCOUNTER_DISCHARGE_DISPOSITION_CODE", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 12, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 13, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"}, "seed.the_tuva_project.terminology__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, "model.the_tuva_project.quality_measures__int_cbe0055__denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CBE0055_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 5, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 6, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 7, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__denominator"}, "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_COLUMN": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_COLUMN", "comment": null}, "NORMALIZED_PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "PRESENT_ON_ADMIT_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"}, "seed.the_tuva_project.terminology__loinc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 2, "name": "SHORT_NAME", "comment": null}, "LONG_COMMON_NAME": {"type": "TEXT", "index": 3, "name": "LONG_COMMON_NAME", "comment": null}, "COMPONENT": {"type": "TEXT", "index": 4, "name": "COMPONENT", "comment": null}, "PROPERTY": {"type": "TEXT", "index": 5, "name": "PROPERTY", "comment": null}, "TIME_ASPECT": {"type": "TEXT", "index": 6, "name": "TIME_ASPECT", "comment": null}, "SYSTEM": {"type": "TEXT", "index": 7, "name": "SYSTEM", "comment": null}, "SCALE_TYPE": {"type": "TEXT", "index": 8, "name": "SCALE_TYPE", "comment": null}, "METHOD_TYPE": {"type": "TEXT", "index": 9, "name": "METHOD_TYPE", "comment": null}, "CLASS_CODE": {"type": "TEXT", "index": 10, "name": "CLASS_CODE", "comment": null}, "CLASS_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CLASS_DESCRIPTION", "comment": null}, "CLASS_TYPE_CODE": {"type": "TEXT", "index": 12, "name": "CLASS_TYPE_CODE", "comment": null}, "CLASS_TYPE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CLASS_TYPE_DESCRIPTION", "comment": null}, "EXTERNAL_COPYRIGHT_NOTICE": {"type": "TEXT", "index": 14, "name": "EXTERNAL_COPYRIGHT_NOTICE", "comment": null}, "STATUS": {"type": "TEXT", "index": 15, "name": "STATUS", "comment": null}, "VERSION_FIRST_RELEASED": {"type": "TEXT", "index": 16, "name": "VERSION_FIRST_RELEASED", "comment": null}, "VERSION_LAST_CHANGED": {"type": "TEXT", "index": 17, "name": "VERSION_LAST_CHANGED", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 4118528.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 101632.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc"}, "model.the_tuva_project.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1001472.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78638.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, "model.the_tuva_project.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MAPPING_METHOD": {"type": "TEXT", "index": 16, "name": "MAPPING_METHOD", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 17, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__condition"}, "model.the_tuva_project.financial_pmpm__pmpm_payer": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PAYER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 2, "name": "PAYER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 4, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 6, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 8, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 9, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 10, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 11, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 12, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 13, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 14, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 15, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 16, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 17, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 18, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 19, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 20, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 21, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 22, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 23, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 24, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 28, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 29, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 30, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 31, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 32, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 33, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 35, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 36, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 37, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 38, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 39, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 40, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 41, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 42, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 43, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 44, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 45, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 46, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 47, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 48, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 49, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 50, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 51, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 52, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 53, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 54, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 55, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer"}, "model.the_tuva_project.quality_measures__int_cqm236__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period"}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_07_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions"}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 2, "name": "SPECIALTY_COHORT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DQ_PROBLEM": {"type": "TEXT", "index": 2, "name": "DQ_PROBLEM", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PREP_EGFR_LABS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 3, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 4, "name": "CODE", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 5, "name": "RESULT_DATE", "comment": null}, "RESULT": {"type": "NUMBER", "index": 6, "name": "RESULT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, "seed.the_tuva_project.terminology__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 1, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "PLACE_OF_SERVICE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "PLACE_OF_SERVICE_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 50.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"APR_DRG_CODE": {"type": "TEXT", "index": 1, "name": "APR_DRG_CODE", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 2, "name": "MEDICAL_SURGICAL", "comment": null}, "MDC_CODE": {"type": "TEXT", "index": 3, "name": "MDC_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "APR_DRG_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 316.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NPI": {"type": "TEXT", "index": 1, "name": "NPI", "comment": null}, "ENTITY_TYPE_CODE": {"type": "TEXT", "index": 2, "name": "ENTITY_TYPE_CODE", "comment": null}, "ENTITY_TYPE_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "ENTITY_TYPE_DESCRIPTION", "comment": null}, "PRIMARY_TAXONOMY_CODE": {"type": "TEXT", "index": 4, "name": "PRIMARY_TAXONOMY_CODE", "comment": null}, "PRIMARY_SPECIALTY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "PRIMARY_SPECIALTY_DESCRIPTION", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 6, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 7, "name": "PROVIDER_LAST_NAME", "comment": null}, "PROVIDER_ORGANIZATION_NAME": {"type": "TEXT", "index": 8, "name": "PROVIDER_ORGANIZATION_NAME", "comment": null}, "PARENT_ORGANIZATION_NAME": {"type": "TEXT", "index": 9, "name": "PARENT_ORGANIZATION_NAME", "comment": null}, "PRACTICE_ADDRESS_LINE_1": {"type": "TEXT", "index": 10, "name": "PRACTICE_ADDRESS_LINE_1", "comment": null}, "PRACTICE_ADDRESS_LINE_2": {"type": "TEXT", "index": 11, "name": "PRACTICE_ADDRESS_LINE_2", "comment": null}, "PRACTICE_CITY": {"type": "TEXT", "index": 12, "name": "PRACTICE_CITY", "comment": null}, "PRACTICE_STATE": {"type": "TEXT", "index": 13, "name": "PRACTICE_STATE", "comment": null}, "PRACTICE_ZIP_CODE": {"type": "TEXT", "index": 14, "name": "PRACTICE_ZIP_CODE", "comment": null}, "LAST_UPDATED": {"type": "DATE", "index": 15, "name": "LAST_UPDATED", "comment": null}, "DEACTIVATION_DATE": {"type": "DATE", "index": 16, "name": "DEACTIVATION_DATE", "comment": null}, "DEACTIVATION_FLAG": {"type": "TEXT", "index": 17, "name": "DEACTIVATION_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 256204288.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8332865.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__provider"}, "model.the_tuva_project.hcc_suspecting__int_observation_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_OBSERVATION_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 3, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_RESULT": {"type": "TEXT", "index": 4, "name": "OBSERVATION_RESULT", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 5, "name": "CONDITION_CODE", "comment": null}, "CONDITION_DATE": {"type": "DATE", "index": 6, "name": "CONDITION_DATE", "comment": null}, "CONDITION_CONCEPT_NAME": {"type": "TEXT", "index": 7, "name": "CONDITION_CONCEPT_NAME", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 8, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "HCC_DESCRIPTION", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 10, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 11, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 12, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 13, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_TEST_DETAIL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "GRAIN": {"type": "TEXT", "index": 4, "name": "GRAIN", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 7, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_COMORBIDITY_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "CONDITION_1_CONCEPT_NAME": {"type": "TEXT", "index": 5, "name": "CONDITION_1_CONCEPT_NAME", "comment": null}, "CONDITION_1_CODE": {"type": "TEXT", "index": 6, "name": "CONDITION_1_CODE", "comment": null}, "CONDITION_1_RECORDED_DATE": {"type": "DATE", "index": 7, "name": "CONDITION_1_RECORDED_DATE", "comment": null}, "CONDITION_2_CONCEPT_NAME": {"type": "TEXT", "index": 8, "name": "CONDITION_2_CONCEPT_NAME", "comment": null}, "CONDITION_2_CODE": {"type": "TEXT", "index": 9, "name": "CONDITION_2_CODE", "comment": null}, "CONDITION_2_RECORDED_DATE": {"type": "DATE", "index": 10, "name": "CONDITION_2_RECORDED_DATE", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 11, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 12, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 13, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 14, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DISTINCT_SERVICE_CATEGORY_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_SERVICE_CATEGORY_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, "model.the_tuva_project.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, "model.the_tuva_project.ahrq_measures__int_pqi_08_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_08_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_denom"}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DUAL_STATUS_CODE": {"type": "TEXT", "index": 1, "name": "DUAL_STATUS_CODE", "comment": null}, "DUAL_STATUS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DUAL_STATUS_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 11.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 2, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 3, "name": "PAYMENT_YEAR", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 4, "name": "HCC_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, "model.the_tuva_project.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, "seed.the_tuva_project.quality_measures__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CODES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "CODE": {"type": "TEXT", "index": 3, "name": "CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 110080.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 11912.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, "seed.the_tuva_project.value_set_members": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "VALUE_SET_MEMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"VALUE_SET_MEMBER_ID": {"type": "TEXT", "index": 1, "name": "VALUE_SET_MEMBER_ID", "comment": null}, "CONCEPT_ID": {"type": "TEXT", "index": 2, "name": "CONCEPT_ID", "comment": null}, "STATUS": {"type": "TEXT", "index": 3, "name": "STATUS", "comment": null}, "LAST_UPDATE_DATE": {"type": "DATE", "index": 4, "name": "LAST_UPDATE_DATE", "comment": null}, "LAST_UPDATE_NOTE": {"type": "TEXT", "index": 5, "name": "LAST_UPDATE_NOTE", "comment": null}, "CODE": {"type": "TEXT", "index": 6, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "CODE_DESCRIPTION", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 8, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_VERSION": {"type": "TEXT", "index": 9, "name": "CODING_SYSTEM_VERSION", "comment": null}, "INCLUDE_DESCENDANTS": {"type": "TEXT", "index": 10, "name": "INCLUDE_DESCENDANTS", "comment": null}, "COMMENT": {"type": "TEXT", "index": 11, "name": "COMMENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4602.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.value_set_members"}, "model.the_tuva_project.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LAB_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MAPPING_METHOD": {"type": "TEXT", "index": 12, "name": "MAPPING_METHOD", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 13, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 14, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 15, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 16, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 17, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 18, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 19, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 21, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 23, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "TEXT", "index": 24, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "TEXT", "index": 25, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 26, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 27, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 28, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 29, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__lab_result"}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "DETERMINED_ENCOUNTER_START_DATE": {"type": "DATE", "index": 5, "name": "DETERMINED_ENCOUNTER_START_DATE", "comment": null}, "DETERMINED_ENCOUNTER_END_DATE": {"type": "DATE", "index": 6, "name": "DETERMINED_ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, "seed.the_tuva_project.terminology__snomed_ct": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SNOMED_CT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SNOMED_CT": {"type": "TEXT", "index": 1, "name": "SNOMED_CT", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "IS_ACTIVE": {"type": "TEXT", "index": 3, "name": "IS_ACTIVE", "comment": null}, "CREATED": {"type": "DATE", "index": 4, "name": "CREATED", "comment": null}, "LAST_UPDATED": {"type": "DATE", "index": 5, "name": "LAST_UPDATED", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 17523712.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 517628.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__snomed_ct"}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "ORPHAN_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_CATEGORY": {"type": "TEXT", "index": 1, "name": "CLAIM_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, "seed.the_tuva_project.hcc_suspecting__clinical_concepts": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_CLINICAL_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "CODE": {"type": "TEXT", "index": 3, "name": "CODE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 4, "name": "CODE_SYSTEM", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 188928.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 25472.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts"}, "model.the_tuva_project.readmissions__encounter_data_quality": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_DATA_QUALITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 3, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 4, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 5, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 6, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 7, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 8, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 9, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 11, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 12, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 13, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, "model.the_tuva_project.normalized_input__int_admit_type_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_TYPE_NORMALIZE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting"}, "seed.the_tuva_project.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MS_DRG_CODE": {"type": "TEXT", "index": 1, "name": "MS_DRG_CODE", "comment": null}, "MDC_CODE": {"type": "TEXT", "index": 2, "name": "MDC_CODE", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 3, "name": "MEDICAL_SURGICAL", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "MS_DRG_DESCRIPTION", "comment": null}, "DEPRECATED": {"type": "NUMBER", "index": 5, "name": "DEPRECATED", "comment": null}, "DEPRECATED_DATE": {"type": "DATE", "index": 6, "name": "DEPRECATED_DATE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 16896.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 812.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, "seed.the_tuva_project.pqi__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "_VALUE_SET_PQI", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "VALUE_SET_NAME": {"type": "TEXT", "index": 2, "name": "VALUE_SET_NAME", "comment": null}, "PQI_NUMBER": {"type": "TEXT", "index": 3, "name": "PQI_NUMBER", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 46592.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6059.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.pqi__value_sets"}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_PATIENT_SPEND_WITH_SERVICE_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 6, "name": "SERVICE_CATEGORY_2", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 7, "name": "TOTAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 9, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, "model.the_tuva_project.ahrq_measures__pqi_exclusion_long": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "PQI_EXCLUSION_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "PQI_NUMBER": {"type": "NUMBER", "index": 5, "name": "PQI_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"}, "model.the_tuva_project.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "NUMERATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, "model.the_tuva_project.quality_measures__int_nqf0059_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long"}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, "model.the_tuva_project.hcc_suspecting__summary": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 2, "name": "PATIENT_SEX", "comment": null}, "PATIENT_BIRTH_DATE": {"type": "DATE", "index": 3, "name": "PATIENT_BIRTH_DATE", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 4, "name": "PATIENT_AGE", "comment": null}, "SUSPECTING_GAPS": {"type": "NUMBER", "index": 5, "name": "SUSPECTING_GAPS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__summary"}, "model.the_tuva_project.quality_measures__int_nqf0059_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 5, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 6, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 7, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator"}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_ALLOWED_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 10, "name": "OTHER_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 11, "name": "PHARMACY_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, "seed.the_tuva_project.terminology__snomed_ct_transitive_closures": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SNOMED_CT_TRANSITIVE_CLOSURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PARENT_SNOMED_CODE": {"type": "TEXT", "index": 1, "name": "PARENT_SNOMED_CODE", "comment": null}, "PARENT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "PARENT_DESCRIPTION", "comment": null}, "CHILD_SNOMED_CODE": {"type": "TEXT", "index": 3, "name": "CHILD_SNOMED_CODE", "comment": null}, "CHILD_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CHILD_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 112768512.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7336247.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__snomed_ct_transitive_closures"}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC_DEPRECATED_MAPPING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "MAP_TO": {"type": "TEXT", "index": 2, "name": "MAP_TO", "comment": null}, "COMMENT": {"type": "TEXT", "index": 3, "name": "COMMENT", "comment": null}, "FINAL_MAP_TO": {"type": "TEXT", "index": 4, "name": "FINAL_MAP_TO", "comment": null}, "ALL_COMMENTS": {"type": "TEXT", "index": 5, "name": "ALL_COMMENTS", "comment": null}, "DEPTH": {"type": "TEXT", "index": 6, "name": "DEPTH", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4613.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, "seed.the_tuva_project.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_9_CM": {"type": "TEXT", "index": 1, "name": "ICD_9_CM", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 390144.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 14567.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 4, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 5, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 7, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 8, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 9, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 10, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 11, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 13, "name": "MEDICARE_STATUS_CODE", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 14, "name": "SUBSCRIBER_RELATION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, "seed.the_tuva_project.terminology__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_TYPE": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_TYPE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 13, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 14, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 15, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 16, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_MISSING_PRIMARY_DX", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx"}, "model.the_tuva_project.ahrq_measures__int_pqi_16_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_16_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_denom"}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1416192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80493.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_LAST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, "model.the_tuva_project.quality_measures__int_cqm236_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 5, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 6, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 7, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator"}, "seed.input_layer.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.eligibility_seed"}, "model.the_tuva_project.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CODE_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 6, "name": "CONDITION_RANK", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 7, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "BODY_SYSTEM": {"type": "TEXT", "index": 8, "name": "BODY_SYSTEM", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 10, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_RANK": {"type": "NUMBER", "index": 12, "name": "CCSR_CATEGORY_RANK", "comment": null}, "IS_IP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 13, "name": "IS_IP_DEFAULT_CATEGORY", "comment": null}, "IS_OP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 14, "name": "IS_OP_DEFAULT_CATEGORY", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 15, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"HCPCS": {"type": "TEXT", "index": 1, "name": "HCPCS", "comment": null}, "SEQNUM": {"type": "TEXT", "index": 2, "name": "SEQNUM", "comment": null}, "RECID": {"type": "TEXT", "index": 3, "name": "RECID", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 368640.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7501.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, "model.the_tuva_project.ahrq_measures__pqi_summary": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "PQI_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PQI_NUMBER": {"type": "NUMBER", "index": 1, "name": "PQI_NUMBER", "comment": null}, "PQI_NAME": {"type": "TEXT", "index": 2, "name": "PQI_NAME", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 6, "name": "PATIENT_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "MS_DRG_DESCRIPTION", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 10, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 11, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 12, "name": "LENGTH_OF_STAY", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 13, "name": "PAID_AMOUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_summary"}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, "model.the_tuva_project.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DENOMINATORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DENOMINATOR_NAME": {"type": "TEXT", "index": 1, "name": "TEST_DENOMINATOR_NAME", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ELIGIBILITY_DATES_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PATIENT_ID_KEY": {"type": "TEXT", "index": 2, "name": "PATIENT_ID_KEY", "comment": null}, "NORMALIZED_BIRTH_DATE": {"type": "DATE", "index": 3, "name": "NORMALIZED_BIRTH_DATE", "comment": null}, "NORMALIZED_DEATH_DATE": {"type": "DATE", "index": 4, "name": "NORMALIZED_DEATH_DATE", "comment": null}, "NORMALIZED_ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "NORMALIZED_ENROLLMENT_START_DATE", "comment": null}, "NORMALIZED_ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "NORMALIZED_ENROLLMENT_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "model.the_tuva_project.quality_measures__int_cqm236_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 8, "name": "SHORT_NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 10, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 11, "name": "HCC_CODE_2", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 12, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 16384.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 961.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"}, "model.the_tuva_project.emergency_department__int_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, "seed.the_tuva_project.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_1": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details"}, "model.the_tuva_project.normalized_input__int_apr_drg_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_APR_DRG_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting"}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 2, "name": "CONDITION_CODE", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 3, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "model.the_tuva_project.normalized_input__int_place_of_service_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PLACE_OF_SERVICE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize"}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 10, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 11, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 12, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 13, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 14, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 15, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 16, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 17, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 18, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 19, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 20, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 21, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 22, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 23, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 24, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 27, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 28, "name": "URGENT_CARE_PAID", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 29, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 30, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 31, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 32, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 33, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 36, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 38, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 40, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 41, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 42, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 43, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 44, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 45, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 46, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 48, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 49, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 50, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 51, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 52, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 53, "name": "MEDICAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 54, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 55, "name": "MEDICAL_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "model.the_tuva_project.normalized_input__int_undetermined_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_UNDETERMINED_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type"}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "CCS_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CCS_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "seed.the_tuva_project.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_9_PCS": {"type": "TEXT", "index": 1, "name": "ICD_9_PCS", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 105984.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3882.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, "model.the_tuva_project.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 5, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 6, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 7, "name": "READMIT_30_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_03_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 3, "name": "DESCRIPTION", "comment": null}, "HCCS_TO_EXCLUDE": {"type": "TEXT", "index": 4, "name": "HCCS_TO_EXCLUDE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_CLAIM_TYPE_UNMAPPED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped"}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 2, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE": {"type": "TEXT", "index": 3, "name": "EVIDENCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, "model.the_tuva_project.hcc_suspecting__list": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "LIST", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "REASON": {"type": "TEXT", "index": 5, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 6, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 7, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__list"}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 2, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 3, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 5, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 8, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 9, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 10, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DISCHARGE_DISPOSITION_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_LINE_NUMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers"}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 6, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 9, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, "model.the_tuva_project.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_15_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions"}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MIN_AGE": {"type": "NUMBER", "index": 2, "name": "MIN_AGE", "comment": null}, "MAX_AGE": {"type": "NUMBER", "index": 3, "name": "MAX_AGE", "comment": null}, "QUALIFYING_TYPES": {"type": "TEXT", "index": 4, "name": "QUALIFYING_TYPES", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ICD_10_CM_MAPPINGS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYMENT_YEAR": {"type": "NUMBER", "index": 1, "name": "PAYMENT_YEAR", "comment": null}, "DIAGNOSIS_CODE": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CODE", "comment": null}, "CMS_HCC_V24": {"type": "TEXT", "index": 3, "name": "CMS_HCC_V24", "comment": null}, "CMS_HCC_V24_FLAG": {"type": "TEXT", "index": 4, "name": "CMS_HCC_V24_FLAG", "comment": null}, "CMS_HCC_V28": {"type": "TEXT", "index": 5, "name": "CMS_HCC_V28", "comment": null}, "CMS_HCC_V28_FLAG": {"type": "TEXT", "index": 6, "name": "CMS_HCC_V28_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 459776.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78932.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_FRAILTY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty"}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_CMS_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "CONDITION_COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "CONDITION_COLUMN_NAME", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "ADDITIONAL_LOGIC": {"type": "TEXT", "index": 6, "name": "ADDITIONAL_LOGIC", "comment": null}, "CLAIMS_QUALIFICATION": {"type": "TEXT", "index": 7, "name": "CLAIMS_QUALIFICATION", "comment": null}, "INCLUSION_TYPE": {"type": "TEXT", "index": 8, "name": "INCLUSION_TYPE", "comment": null}, "CODE_SYSTEM": {"type": "TEXT", "index": 9, "name": "CODE_SYSTEM", "comment": null}, "CODE": {"type": "TEXT", "index": 10, "name": "CODE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 143360.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6532.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, "seed.the_tuva_project.quality_measures__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_MEASURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ID": {"type": "TEXT", "index": 1, "name": "ID", "comment": null}, "NAME": {"type": "TEXT", "index": 2, "name": "NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 3, "name": "DESCRIPTION", "comment": null}, "VERSION": {"type": "TEXT", "index": 4, "name": "VERSION", "comment": null}, "STEWARD": {"type": "TEXT", "index": 5, "name": "STEWARD", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, "model.the_tuva_project.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_PLAUSIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 9, "name": "COUNTS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility"}, "model.the_tuva_project.ahrq_measures__int_pqi_15_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_15_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_num"}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_CLAIMS_WITH_ENCOUNTER_DATA", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 5, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 6, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 7, "name": "ENCOUNTER_END_DATE", "comment": null}, "ENCOUNTER_ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "ENCOUNTER_ADMIT_SOURCE_CODE", "comment": null}, "ENCOUNTER_ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ENCOUNTER_ADMIT_TYPE_CODE", "comment": null}, "ENCOUNTER_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_DISCHARGE_DISPOSITION_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_EXCLUDE_PROCEDURES_OBSERVATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 5, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "CCS_CODE_AND_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "CCS_CODE_AND_DESCRIPTION", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 4, "name": "SPECIALTY_COHORT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, "model.the_tuva_project.ahrq_measures__pqi_denom_long": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "PQI_DENOM_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "PQI_NUMBER": {"type": "NUMBER", "index": 4, "name": "PQI_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_denom_long"}, "model.the_tuva_project.data_quality__claims_preprocessing_summary": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "COUNTS": {"type": "NUMBER", "index": 3, "name": "COUNTS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 10.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_05_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions"}, "model.the_tuva_project.ahrq_measures__int_pqi_14_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_14_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_num"}, "seed.the_tuva_project.pqi__measures": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "_VALUE_SET_PQI_MEASURES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PQI_NUMBER": {"type": "TEXT", "index": 1, "name": "PQI_NUMBER", "comment": null}, "PQI_NAME": {"type": "TEXT", "index": 2, "name": "PQI_NAME", "comment": null}, "PQI_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "PQI_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 10.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.pqi__measures"}, "model.the_tuva_project.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ED_CLASSIFICATION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ED_CLASSIFICATION_DESCRIPTION", "comment": null}, "ED_CLASSIFICATION_ORDER": {"type": "TEXT", "index": 3, "name": "ED_CLASSIFICATION_ORDER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 6, "name": "YEAR_MONTH", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 12, "name": "FACILITY_NPI", "comment": null}, "FACILITY_NAME": {"type": "TEXT", "index": 13, "name": "FACILITY_NAME", "comment": null}, "FACILITY_STATE": {"type": "TEXT", "index": 14, "name": "FACILITY_STATE", "comment": null}, "FACILITY_CITY": {"type": "TEXT", "index": 15, "name": "FACILITY_CITY", "comment": null}, "FACILITY_ZIP_CODE": {"type": "TEXT", "index": 16, "name": "FACILITY_ZIP_CODE", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 17, "name": "PATIENT_SEX", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 18, "name": "PATIENT_AGE", "comment": null}, "PATIENT_ZIP_CODE": {"type": "TEXT", "index": 19, "name": "PATIENT_ZIP_CODE", "comment": null}, "PATIENT_LATITUDE": {"type": "FLOAT", "index": 20, "name": "PATIENT_LATITUDE", "comment": null}, "PATIENT_LONGITUDE": {"type": "FLOAT", "index": 21, "name": "PATIENT_LONGITUDE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 22, "name": "PATIENT_RACE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__summary"}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, "model.the_tuva_project.data_quality__claims_preprocessing_use_case": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_USE_CASE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"USE_CASE": {"type": "TEXT", "index": 1, "name": "USE_CASE", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 2, "name": "SOURCE_TABLE", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 4, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 5, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "model.the_tuva_project.ahrq_measures__int_pqi_05_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_05_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_num"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 8, "name": "HCC_CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 10, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 24576.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1369.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 8, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 9, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 10, "name": "FACILITY_NPI", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 11, "name": "CLAIM_TYPE", "comment": null}, "START_DATE": {"type": "DATE", "index": 12, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 13, "name": "END_DATE", "comment": null}, "DATE_USED_AS_START_DATE": {"type": "TEXT", "index": 14, "name": "DATE_USED_AS_START_DATE", "comment": null}, "DATE_USED_AS_END_DATE": {"type": "TEXT", "index": 15, "name": "DATE_USED_AS_END_DATE", "comment": null}, "DQ_PROBLEM": {"type": "NUMBER", "index": 16, "name": "DQ_PROBLEM", "comment": null}, "DQ_INSIGHT": {"type": "NUMBER", "index": 17, "name": "DQ_INSIGHT", "comment": null}, "START_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 18, "name": "START_DATE_NOT_DETERMINED", "comment": null}, "END_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 19, "name": "END_DATE_NOT_DETERMINED", "comment": null}, "START_DATE_AFTER_END_DATE": {"type": "NUMBER", "index": 20, "name": "START_DATE_AFTER_END_DATE", "comment": null}, "PATIENT_ID_NOT_UNIQUE": {"type": "NUMBER", "index": 21, "name": "PATIENT_ID_NOT_UNIQUE", "comment": null}, "PATIENT_ID_MISSING": {"type": "NUMBER", "index": 22, "name": "PATIENT_ID_MISSING", "comment": null}, "CLAIM_START_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 23, "name": "CLAIM_START_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_START_DATE_MISSING": {"type": "NUMBER", "index": 24, "name": "CLAIM_START_DATE_MISSING", "comment": null}, "CLAIM_END_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 25, "name": "CLAIM_END_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_END_DATE_MISSING": {"type": "NUMBER", "index": 26, "name": "CLAIM_END_DATE_MISSING", "comment": null}, "CLAIM_START_DATE_AFTER_CLAIM_END_DATE": {"type": "NUMBER", "index": 27, "name": "CLAIM_START_DATE_AFTER_CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 28, "name": "ADMISSION_DATE_NOT_UNIQUE", "comment": null}, "ADMISSION_DATE_MISSING": {"type": "NUMBER", "index": 29, "name": "ADMISSION_DATE_MISSING", "comment": null}, "DISCHARGE_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 30, "name": "DISCHARGE_DATE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DATE_MISSING": {"type": "NUMBER", "index": 31, "name": "DISCHARGE_DATE_MISSING", "comment": null}, "ADMISSION_DATE_AFTER_DISCHARGE_DATE": {"type": "NUMBER", "index": 32, "name": "ADMISSION_DATE_AFTER_DISCHARGE_DATE", "comment": null}, "ADMIT_TYPE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 33, "name": "ADMIT_TYPE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_TYPE_CODE_MISSING": {"type": "NUMBER", "index": 34, "name": "ADMIT_TYPE_CODE_MISSING", "comment": null}, "ADMIT_SOURCE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 35, "name": "ADMIT_SOURCE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_SOURCE_CODE_MISSING": {"type": "NUMBER", "index": 36, "name": "ADMIT_SOURCE_CODE_MISSING", "comment": null}, "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 37, "name": "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DISPOSITION_CODE_MISSING": {"type": "NUMBER", "index": 38, "name": "DISCHARGE_DISPOSITION_CODE_MISSING", "comment": null}, "FACILITY_NPI_NOT_UNIQUE": {"type": "NUMBER", "index": 39, "name": "FACILITY_NPI_NOT_UNIQUE", "comment": null}, "FACILITY_NPI_MISSING": {"type": "NUMBER", "index": 40, "name": "FACILITY_NPI_MISSING", "comment": null}, "CLAIM_TYPE_NOT_UNIQUE": {"type": "NUMBER", "index": 41, "name": "CLAIM_TYPE_NOT_UNIQUE", "comment": null}, "CLAIM_TYPE_MISSING": {"type": "NUMBER", "index": 42, "name": "CLAIM_TYPE_MISSING", "comment": null}, "CLAIM_TYPE_NOT_INSTITUTIONAL": {"type": "NUMBER", "index": 43, "name": "CLAIM_TYPE_NOT_INSTITUTIONAL", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 44, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 45, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, "seed.the_tuva_project.data_quality__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_VALUE_SET_TEST_CATALOG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 2, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 3, "name": "TEST_NAME", "comment": null}, "TEST_FIELD": {"type": "TEXT", "index": 4, "name": "TEST_FIELD", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 7680.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 299.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.data_quality__test_catalog"}, "model.the_tuva_project.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 13, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, "model.the_tuva_project.normalized_input__int_procedure_date_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_COLUMN": {"type": "TEXT", "index": 3, "name": "PROCEDURE_COLUMN", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 4, "name": "PROCEDURE_DATE", "comment": null}, "PROCEDURE_DATE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "PROCEDURE_DATE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize"}, "seed.the_tuva_project.terminology__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"REVENUE_CENTER_CODE": {"type": "TEXT", "index": 1, "name": "REVENUE_CENTER_CODE", "comment": null}, "REVENUE_CENTER_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "REVENUE_CENTER_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 526.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, "model.the_tuva_project.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "V24_RISK_SCORE": {"type": "NUMBER", "index": 2, "name": "V24_RISK_SCORE", "comment": null}, "V28_RISK_SCORE": {"type": "NUMBER", "index": 3, "name": "V28_RISK_SCORE", "comment": null}, "BLENDED_RISK_SCORE": {"type": "NUMBER", "index": 4, "name": "BLENDED_RISK_SCORE", "comment": null}, "NORMALIZED_RISK_SCORE": {"type": "NUMBER", "index": 5, "name": "NORMALIZED_RISK_SCORE", "comment": null}, "PAYMENT_RISK_SCORE": {"type": "NUMBER", "index": 6, "name": "PAYMENT_RISK_SCORE", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_COLECTOMY_CANCER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_PRCCSR_V2023_1_CLEANED_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "ICD_10_PCS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ICD_10_PCS_DESCRIPTION", "comment": null}, "PRCCSR": {"type": "TEXT", "index": 3, "name": "PRCCSR", "comment": null}, "PRCCSR_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "PRCCSR_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 5, "name": "CLINICAL_DOMAIN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1539584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 6, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "PARENT_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "PARENT_CATEGORY_DESCRIPTION", "comment": null}, "BODY_SYSTEM": {"type": "TEXT", "index": 8, "name": "BODY_SYSTEM", "comment": null}, "DXCCSR_VERSION": {"type": "TEXT", "index": 9, "name": "DXCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 1, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "NEWBORN_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "NEWBORN_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 16.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, "seed.the_tuva_project.terminology__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE_TYPE": {"type": "TEXT", "index": 1, "name": "CODE_TYPE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__code_type"}, "model.the_tuva_project.ahrq_measures__int_pqi_07_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_07_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_num"}, "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PAYER_PLAN", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 2, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 3, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 5, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 8, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 9, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 10, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 11, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 12, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 13, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 14, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 15, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 16, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 17, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 18, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 19, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 20, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 21, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 22, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 23, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 24, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 25, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 28, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 29, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 30, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 31, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 32, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 33, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 36, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 38, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 40, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 41, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 42, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 43, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 44, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 45, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 46, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 48, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 49, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 50, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 51, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 52, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 53, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 54, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 55, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan"}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_ALLOWED_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 13, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 16, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_EXCLUDE_PROCEDURES_MEDICATIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 2, "name": "OBESITY", "comment": null}, "OSTEOARTHRITIS": {"type": "NUMBER", "index": 3, "name": "OSTEOARTHRITIS", "comment": null}, "COPD": {"type": "NUMBER", "index": 4, "name": "COPD", "comment": null}, "ANXIETY_DISORDERS": {"type": "NUMBER", "index": 5, "name": "ANXIETY_DISORDERS", "comment": null}, "CKD": {"type": "NUMBER", "index": 6, "name": "CKD", "comment": null}, "T2D": {"type": "NUMBER", "index": 7, "name": "T2D", "comment": null}, "CLL": {"type": "NUMBER", "index": 8, "name": "CLL", "comment": null}, "DYSPLIPIDEMIAS": {"type": "NUMBER", "index": 9, "name": "DYSPLIPIDEMIAS", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 10, "name": "HYPERTENSION", "comment": null}, "ATHEROSCLEROSIS": {"type": "NUMBER", "index": 11, "name": "ATHEROSCLEROSIS", "comment": null}, "DEMENTIA": {"type": "NUMBER", "index": 12, "name": "DEMENTIA", "comment": null}, "RHEUMATOID_ARTHRITIS": {"type": "NUMBER", "index": 13, "name": "RHEUMATOID_ARTHRITIS", "comment": null}, "CELIAC": {"type": "NUMBER", "index": 14, "name": "CELIAC", "comment": null}, "HIP_FRACTURE": {"type": "NUMBER", "index": 15, "name": "HIP_FRACTURE", "comment": null}, "IMMUNODEFICIENCIES_AND_WHITE_BLOOD_CELL_DISORDERS": {"type": "NUMBER", "index": 16, "name": "IMMUNODEFICIENCIES_AND_WHITE_BLOOD_CELL_DISORDERS", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 17, "name": "ASTHMA", "comment": null}, "T1D": {"type": "NUMBER", "index": 18, "name": "T1D", "comment": null}, "ULCERATIVE_COLITIS": {"type": "NUMBER", "index": 19, "name": "ULCERATIVE_COLITIS", "comment": null}, "CHROHNS": {"type": "NUMBER", "index": 20, "name": "CHROHNS", "comment": null}, "HOLICOBACTER": {"type": "NUMBER", "index": 21, "name": "HOLICOBACTER", "comment": null}, "BIPOLAR": {"type": "NUMBER", "index": 22, "name": "BIPOLAR", "comment": null}, "HEART_FAILURE": {"type": "NUMBER", "index": 23, "name": "HEART_FAILURE", "comment": null}, "TABACCO": {"type": "NUMBER", "index": 24, "name": "TABACCO", "comment": null}, "LYME": {"type": "NUMBER", "index": 25, "name": "LYME", "comment": null}, "BREAST_CANCER": {"type": "NUMBER", "index": 26, "name": "BREAST_CANCER", "comment": null}, "OSTEOPOROSIS": {"type": "NUMBER", "index": 27, "name": "OSTEOPOROSIS", "comment": null}, "PULMONARY_EMBOLISM": {"type": "NUMBER", "index": 28, "name": "PULMONARY_EMBOLISM", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 29, "name": "SCHIZOPHRENIA", "comment": null}, "ATRIAL_FIBRILLATION": {"type": "NUMBER", "index": 30, "name": "ATRIAL_FIBRILLATION", "comment": null}, "COLORECTAL_CANCER": {"type": "NUMBER", "index": 31, "name": "COLORECTAL_CANCER", "comment": null}, "DEPRESSION": {"type": "NUMBER", "index": 32, "name": "DEPRESSION", "comment": null}, "DEEP_VEIN_THROMBOSIS": {"type": "NUMBER", "index": 33, "name": "DEEP_VEIN_THROMBOSIS", "comment": null}, "ALZHEIMER": {"type": "NUMBER", "index": 34, "name": "ALZHEIMER", "comment": null}, "STROKE": {"type": "NUMBER", "index": 35, "name": "STROKE", "comment": null}, "MYOCARDIAL_INFRACTION": {"type": "NUMBER", "index": 36, "name": "MYOCARDIAL_INFRACTION", "comment": null}, "OPIOD_USE_DISORDER": {"type": "NUMBER", "index": 37, "name": "OPIOD_USE_DISORDER", "comment": null}, "LUNG_CANCER": {"type": "NUMBER", "index": 38, "name": "LUNG_CANCER", "comment": null}, "HERPES": {"type": "NUMBER", "index": 39, "name": "HERPES", "comment": null}, "RICKETTSIOSIS": {"type": "NUMBER", "index": 40, "name": "RICKETTSIOSIS", "comment": null}, "MS": {"type": "NUMBER", "index": 41, "name": "MS", "comment": null}, "ALCHOHOL": {"type": "NUMBER", "index": 42, "name": "ALCHOHOL", "comment": null}, "ADHD": {"type": "NUMBER", "index": 43, "name": "ADHD", "comment": null}, "HIV": {"type": "NUMBER", "index": 44, "name": "HIV", "comment": null}, "PTSD": {"type": "NUMBER", "index": 45, "name": "PTSD", "comment": null}, "LUPUS": {"type": "NUMBER", "index": 46, "name": "LUPUS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 47, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"}, "model.the_tuva_project.service_category__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, "model.the_tuva_project.normalized_input__int_procedure_code_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 3, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_COLUMN": {"type": "TEXT", "index": 4, "name": "PROCEDURE_COLUMN", "comment": null}, "NORMALIZED_PROCEDURE_CODE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_PROCEDURE_CODE", "comment": null}, "PROCEDURE_CODE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "PROCEDURE_CODE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize"}, "model.the_tuva_project.core__stg_clinical_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_01_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions"}, "model.the_tuva_project.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 4, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, "model.the_tuva_project.ahrq_measures__int_pqi_11_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_11_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_denom"}, "model.the_tuva_project.normalized_input__int_ms_drg_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MS_DRG_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy"}, "model.the_tuva_project.ahrq_measures__int_pqi_08_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_08_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_num"}, "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_CLAIM_DATE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CLAIM_START_DATE": {"type": "DATE", "index": 5, "name": "NORMALIZED_CLAIM_START_DATE", "comment": null}, "NORMALIZED_CLAIM_END_DATE": {"type": "DATE", "index": 6, "name": "NORMALIZED_CLAIM_END_DATE", "comment": null}, "NORMALIZED_CLAIM_LINE_START_DATE": {"type": "DATE", "index": 7, "name": "NORMALIZED_CLAIM_LINE_START_DATE", "comment": null}, "NORMALIZED_CLAIM_LINE_END_DATE": {"type": "DATE", "index": 8, "name": "NORMALIZED_CLAIM_LINE_END_DATE", "comment": null}, "NORMALIZED_ADMISSION_DATE": {"type": "DATE", "index": 9, "name": "NORMALIZED_ADMISSION_DATE", "comment": null}, "NORMALIZED_DISCHARGE_DATE": {"type": "DATE", "index": 10, "name": "NORMALIZED_DISCHARGE_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"}, "model.the_tuva_project.medical_claim_expanded": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_EXPANDED", "name": "MEDICAL_CLAIM_EXPANDED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.medical_claim_expanded"}, "model.the_tuva_project.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 8, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 9, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 10, "name": "FACILITY_NPI", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 11, "name": "CLAIM_TYPE", "comment": null}, "START_DATE": {"type": "DATE", "index": 12, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 13, "name": "END_DATE", "comment": null}, "DATE_USED_AS_START_DATE": {"type": "TEXT", "index": 14, "name": "DATE_USED_AS_START_DATE", "comment": null}, "DATE_USED_AS_END_DATE": {"type": "TEXT", "index": 15, "name": "DATE_USED_AS_END_DATE", "comment": null}, "DQ_PROBLEM": {"type": "NUMBER", "index": 16, "name": "DQ_PROBLEM", "comment": null}, "DQ_INSIGHT": {"type": "NUMBER", "index": 17, "name": "DQ_INSIGHT", "comment": null}, "START_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 18, "name": "START_DATE_NOT_DETERMINED", "comment": null}, "END_DATE_NOT_DETERMINED": {"type": "NUMBER", "index": 19, "name": "END_DATE_NOT_DETERMINED", "comment": null}, "START_DATE_AFTER_END_DATE": {"type": "NUMBER", "index": 20, "name": "START_DATE_AFTER_END_DATE", "comment": null}, "PATIENT_ID_NOT_UNIQUE": {"type": "NUMBER", "index": 21, "name": "PATIENT_ID_NOT_UNIQUE", "comment": null}, "PATIENT_ID_MISSING": {"type": "NUMBER", "index": 22, "name": "PATIENT_ID_MISSING", "comment": null}, "CLAIM_START_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 23, "name": "CLAIM_START_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_START_DATE_MISSING": {"type": "NUMBER", "index": 24, "name": "CLAIM_START_DATE_MISSING", "comment": null}, "CLAIM_END_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 25, "name": "CLAIM_END_DATE_NOT_UNIQUE", "comment": null}, "CLAIM_END_DATE_MISSING": {"type": "NUMBER", "index": 26, "name": "CLAIM_END_DATE_MISSING", "comment": null}, "CLAIM_START_DATE_AFTER_CLAIM_END_DATE": {"type": "NUMBER", "index": 27, "name": "CLAIM_START_DATE_AFTER_CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 28, "name": "ADMISSION_DATE_NOT_UNIQUE", "comment": null}, "ADMISSION_DATE_MISSING": {"type": "NUMBER", "index": 29, "name": "ADMISSION_DATE_MISSING", "comment": null}, "DISCHARGE_DATE_NOT_UNIQUE": {"type": "NUMBER", "index": 30, "name": "DISCHARGE_DATE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DATE_MISSING": {"type": "NUMBER", "index": 31, "name": "DISCHARGE_DATE_MISSING", "comment": null}, "ADMISSION_DATE_AFTER_DISCHARGE_DATE": {"type": "NUMBER", "index": 32, "name": "ADMISSION_DATE_AFTER_DISCHARGE_DATE", "comment": null}, "ADMIT_TYPE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 33, "name": "ADMIT_TYPE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_TYPE_CODE_MISSING": {"type": "NUMBER", "index": 34, "name": "ADMIT_TYPE_CODE_MISSING", "comment": null}, "ADMIT_SOURCE_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 35, "name": "ADMIT_SOURCE_CODE_NOT_UNIQUE", "comment": null}, "ADMIT_SOURCE_CODE_MISSING": {"type": "NUMBER", "index": 36, "name": "ADMIT_SOURCE_CODE_MISSING", "comment": null}, "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE": {"type": "NUMBER", "index": 37, "name": "DISCHARGE_DISPOSITION_CODE_NOT_UNIQUE", "comment": null}, "DISCHARGE_DISPOSITION_CODE_MISSING": {"type": "NUMBER", "index": 38, "name": "DISCHARGE_DISPOSITION_CODE_MISSING", "comment": null}, "FACILITY_NPI_NOT_UNIQUE": {"type": "NUMBER", "index": 39, "name": "FACILITY_NPI_NOT_UNIQUE", "comment": null}, "FACILITY_NPI_MISSING": {"type": "NUMBER", "index": 40, "name": "FACILITY_NPI_MISSING", "comment": null}, "CLAIM_TYPE_NOT_UNIQUE": {"type": "NUMBER", "index": 41, "name": "CLAIM_TYPE_NOT_UNIQUE", "comment": null}, "CLAIM_TYPE_MISSING": {"type": "NUMBER", "index": 42, "name": "CLAIM_TYPE_MISSING", "comment": null}, "CLAIM_TYPE_NOT_INSTITUTIONAL": {"type": "NUMBER", "index": 43, "name": "CLAIM_TYPE_NOT_INSTITUTIONAL", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 44, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 45, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, "model.the_tuva_project.normalized_input__int_revenue_center_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_REVENUE_CENTER_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize"}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 2, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 3, "name": "HCC_CODE_2", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 5, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 7, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 8, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_FILTER_ENCOUNTER_WITH_CLASSIFICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 21, "name": "CLASSIFICATION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, "model.the_tuva_project.hcc_suspecting__int_prep_conditions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PREP_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "CODE_TYPE": {"type": "TEXT", "index": 4, "name": "CODE_TYPE", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 6, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions"}, "model.the_tuva_project.ahrq_measures__int_pqi_12_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_12_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_num"}, "model.the_tuva_project.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter"}, "model.the_tuva_project.hcc_suspecting__int_medication_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_MEDICATION_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "HCC_DESCRIPTION", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 5, "name": "DISPENSING_DATE", "comment": null}, "DRUG_CODE": {"type": "TEXT", "index": 6, "name": "DRUG_CODE", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 7, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 8, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 9, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 10, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects"}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, "model.the_tuva_project.core__stg_claims_condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_CONDITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INVALID_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 9, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ACUTE_MYOCARDIAL_INFARCTION": {"type": "NUMBER", "index": 2, "name": "ACUTE_MYOCARDIAL_INFARCTION", "comment": null}, "ADHD_CONDUCT_DISORDERS_AND_HYPERKINETIC_SYNDROME": {"type": "NUMBER", "index": 3, "name": "ADHD_CONDUCT_DISORDERS_AND_HYPERKINETIC_SYNDROME", "comment": null}, "ALCOHOL_USE_DISORDERS": {"type": "NUMBER", "index": 4, "name": "ALCOHOL_USE_DISORDERS", "comment": null}, "ALZHEIMERS_DISEASE": {"type": "NUMBER", "index": 5, "name": "ALZHEIMERS_DISEASE", "comment": null}, "ANEMIA": {"type": "NUMBER", "index": 6, "name": "ANEMIA", "comment": null}, "ANXIETY_DISORDERS": {"type": "NUMBER", "index": 7, "name": "ANXIETY_DISORDERS", "comment": null}, "ASTHMA": {"type": "NUMBER", "index": 8, "name": "ASTHMA", "comment": null}, "ATRIAL_FIBRILLATION_AND_FLUTTER": {"type": "NUMBER", "index": 9, "name": "ATRIAL_FIBRILLATION_AND_FLUTTER", "comment": null}, "AUTISM_SPECTRUM_DISORDERS": {"type": "NUMBER", "index": 10, "name": "AUTISM_SPECTRUM_DISORDERS", "comment": null}, "BENIGN_PROSTATIC_HYPERPLASIA": {"type": "NUMBER", "index": 11, "name": "BENIGN_PROSTATIC_HYPERPLASIA", "comment": null}, "BIPOLAR_DISORDER": {"type": "NUMBER", "index": 12, "name": "BIPOLAR_DISORDER", "comment": null}, "CANCER_BREAST": {"type": "NUMBER", "index": 13, "name": "CANCER_BREAST", "comment": null}, "CANCER_COLORECTAL": {"type": "NUMBER", "index": 14, "name": "CANCER_COLORECTAL", "comment": null}, "CANCER_ENDOMETRIAL": {"type": "NUMBER", "index": 15, "name": "CANCER_ENDOMETRIAL", "comment": null}, "CANCER_LUNG": {"type": "NUMBER", "index": 16, "name": "CANCER_LUNG", "comment": null}, "CANCER_PROSTATE": {"type": "NUMBER", "index": 17, "name": "CANCER_PROSTATE", "comment": null}, "CANCER_UROLOGIC_KIDNEY_RENAL_PELVIS_AND_URETER": {"type": "NUMBER", "index": 18, "name": "CANCER_UROLOGIC_KIDNEY_RENAL_PELVIS_AND_URETER", "comment": null}, "CATARACT": {"type": "NUMBER", "index": 19, "name": "CATARACT", "comment": null}, "CEREBRAL_PALSY": {"type": "NUMBER", "index": 20, "name": "CEREBRAL_PALSY", "comment": null}, "CHRONIC_KIDNEY_DISEASE": {"type": "NUMBER", "index": 21, "name": "CHRONIC_KIDNEY_DISEASE", "comment": null}, "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE": {"type": "NUMBER", "index": 22, "name": "CHRONIC_OBSTRUCTIVE_PULMONARY_DISEASE", "comment": null}, "CYSTIC_FIBROSIS_AND_OTHER_METABOLIC_DEVELOPMENTAL_DISORDERS": {"type": "NUMBER", "index": 23, "name": "CYSTIC_FIBROSIS_AND_OTHER_METABOLIC_DEVELOPMENTAL_DISORDERS", "comment": null}, "DEPRESSION_BIPOLAR_OR_OTHER_DEPRESSIVE_MOOD_DISORDERS": {"type": "NUMBER", "index": 24, "name": "DEPRESSION_BIPOLAR_OR_OTHER_DEPRESSIVE_MOOD_DISORDERS", "comment": null}, "DEPRESSIVE_DISORDERS": {"type": "NUMBER", "index": 25, "name": "DEPRESSIVE_DISORDERS", "comment": null}, "DIABETES": {"type": "NUMBER", "index": 26, "name": "DIABETES", "comment": null}, "DRUG_USE_DISORDERS": {"type": "NUMBER", "index": 27, "name": "DRUG_USE_DISORDERS", "comment": null}, "EPILEPSY": {"type": "NUMBER", "index": 28, "name": "EPILEPSY", "comment": null}, "FIBROMYALGIA_AND_CHRONIC_PAIN_AND_FATIGUE": {"type": "NUMBER", "index": 29, "name": "FIBROMYALGIA_AND_CHRONIC_PAIN_AND_FATIGUE", "comment": null}, "GLAUCOMA": {"type": "NUMBER", "index": 30, "name": "GLAUCOMA", "comment": null}, "HEART_FAILURE_AND_NON_ISCHEMIC_HEART_DISEASE": {"type": "NUMBER", "index": 31, "name": "HEART_FAILURE_AND_NON_ISCHEMIC_HEART_DISEASE", "comment": null}, "HEPATITIS_A": {"type": "NUMBER", "index": 32, "name": "HEPATITIS_A", "comment": null}, "HEPATITIS_B_ACUTE_OR_UNSPECIFIED": {"type": "NUMBER", "index": 33, "name": "HEPATITIS_B_ACUTE_OR_UNSPECIFIED", "comment": null}, "HEPATITIS_B_CHRONIC": {"type": "NUMBER", "index": 34, "name": "HEPATITIS_B_CHRONIC", "comment": null}, "HEPATITIS_C_ACUTE": {"type": "NUMBER", "index": 35, "name": "HEPATITIS_C_ACUTE", "comment": null}, "HEPATITIS_C_CHRONIC": {"type": "NUMBER", "index": 36, "name": "HEPATITIS_C_CHRONIC", "comment": null}, "HEPATITIS_C_UNSPECIFIED": {"type": "NUMBER", "index": 37, "name": "HEPATITIS_C_UNSPECIFIED", "comment": null}, "HEPATITIS_D": {"type": "NUMBER", "index": 38, "name": "HEPATITIS_D", "comment": null}, "HEPATITIS_E": {"type": "NUMBER", "index": 39, "name": "HEPATITIS_E", "comment": null}, "HIP_PELVIC_FRACTURE": {"type": "NUMBER", "index": 40, "name": "HIP_PELVIC_FRACTURE", "comment": null}, "HUMAN_IMMUNODEFICIENCY_VIRUS_AND_OR_ACQUIRED_IMMUNODEFICIENCY_SYNDROME_HIV_AIDS": {"type": "NUMBER", "index": 41, "name": "HUMAN_IMMUNODEFICIENCY_VIRUS_AND_OR_ACQUIRED_IMMUNODEFICIENCY_SYNDROME_HIV_AIDS", "comment": null}, "HYPERLIPIDEMIA": {"type": "NUMBER", "index": 42, "name": "HYPERLIPIDEMIA", "comment": null}, "HYPERTENSION": {"type": "NUMBER", "index": 43, "name": "HYPERTENSION", "comment": null}, "HYPOTHYROIDISM": {"type": "NUMBER", "index": 44, "name": "HYPOTHYROIDISM", "comment": null}, "INTELLECTUAL_DISABILITIES_AND_RELATED_CONDITIONS": {"type": "NUMBER", "index": 45, "name": "INTELLECTUAL_DISABILITIES_AND_RELATED_CONDITIONS", "comment": null}, "ISCHEMIC_HEART_DISEASE": {"type": "NUMBER", "index": 46, "name": "ISCHEMIC_HEART_DISEASE", "comment": null}, "LEARNING_DISABILITIES": {"type": "NUMBER", "index": 47, "name": "LEARNING_DISABILITIES", "comment": null}, "LEUKEMIAS_AND_LYMPHOMAS": {"type": "NUMBER", "index": 48, "name": "LEUKEMIAS_AND_LYMPHOMAS", "comment": null}, "LIVER_DISEASE_CIRRHOSIS_AND_OTHER_LIVER_CONDITIONS_EXCEPT_VIRAL_HEPATITIS": {"type": "NUMBER", "index": 49, "name": "LIVER_DISEASE_CIRRHOSIS_AND_OTHER_LIVER_CONDITIONS_EXCEPT_VIRAL_HEPATITIS", "comment": null}, "MIGRAINE_AND_CHRONIC_HEADACHE": {"type": "NUMBER", "index": 50, "name": "MIGRAINE_AND_CHRONIC_HEADACHE", "comment": null}, "MOBILITY_IMPAIRMENTS": {"type": "NUMBER", "index": 51, "name": "MOBILITY_IMPAIRMENTS", "comment": null}, "MULTIPLE_SCLEROSIS_AND_TRANSVERSE_MYELITIS": {"type": "NUMBER", "index": 52, "name": "MULTIPLE_SCLEROSIS_AND_TRANSVERSE_MYELITIS", "comment": null}, "MUSCULAR_DYSTROPHY": {"type": "NUMBER", "index": 53, "name": "MUSCULAR_DYSTROPHY", "comment": null}, "NON_ALZHEIMERS_DEMENTIA": {"type": "NUMBER", "index": 54, "name": "NON_ALZHEIMERS_DEMENTIA", "comment": null}, "OBESITY": {"type": "NUMBER", "index": 55, "name": "OBESITY", "comment": null}, "OPIOID_USE_DISORDER_OUD": {"type": "NUMBER", "index": 56, "name": "OPIOID_USE_DISORDER_OUD", "comment": null}, "OSTEOPOROSIS_WITH_OR_WITHOUT_PATHOLOGICAL_FRACTURE": {"type": "NUMBER", "index": 57, "name": "OSTEOPOROSIS_WITH_OR_WITHOUT_PATHOLOGICAL_FRACTURE", "comment": null}, "OTHER_DEVELOPMENTAL_DELAYS": {"type": "NUMBER", "index": 58, "name": "OTHER_DEVELOPMENTAL_DELAYS", "comment": null}, "PARKINSONS_DISEASE_AND_SECONDARY_PARKINSONISM": {"type": "NUMBER", "index": 59, "name": "PARKINSONS_DISEASE_AND_SECONDARY_PARKINSONISM", "comment": null}, "PERIPHERAL_VASCULAR_DISEASE_PVD": {"type": "NUMBER", "index": 60, "name": "PERIPHERAL_VASCULAR_DISEASE_PVD", "comment": null}, "PERSONALITY_DISORDERS": {"type": "NUMBER", "index": 61, "name": "PERSONALITY_DISORDERS", "comment": null}, "PNEUMONIA_ALL_CAUSE": {"type": "NUMBER", "index": 62, "name": "PNEUMONIA_ALL_CAUSE", "comment": null}, "POST_TRAUMATIC_STRESS_DISORDER_PTSD": {"type": "NUMBER", "index": 63, "name": "POST_TRAUMATIC_STRESS_DISORDER_PTSD", "comment": null}, "PRESSURE_AND_CHRONIC_ULCERS": {"type": "NUMBER", "index": 64, "name": "PRESSURE_AND_CHRONIC_ULCERS", "comment": null}, "RHEUMATOID_ARTHRITIS_OSTEOARTHRITIS": {"type": "NUMBER", "index": 65, "name": "RHEUMATOID_ARTHRITIS_OSTEOARTHRITIS", "comment": null}, "SCHIZOPHRENIA": {"type": "NUMBER", "index": 66, "name": "SCHIZOPHRENIA", "comment": null}, "SCHIZOPHRENIA_AND_OTHER_PSYCHOTIC_DISORDERS": {"type": "NUMBER", "index": 67, "name": "SCHIZOPHRENIA_AND_OTHER_PSYCHOTIC_DISORDERS", "comment": null}, "SENSORY_BLINDNESS_AND_VISUAL_IMPAIRMENT": {"type": "NUMBER", "index": 68, "name": "SENSORY_BLINDNESS_AND_VISUAL_IMPAIRMENT", "comment": null}, "SENSORY_DEAFNESS_AND_HEARING_IMPAIRMENT": {"type": "NUMBER", "index": 69, "name": "SENSORY_DEAFNESS_AND_HEARING_IMPAIRMENT", "comment": null}, "SICKLE_CELL_DISEASE": {"type": "NUMBER", "index": 70, "name": "SICKLE_CELL_DISEASE", "comment": null}, "SPINA_BIFIDA_AND_OTHER_CONGENITAL_ANOMALIES_OF_THE_NERVOUS_SYSTEM": {"type": "NUMBER", "index": 71, "name": "SPINA_BIFIDA_AND_OTHER_CONGENITAL_ANOMALIES_OF_THE_NERVOUS_SYSTEM", "comment": null}, "SPINAL_CORD_INJURY": {"type": "NUMBER", "index": 72, "name": "SPINAL_CORD_INJURY", "comment": null}, "STROKE_TRANSIENT_ISCHEMIC_ATTACK": {"type": "NUMBER", "index": 73, "name": "STROKE_TRANSIENT_ISCHEMIC_ATTACK", "comment": null}, "TOBACCO_USE": {"type": "NUMBER", "index": 74, "name": "TOBACCO_USE", "comment": null}, "TRAUMATIC_BRAIN_INJURY_AND_NONPSYCHOTIC_MENTAL_DISORDERS_DUE_TO_BRAIN_DAMAGE": {"type": "NUMBER", "index": 75, "name": "TRAUMATIC_BRAIN_INJURY_AND_NONPSYCHOTIC_MENTAL_DISORDERS_DUE_TO_BRAIN_DAMAGE", "comment": null}, "VIRAL_HEPATITIS_GENERAL": {"type": "NUMBER", "index": 76, "name": "VIRAL_HEPATITIS_GENERAL", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 77, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"}, "model.the_tuva_project.quality_measures__int_cqm236_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CQM236_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 7, "name": "OBSERVATION_DATE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 8, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator"}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NPI": {"type": "TEXT", "index": 1, "name": "NPI", "comment": null}, "TAXONOMY_CODE": {"type": "TEXT", "index": 2, "name": "TAXONOMY_CODE", "comment": null}, "MEDICARE_SPECIALTY_CODE": {"type": "TEXT", "index": 3, "name": "MEDICARE_SPECIALTY_CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "PRIMARY_FLAG": {"type": "NUMBER", "index": 5, "name": "PRIMARY_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 70063104.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9662399.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DUPLICATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates"}, "model.the_tuva_project.normalized_input__int_procedure_date_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_DATE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "DATE", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting"}, "model.the_tuva_project.hcc_suspecting__int_all_conditions": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_ALL_CONDITIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, "model.the_tuva_project.core__stg_claims_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, "seed.input_layer.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYMENT_YEAR": {"type": "NUMBER", "index": 1, "name": "PAYMENT_YEAR", "comment": null}, "HCPCS_CPT_CODE": {"type": "TEXT", "index": 2, "name": "HCPCS_CPT_CODE", "comment": null}, "INCLUDED_FLAG": {"type": "TEXT", "index": 3, "name": "INCLUDED_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 94208.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 39364.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 9, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 12, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, "model.the_tuva_project.ahrq_measures__int_pqi_16_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_16_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_num"}, "model.the_tuva_project.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_PROF_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values"}, "model.the_tuva_project.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, "model.the_tuva_project.hcc_suspecting__int_lab_suspects": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_LAB_SUSPECTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 3, "name": "RESULT_DATE", "comment": null}, "RESULT": {"type": "NUMBER", "index": 4, "name": "RESULT", "comment": null}, "LAB_CODE": {"type": "TEXT", "index": 5, "name": "LAB_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 6, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "HCC_DESCRIPTION", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 8, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 9, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 10, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 11, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects"}, "seed.the_tuva_project.coding_systems": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "CODING_SYSTEMS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODING_SYSTEM_ID": {"type": "TEXT", "index": 1, "name": "CODING_SYSTEM_ID", "comment": null}, "CODING_SYSTEM_NAME": {"type": "TEXT", "index": 2, "name": "CODING_SYSTEM_NAME", "comment": null}, "CODING_SYSTEM_URI": {"type": "TEXT", "index": 3, "name": "CODING_SYSTEM_URI", "comment": null}, "CODING_SYSTEM_OID": {"type": "TEXT", "index": 4, "name": "CODING_SYSTEM_OID", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.coding_systems"}, "model.the_tuva_project.quality_measures__int_cbe0055_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CBE0055_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_exclusions"}, "model.the_tuva_project.hcc_suspecting__list_rollup": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "LIST_ROLLUP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "REASON": {"type": "TEXT", "index": 4, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 5, "name": "CONTRIBUTING_FACTOR", "comment": null}, "LATEST_SUSPECT_DATE": {"type": "DATE", "index": 6, "name": "LATEST_SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup"}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PAYER_TYPE": {"type": "TEXT", "index": 1, "name": "PAYER_TYPE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, "model.the_tuva_project.ahrq_measures__int_pqi_15_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_15_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_denom"}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_DENOMINATORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_DENOMINATOR_NAME": {"type": "TEXT", "index": 1, "name": "TEST_DENOMINATOR_NAME", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"}, "model.the_tuva_project.service_category__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, "model.the_tuva_project.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 15, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 16, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 17, "name": "READMIT_30_FLAG", "comment": null}, "UNPLANNED_READMIT_30_FLAG": {"type": "NUMBER", "index": 18, "name": "UNPLANNED_READMIT_30_FLAG", "comment": null}, "READMISSION_ENCOUNTER_ID": {"type": "TEXT", "index": 19, "name": "READMISSION_ENCOUNTER_ID", "comment": null}, "READMISSION_ADMIT_DATE": {"type": "DATE", "index": 20, "name": "READMISSION_ADMIT_DATE", "comment": null}, "READMISSION_DISCHARGE_DATE": {"type": "DATE", "index": 21, "name": "READMISSION_DISCHARGE_DATE", "comment": null}, "READMISSION_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 22, "name": "READMISSION_DISCHARGE_DISPOSITION_CODE", "comment": null}, "READMISSION_FACILITY": {"type": "TEXT", "index": 23, "name": "READMISSION_FACILITY", "comment": null}, "READMISSION_MS_DRG": {"type": "TEXT", "index": 24, "name": "READMISSION_MS_DRG", "comment": null}, "READMISSION_LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "READMISSION_LENGTH_OF_STAY", "comment": null}, "READMISSION_INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 26, "name": "READMISSION_INDEX_ADMISSION_FLAG", "comment": null}, "READMISSION_PLANNED_FLAG": {"type": "NUMBER", "index": 27, "name": "READMISSION_PLANNED_FLAG", "comment": null}, "READMISSION_SPECIALTY_COHORT": {"type": "TEXT", "index": 28, "name": "READMISSION_SPECIALTY_COHORT", "comment": null}, "READMISSION_DIED_FLAG": {"type": "NUMBER", "index": 29, "name": "READMISSION_DIED_FLAG", "comment": null}, "READMISSION_DIAGNOSIS_CCS": {"type": "TEXT", "index": 30, "name": "READMISSION_DIAGNOSIS_CCS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, "model.the_tuva_project.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_PLAUSIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 7, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_LINE_NUMBERS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"}, "model.the_tuva_project.service_category__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_INT_PATIENT_HCC_HISTORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 3, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 5, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 6, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "HCC_DESCRIPTION", "comment": null}, "FIRST_RECORDED": {"type": "DATE", "index": 8, "name": "FIRST_RECORDED", "comment": null}, "LAST_RECORDED": {"type": "DATE", "index": 9, "name": "LAST_RECORDED", "comment": null}, "LAST_BILLED": {"type": "DATE", "index": 10, "name": "LAST_BILLED", "comment": null}, "CURRENT_YEAR_BILLED": {"type": "BOOLEAN", "index": 11, "name": "CURRENT_YEAR_BILLED", "comment": null}, "REASON": {"type": "TEXT", "index": 12, "name": "REASON", "comment": null}, "CONTRIBUTING_FACTOR": {"type": "TEXT", "index": 13, "name": "CONTRIBUTING_FACTOR", "comment": null}, "SUSPECT_DATE": {"type": "DATE", "index": 14, "name": "SUSPECT_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DATES_INST", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst"}, "seed.input_layer.lab_result_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "LAB_RESULT_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.lab_result_seed"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_MISSING_GENDER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender"}, "model.the_tuva_project.ahrq_measures__int_pqi_03_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_03_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_num"}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_PAID_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 13, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 16, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_PAID", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "EXCLUSION_CATEGORY": {"type": "TEXT", "index": 3, "name": "EXCLUSION_CATEGORY", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, "model.the_tuva_project.quality_measures__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_WIDE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "NQF_2372": {"type": "NUMBER", "index": 2, "name": "NQF_2372", "comment": null}, "NQF_0034": {"type": "NUMBER", "index": 3, "name": "NQF_0034", "comment": null}, "NQF_0059": {"type": "NUMBER", "index": 4, "name": "NQF_0059", "comment": null}, "CQM_236": {"type": "NUMBER", "index": 5, "name": "CQM_236", "comment": null}, "NQF_0053": {"type": "NUMBER", "index": 6, "name": "NQF_0053", "comment": null}, "CBE_0055": {"type": "NUMBER", "index": 7, "name": "CBE_0055", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, "model.the_tuva_project.ahrq_measures__pqi_rate": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "PQI_RATE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 2, "name": "YEAR_NUMBER", "comment": null}, "PQI_NUMBER": {"type": "NUMBER", "index": 3, "name": "PQI_NUMBER", "comment": null}, "DENOM_COUNT": {"type": "NUMBER", "index": 4, "name": "DENOM_COUNT", "comment": null}, "NUM_COUNT": {"type": "NUMBER", "index": 5, "name": "NUM_COUNT", "comment": null}, "RATE_PER_100_THOUSAND": {"type": "NUMBER", "index": 6, "name": "RATE_PER_100_THOUSAND", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_rate"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_UNION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"}, "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"}, "model.the_tuva_project.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__patient"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION": {"type": "TEXT", "index": 2, "name": "CONDITION", "comment": null}, "FIRST_DIAGNOSIS_DATE": {"type": "DATE", "index": 3, "name": "FIRST_DIAGNOSIS_DATE", "comment": null}, "LAST_DIAGNOSIS_DATE": {"type": "DATE", "index": 4, "name": "LAST_DIAGNOSIS_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "seed.the_tuva_project.terminology__medicare_orec": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_OREC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 1, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, "model.the_tuva_project.core__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, "seed.input_layer.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.medical_claim_seed"}, "model.the_tuva_project.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medical_claim"}, "model.the_tuva_project.quality_measures__int_cbe0055__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_CBE0055__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__performance_period"}, "model.the_tuva_project.ahrq_measures__int_pqi_01_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_01_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_num"}, "seed.the_tuva_project.terminology__ndc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "NDC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"NDC": {"type": "TEXT", "index": 1, "name": "NDC", "comment": null}, "RXCUI": {"type": "TEXT", "index": 2, "name": "RXCUI", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "RXNORM_DESCRIPTION", "comment": null}, "FDA_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "FDA_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 7479808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 823019.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ndc"}, "seed.the_tuva_project.terminology__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ANSI_FIPS_STATE_CODE": {"type": "TEXT", "index": 1, "name": "ANSI_FIPS_STATE_CODE", "comment": null}, "ANSI_FIPS_STATE_ABBREVIATION": {"type": "TEXT", "index": 2, "name": "ANSI_FIPS_STATE_ABBREVIATION", "comment": null}, "ANSI_FIPS_STATE_NAME": {"type": "TEXT", "index": 3, "name": "ANSI_FIPS_STATE_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 55.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, "model.the_tuva_project.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 3, "name": "NORMALIZED_CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 5, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 6, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 8, "name": "CLINICAL_DOMAIN", "comment": null}, "PRCCSR_VERSION": {"type": "TEXT", "index": 9, "name": "PRCCSR_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, "model.the_tuva_project.normalized_input__int_medical_date_aggregation": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MEDICAL_DATE_AGGREGATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "MINIMUM_CLAIM_START_DATE": {"type": "DATE", "index": 3, "name": "MINIMUM_CLAIM_START_DATE", "comment": null}, "MAXIMUM_CLAIM_END_DATE": {"type": "DATE", "index": 4, "name": "MAXIMUM_CLAIM_END_DATE", "comment": null}, "MINIMUM_ADMISSION_DATE": {"type": "DATE", "index": 5, "name": "MINIMUM_ADMISSION_DATE", "comment": null}, "MAXIMUM_DISCHARGE_DATE": {"type": "DATE", "index": 6, "name": "MAXIMUM_DISCHARGE_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation"}, "model.the_tuva_project.quality_measures__int_cbe0055_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CBE0055_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 8, "name": "EVIDENCE_VALUE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_numerator"}, "seed.the_tuva_project.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"GENDER": {"type": "TEXT", "index": 1, "name": "GENDER", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__gender"}, "model.the_tuva_project.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, "model.the_tuva_project.core__stg_claims_practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 3, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, "model.the_tuva_project.normalized_input__int_ms_drg_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_MS_DRG_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting"}, "seed.the_tuva_project.terminology__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ADMIT_TYPE_CODE": {"type": "TEXT", "index": 1, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, "seed.the_tuva_project.terminology__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 1, "name": "MEDICARE_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "MEDICARE_STATUS_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, "model.the_tuva_project.quality_measures__int_cbe0055_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_CBE0055_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 2, "name": "DENOMINATOR_FLAG", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 3, "name": "NUMERATOR_FLAG", "comment": null}, "EXCLUSION_FLAG": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_FLAG", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 5, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 6, "name": "EVIDENCE_VALUE", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 7, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 8, "name": "EXCLUSION_REASON", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 9, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 10, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 11, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 12, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 13, "name": "MEASURE_VERSION", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 14, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_long"}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_PAYMENT_HCC_COUNT_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 4, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 5, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 6, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "PAYMENT_HCC_COUNT": {"type": "TEXT", "index": 8, "name": "PAYMENT_HCC_COUNT", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 9, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 10, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 73.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": {"metadata": {"type": "BASE TABLE", "schema": "HCC_SUSPECTING", "name": "_VALUE_SET_ICD_10_CM_MAPPINGS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DIAGNOSIS_CODE": {"type": "TEXT", "index": 1, "name": "DIAGNOSIS_CODE", "comment": null}, "CMS_HCC_ESRD_V21": {"type": "TEXT", "index": 2, "name": "CMS_HCC_ESRD_V21", "comment": null}, "CMS_HCC_ESRD_V24": {"type": "TEXT", "index": 3, "name": "CMS_HCC_ESRD_V24", "comment": null}, "CMS_HCC_V22": {"type": "TEXT", "index": 4, "name": "CMS_HCC_V22", "comment": null}, "CMS_HCC_V24": {"type": "TEXT", "index": 5, "name": "CMS_HCC_V24", "comment": null}, "CMS_HCC_V28": {"type": "TEXT", "index": 6, "name": "CMS_HCC_V28", "comment": null}, "RX_HCC_V05": {"type": "TEXT", "index": 7, "name": "RX_HCC_V05", "comment": null}, "RX_HCC_V08": {"type": "TEXT", "index": 8, "name": "RX_HCC_V08", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 89088.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 11687.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"}, "model.the_tuva_project.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID_A": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID_A", "comment": null}, "ENCOUNTER_ID_B": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID_B", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PHARMACY_CLAIM_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_INSTITUTIONAL_SNP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"}, "model.the_tuva_project.ahrq_measures__pqi_num_long": {"metadata": {"type": "BASE TABLE", "schema": "AHRQ_MEASURES", "name": "PQI_NUM_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "PQI_NUMBER": {"type": "NUMBER", "index": 5, "name": "PQI_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_num_long"}, "model.the_tuva_project.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, "model.the_tuva_project.core__stg_claims_location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_LOCATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, "seed.the_tuva_project.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SSA_FIPS_STATE_CODE": {"type": "TEXT", "index": 1, "name": "SSA_FIPS_STATE_CODE", "comment": null}, "SSA_FIPS_STATE_NAME": {"type": "TEXT", "index": 2, "name": "SSA_FIPS_STATE_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_ADVANCED_ILLNESS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 5, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 6, "name": "CLAIM_END_DATE", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 7, "name": "PROCEDURE_DATE", "comment": null}, "PATIENT_TYPE": {"type": "TEXT", "index": 8, "name": "PATIENT_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "CLAIMS_PREPROCESSING_TEST_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "model.the_tuva_project.core__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 4, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 5, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 7, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 8, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 9, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 10, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 11, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 13, "name": "MEDICARE_STATUS_CODE", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 14, "name": "SUBSCRIBER_RELATION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 15, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 16, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__eligibility"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_UNGROUPABLE_DRG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg"}, "model.the_tuva_project.core__stg_claims_encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_INVALID_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 7, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "GENDER": {"type": "TEXT", "index": 9, "name": "GENDER", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 10, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"}, "model.the_tuva_project.normalized_input__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim"}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_PAID_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 10, "name": "OTHER_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 11, "name": "PHARMACY_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, "model.the_tuva_project.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PATIENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 9, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 10, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 11, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 12, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 13, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 14, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 15, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 16, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 17, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 18, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CONDITION_CODE": {"type": "TEXT", "index": 2, "name": "CONDITION_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 3, "name": "HCC_CODE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 4, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 5, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, "model.the_tuva_project.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "OBSERVATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MAPPING_METHOD": {"type": "TEXT", "index": 13, "name": "MAPPING_METHOD", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 15, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 16, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 18, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 22, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__observation"}, "seed.the_tuva_project.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_CM": {"type": "TEXT", "index": 1, "name": "ICD_10_CM", "comment": null}, "HEADER_FLAG": {"type": "TEXT", "index": 2, "name": "HEADER_FLAG", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 4, "name": "LONG_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2130944.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 97296.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_ICD_10_PCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_10_PCS": {"type": "TEXT", "index": 1, "name": "ICD_10_PCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2521.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, "model.the_tuva_project.normalized_input__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "NORMALIZED_INPUT_ELIGIBILITY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "SUBSCRIBER_ID": {"type": "TEXT", "index": 3, "name": "SUBSCRIBER_ID", "comment": null}, "GENDER": {"type": "TEXT", "index": 4, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 9, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 10, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 11, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 12, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 13, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 14, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 16, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 17, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 18, "name": "LAST_NAME", "comment": null}, "SOCIAL_SECURITY_NUMBER": {"type": "TEXT", "index": 19, "name": "SOCIAL_SECURITY_NUMBER", "comment": null}, "SUBSCRIBER_RELATION": {"type": "TEXT", "index": 20, "name": "SUBSCRIBER_RELATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 21, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 22, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 23, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 24, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 25, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 26, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__eligibility"}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, "seed.the_tuva_project.quality_measures__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CONCEPTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_NAME": {"type": "TEXT", "index": 1, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_OID": {"type": "TEXT", "index": 2, "name": "CONCEPT_OID", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 3, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 4, "name": "MEASURE_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 5632.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 193.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 1, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_HOSPICE_PALLIATIVE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 4, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 8, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 9, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 14.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_12_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions"}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CCSR_CATEGORY_RANK": {"type": "NUMBER", "index": 6, "name": "CCSR_CATEGORY_RANK", "comment": null}, "IS_IP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 7, "name": "IS_IP_DEFAULT_CATEGORY", "comment": null}, "IS_OP_DEFAULT_CATEGORY": {"type": "BOOLEAN", "index": 8, "name": "IS_OP_DEFAULT_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2387456.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 86288.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, "model.the_tuva_project.insights__count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 65.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, "model.the_tuva_project.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, "model.the_tuva_project.insights__count_claim_by_date_column": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_DATE_COLUMN", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "NUMBER", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 8, "name": "DISPENSING_DATE", "comment": null}, "PHARMACY_PAID_DATE": {"type": "NUMBER", "index": 9, "name": "PHARMACY_PAID_DATE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, "seed.the_tuva_project.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FIPS_CODE": {"type": "TEXT", "index": 1, "name": "FIPS_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 2, "name": "COUNTY", "comment": null}, "STATE": {"type": "TEXT", "index": 3, "name": "STATE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 31232.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3232.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 1, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_1YP": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN_1YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_2YP": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN_2YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_4YP": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN_4YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_9YP": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_BEGIN_9YP", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, "model.the_tuva_project.normalized_input__int_admit_source_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_SOURCE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting"}, "model.the_tuva_project.ahrq_measures__int_pqi_12_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_12_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_denom"}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_FIRST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, "model.the_tuva_project.normalized_input__int_procedure_code_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 3, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 4, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 5, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 6, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 7, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 8, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 9, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 10, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 11, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 12, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 13, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 14, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 15, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 16, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 17, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 18, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 19, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 20, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 21, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 22, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 23, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 24, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 25, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 26, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 27, "name": "PROCEDURE_CODE_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"}, "model.the_tuva_project.core__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PRACTITIONER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 3, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__practitioner"}, "seed.the_tuva_project.terminology__snomed_icd_10_map": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SNOMED_ICD_10_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ID": {"type": "TEXT", "index": 1, "name": "ID", "comment": null}, "EFFECTIVE_TIME": {"type": "TEXT", "index": 2, "name": "EFFECTIVE_TIME", "comment": null}, "ACTIVE": {"type": "TEXT", "index": 3, "name": "ACTIVE", "comment": null}, "MODULE_ID": {"type": "TEXT", "index": 4, "name": "MODULE_ID", "comment": null}, "REF_SET_ID": {"type": "TEXT", "index": 5, "name": "REF_SET_ID", "comment": null}, "REFERENCED_COMPONENT_ID": {"type": "TEXT", "index": 6, "name": "REFERENCED_COMPONENT_ID", "comment": null}, "REFERENCED_COMPONENT_NAME": {"type": "TEXT", "index": 7, "name": "REFERENCED_COMPONENT_NAME", "comment": null}, "MAP_GROUP": {"type": "TEXT", "index": 8, "name": "MAP_GROUP", "comment": null}, "MAP_PRIORITY": {"type": "TEXT", "index": 9, "name": "MAP_PRIORITY", "comment": null}, "MAP_RULE": {"type": "TEXT", "index": 10, "name": "MAP_RULE", "comment": null}, "MAP_ADVICE": {"type": "TEXT", "index": 11, "name": "MAP_ADVICE", "comment": null}, "MAP_TARGET": {"type": "TEXT", "index": 12, "name": "MAP_TARGET", "comment": null}, "MAP_TARGET_NAME": {"type": "TEXT", "index": 13, "name": "MAP_TARGET_NAME", "comment": null}, "CORRELATION_ID": {"type": "TEXT", "index": 14, "name": "CORRELATION_ID", "comment": null}, "MAP_CATEGORY_ID": {"type": "TEXT", "index": 15, "name": "MAP_CATEGORY_ID", "comment": null}, "MAP_CATEGORY_NAME": {"type": "TEXT", "index": 16, "name": "MAP_CATEGORY_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 11658240.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 256479.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map"}, "model.the_tuva_project.emergency_department__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "EMERGENCY_DEPARTMENT_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__summary"}, "model.the_tuva_project.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DQ_PROBLEM": {"type": "TEXT", "index": 1, "name": "DQ_PROBLEM", "comment": null}, "DISTINCT_CLAIMS": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIMS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, "model.the_tuva_project.normalized_input__int_apr_drg_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_APR_DRG_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MDC_CODE": {"type": "TEXT", "index": 1, "name": "MDC_CODE", "comment": null}, "MDC_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "MDC_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 25.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__mdc"}, "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_14_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions"}, "model.the_tuva_project.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_DENOMINATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, "model.the_tuva_project.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PROCEDURE_CODE": {"type": "TEXT", "index": 2, "name": "PROCEDURE_CODE", "comment": null}, "VALID_ICD_10_PCS_FLAG": {"type": "NUMBER", "index": 3, "name": "VALID_ICD_10_PCS_FLAG", "comment": null}, "CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, "model.the_tuva_project.quality_measures__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "DENOMINATOR_SUM": {"type": "NUMBER", "index": 6, "name": "DENOMINATOR_SUM", "comment": null}, "NUMERATOR_SUM": {"type": "NUMBER", "index": 7, "name": "NUMERATOR_SUM", "comment": null}, "EXCLUSION_SUM": {"type": "NUMBER", "index": 8, "name": "EXCLUSION_SUM", "comment": null}, "PERFORMANCE_RATE": {"type": "NUMBER", "index": 9, "name": "PERFORMANCE_RATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, "model.the_tuva_project.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, "model.the_tuva_project.ahrq_measures__int_pqi_11_num": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_11_NUM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "YEAR_NUMBER": {"type": "NUMBER", "index": 3, "name": "YEAR_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_num"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_DETAIL_STAGE_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "FOREIGN_KEY": {"type": "TEXT", "index": 4, "name": "FOREIGN_KEY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"}, "model.the_tuva_project.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, "seed.the_tuva_project.terminology__rxnorm_to_atc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RXNORM_TO_ATC", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"RXCUI": {"type": "TEXT", "index": 1, "name": "RXCUI", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_1_CODE": {"type": "TEXT", "index": 3, "name": "ATC_1_CODE", "comment": null}, "ATC_1_NAME": {"type": "TEXT", "index": 4, "name": "ATC_1_NAME", "comment": null}, "ATC_2_CODE": {"type": "TEXT", "index": 5, "name": "ATC_2_CODE", "comment": null}, "ATC_2_NAME": {"type": "TEXT", "index": 6, "name": "ATC_2_NAME", "comment": null}, "ATC_3_CODE": {"type": "TEXT", "index": 7, "name": "ATC_3_CODE", "comment": null}, "ATC_3_NAME": {"type": "TEXT", "index": 8, "name": "ATC_3_NAME", "comment": null}, "ATC_4_CODE": {"type": "TEXT", "index": 9, "name": "ATC_4_CODE", "comment": null}, "ATC_4_NAME": {"type": "TEXT", "index": 10, "name": "ATC_4_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1092608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 24285.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc"}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD9": {"type": "TEXT", "index": 1, "name": "ICD9", "comment": null}, "EDCNNPA": {"type": "TEXT", "index": 2, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "TEXT", "index": 3, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "TEXT", "index": 4, "name": "EPCT", "comment": null}, "NONER": {"type": "TEXT", "index": 5, "name": "NONER", "comment": null}, "INJURY": {"type": "TEXT", "index": 6, "name": "INJURY", "comment": null}, "PSYCH": {"type": "TEXT", "index": 7, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "TEXT", "index": 8, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "TEXT", "index": 9, "name": "DRUG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 53248.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7443.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, "model.the_tuva_project.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ENCOUNTER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__encounter"}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FIELD": {"type": "TEXT", "index": 1, "name": "FIELD", "comment": null}, "TOTAL_COUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 29.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0059__PERFORMANCE_PERIOD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_END", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_ELIGIBILITY_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values"}, "model.the_tuva_project.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LAB_RESULT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "TEXT", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "TEXT", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "_STG_CLAIMS_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_16_EXCLUSIONS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_NUMBER": {"type": "NUMBER", "index": 4, "name": "EXCLUSION_NUMBER", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"}, "model.the_tuva_project.ahrq_measures__int_pqi_07_denom": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_07_DENOM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_NUMBER": {"type": "NUMBER", "index": 1, "name": "YEAR_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 3, "name": "DATA_SOURCE", "comment": null}, "AGE": {"type": "NUMBER", "index": 4, "name": "AGE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_denom"}, "model.the_tuva_project.normalized_input__int_present_on_admit_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PRESENT_ON_ADMIT_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 5, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 6, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 7, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 8, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 9, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 10, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 11, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 12, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 13, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 15, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 16, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 17, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 18, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 19, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 20, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 21, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 22, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 23, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 24, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 25, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 26, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 27, "name": "DIAGNOSIS_POA_25", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final"}, "seed.input_layer.observation_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "OBSERVATION_SEED", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.observation_seed"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_OUD", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "CHRONIC_CONDITION_TYPE": {"type": "TEXT", "index": 4, "name": "CHRONIC_CONDITION_TYPE", "comment": null}, "CONDITION_CATEGORY": {"type": "TEXT", "index": 5, "name": "CONDITION_CATEGORY", "comment": null}, "CONDITION": {"type": "TEXT", "index": 6, "name": "CONDITION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 7, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "model.the_tuva_project.value_set_member_relevant_fields": {"metadata": {"type": "BASE TABLE", "schema": "CLINICAL_CONCEPT_LIBRARY", "name": "VALUE_SET_MEMBER_RELEVANT_FIELDS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONCEPT_ID": {"type": "TEXT", "index": 1, "name": "CONCEPT_ID", "comment": null}, "CONCEPT_NAME": {"type": "TEXT", "index": 2, "name": "CONCEPT_NAME", "comment": null}, "CONCEPT_TYPE": {"type": "TEXT", "index": 3, "name": "CONCEPT_TYPE", "comment": null}, "VALUE_SET_MEMBER_ID": {"type": "TEXT", "index": 4, "name": "VALUE_SET_MEMBER_ID", "comment": null}, "CODE": {"type": "TEXT", "index": 5, "name": "CODE", "comment": null}, "CODING_SYSTEM_ID": {"type": "TEXT", "index": 6, "name": "CODING_SYSTEM_ID", "comment": null}, "INCLUDE_DESCENDANTS": {"type": "TEXT", "index": 7, "name": "INCLUDE_DESCENDANTS", "comment": null}, "CODING_SYSTEM_NAME": {"type": "TEXT", "index": 8, "name": "CODING_SYSTEM_NAME", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 56320.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4602.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.value_set_member_relevant_fields"}, "model.the_tuva_project.normalized_input__int_discharge_disposition_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DISCHARGE_DISPOSITION_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final"}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_LAST_CLAIM_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 3, "name": "ENROLLMENT_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 4, "name": "INSTITUTIONAL_STATUS", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 5, "name": "SHORT_NAME", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 6, "name": "DESCRIPTION", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 7, "name": "HCC_CODE", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 8, "name": "COEFFICIENT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 40.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "model.the_tuva_project.normalized_input__int_procedure_code_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_PROCEDURE_CODE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSION_TRANSFER", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INVALID_NPI", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"TEST_NAME": {"type": "TEXT", "index": 1, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 2, "name": "PIPELINE_TEST", "comment": null}, "SOURCE_TABLE": {"type": "TEXT", "index": 3, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 5, "name": "TEST_CATEGORY", "comment": null}, "GRAIN": {"type": "TEXT", "index": 6, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 7, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "FILLED_ROW_COUNT": {"type": "NUMBER", "index": 9, "name": "FILLED_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, "model.the_tuva_project.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, "model.the_tuva_project.quality_measures__int_nqf0053_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0053_NUMERATOR", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 4, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 5, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 6, "name": "MEASURE_VERSION", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 7, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE_VALUE": {"type": "TEXT", "index": 8, "name": "EVIDENCE_VALUE", "comment": null}, "NUMERATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "NUMERATOR_FLAG", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator"}, "model.the_tuva_project.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CODE": {"type": "TEXT", "index": 1, "name": "CODE", "comment": null}, "CODE_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "CODE_DESCRIPTION", "comment": null}, "CCSR_CATEGORY": {"type": "TEXT", "index": 3, "name": "CCSR_CATEGORY", "comment": null}, "CCSR_PARENT_CATEGORY": {"type": "TEXT", "index": 4, "name": "CCSR_PARENT_CATEGORY", "comment": null}, "CCSR_CATEGORY_DESCRIPTION": {"type": "TEXT", "index": 5, "name": "CCSR_CATEGORY_DESCRIPTION", "comment": null}, "CLINICAL_DOMAIN": {"type": "TEXT", "index": 6, "name": "CLINICAL_DOMAIN", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 1553408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_DIAGNOSIS_CODE_NORMALIZE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_COLUMN": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_COLUMN", "comment": null}, "NORMALIZED_DIAGNOSIS_CODE": {"type": "TEXT", "index": 5, "name": "NORMALIZED_DIAGNOSIS_CODE", "comment": null}, "DIAGNOSIS_CODE_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "DIAGNOSIS_CODE_OCCURRENCE_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"}, "model.the_tuva_project.normalized_input__int_bill_type_voting": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_BILL_TYPE_VOTING", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting"}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_WITH_CCS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 11, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 2, "name": "GRAIN", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 3, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 4, "name": "TEST_NAME", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 5, "name": "CLAIM_TYPE", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 6, "name": "PIPELINE_TEST", "comment": null}, "FAILURES": {"type": "NUMBER", "index": 7, "name": "FAILURES", "comment": null}, "DENOMINATOR": {"type": "NUMBER", "index": 8, "name": "DENOMINATOR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS_PROCEDURE_CATEGORY": {"type": "TEXT", "index": 1, "name": "CCS_PROCEDURE_CATEGORY", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values"}, "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_SHARED_EXCLUSIONS_DEMENTIA", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EXCLUSION_DATE": {"type": "DATE", "index": 2, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 3, "name": "EXCLUSION_REASON", "comment": null}, "EXCLUSION_TYPE": {"type": "TEXT", "index": 4, "name": "EXCLUSION_TYPE", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 5, "name": "DISPENSING_DATE", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 6, "name": "PAID_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"}, "model.the_tuva_project.normalized_input__int_admit_type_final": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_NORMALIZED_INPUT_ADMIT_TYPE_FINAL", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 2, "name": "DATA_SOURCE", "comment": null}, "COLUMN_NAME": {"type": "TEXT", "index": 3, "name": "COLUMN_NAME", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 4, "name": "NORMALIZED_CODE", "comment": null}, "OCCURRENCE_COUNT": {"type": "NUMBER", "index": 5, "name": "OCCURRENCE_COUNT", "comment": null}, "NEXT_OCCURRENCE_COUNT": {"type": "NUMBER", "index": 6, "name": "NEXT_OCCURRENCE_COUNT", "comment": null}, "OCCURRENCE_ROW_COUNT": {"type": "NUMBER", "index": 7, "name": "OCCURRENCE_ROW_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 1, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 41.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICATION", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "NDC_MAPPING_METHOD": {"type": "TEXT", "index": 11, "name": "NDC_MAPPING_METHOD", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 12, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "RXNORM_DESCRIPTION", "comment": null}, "RXNORM_MAPPING_METHOD": {"type": "TEXT", "index": 14, "name": "RXNORM_MAPPING_METHOD", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 15, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 16, "name": "ATC_DESCRIPTION", "comment": null}, "ATC_MAPPING_METHOD": {"type": "TEXT", "index": 17, "name": "ATC_MAPPING_METHOD", "comment": null}, "ROUTE": {"type": "TEXT", "index": 18, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 19, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 20, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 21, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 22, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 23, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 24, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 25, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medication"}, "model.the_tuva_project.core__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PROCEDURE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MAPPING_METHOD": {"type": "TEXT", "index": 12, "name": "MAPPING_METHOD", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 13, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 14, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 15, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 16, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 17, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 18, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 20, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__procedure"}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": {"metadata": {"type": "BASE TABLE", "schema": "DATA_QUALITY", "name": "_INT_CLAIMS_PREPROCESSING_MEDICAL_CLAIM_DATES", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SOURCE_TABLE": {"type": "TEXT", "index": 1, "name": "SOURCE_TABLE", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "GRAIN": {"type": "TEXT", "index": 3, "name": "GRAIN", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TEST_CATEGORY": {"type": "TEXT", "index": 6, "name": "TEST_CATEGORY", "comment": null}, "TEST_NAME": {"type": "TEXT", "index": 7, "name": "TEST_NAME", "comment": null}, "PIPELINE_TEST": {"type": "NUMBER", "index": 8, "name": "PIPELINE_TEST", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:31UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates"}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:32UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age": {"metadata": {"type": "VIEW", "schema": "AHRQ_MEASURES", "name": "_INT_PQI_SHARED_EXCLUSIONS_MISSING_AGE", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"DATA_SOURCE": {"type": "TEXT", "index": 1, "name": "DATA_SOURCE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age"}, "seed.the_tuva_project.readmissions__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "DEV_THUXUAN", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CCS": {"type": "TEXT", "index": 1, "name": "CCS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 3, "name": "SPECIALTY_COHORT", "comment": null}, "PROCEDURE_OR_DIAGNOSIS": {"type": "TEXT", "index": 4, "name": "PROCEDURE_OR_DIAGNOSIS", "comment": null}}, "stats": {"bytes": {"id": "bytes", "label": "Approximate Size", "value": 8192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2024-05-16 18:30UTC", "include": true, "description": "The timestamp for last update/change"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 276.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index cf7812bea..1d2e65015 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v9.json", "dbt_version": "1.5.0", "generated_at": "2024-05-10T13:57:28.586701Z", "invocation_id": "e50d9557-e0ce-4212-8187-4b7de7f3a0f5", "env": {}, "project_id": "c67fdb5d91230d67641e7c60c81d655e", "user_id": "c5ffe329-cd24-4f82-be78-c62b00387d3d", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.input_layer.condition": {"database": "tuva", "schema": "input_layer", "name": "condition", "resource_type": "model", "package_name": "input_layer", "path": "condition.sql", "original_file_path": "models\\condition.sql", "unique_id": "model.input_layer.condition", "fqn": ["input_layer", "condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "fd5a2e69238bb9f06a12484e6c46a68707468fa2fd98873a283aca3f0831b6b0"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.222455, "relation_name": "tuva.input_layer.condition", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as condition_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as recorded_date\r\n , cast(null as date) as onset_date\r\n , cast(null as date) as resolved_date\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as condition_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\condition.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as condition_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as recorded_date\n , cast(null as date) as onset_date\n , cast(null as date) as resolved_date\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as condition_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as INT ) as condition_rank\n , cast(null as TEXT ) as present_on_admit_code\n , cast(null as TEXT ) as present_on_admit_description\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.eligibility": {"database": "tuva", "schema": "input_layer", "name": "eligibility", "resource_type": "model", "package_name": "input_layer", "path": "eligibility.sql", "original_file_path": "models\\eligibility.sql", "unique_id": "model.input_layer.eligibility", "fqn": ["input_layer", "eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "661cec35069d9f34735769dad63e9aa7b4cb649c518f33fa3f37260b3e2ad0c0"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The eligibility table includes information about a patient's health insurance coverage and demographics (note: we use the word patient as a synonym for member). Every claims dataset should include some sort of eligibility data, otherwise it's impossible to calculate member months, which are needed to calculate measures like PMPM.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "social_security_number": {"name": "social_security_number", "description": "Patient's social security number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_relation": {"name": "subscriber_relation", "description": "Relationship to the policy holder (self, spouse, dependent, etc)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.1458085, "relation_name": "tuva.input_layer.eligibility", "raw_code": "select\r\n patient_id\r\n , member_id\r\n , subscriber_id\r\n , gender\r\n , race\r\n , birth_date\r\n , death_date\r\n , death_flag\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\n , plan\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , first_name\r\n , last_name\r\n , social_security_number\r\n , subscriber_relation\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , phone\r\n , data_source\r\nfrom {{ ref('eligibility_seed') }}", "language": "sql", "refs": [{"name": "eligibility_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.eligibility_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\eligibility.sql", "compiled": true, "compiled_code": "select\n patient_id\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , subscriber_relation\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom dev_thuxuan._tuva_synthetic.eligibility_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.encounter": {"database": "tuva", "schema": "input_layer", "name": "encounter", "resource_type": "model", "package_name": "input_layer", "path": "encounter.sql", "original_file_path": "models\\encounter.sql", "unique_id": "model.input_layer.encounter", "fqn": ["input_layer", "encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "54f63dfde51bec68e80739b7dc257bd4de6ba5ce304c6ccb847dd5765116ee98"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.232949, "relation_name": "tuva.input_layer.encounter", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , cast(null as date) as encounter_start_date\r\n , cast(null as date) as encounter_end_date\r\n , cast(null as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(null as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(null as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\encounter.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_type\n , cast(null as date) as encounter_start_date\n , cast(null as date) as encounter_end_date\n , cast(null as INT ) as length_of_stay\n , cast(null as TEXT ) as admit_source_code\n , cast(null as TEXT ) as admit_source_description\n , cast(null as TEXT ) as admit_type_code\n , cast(null as TEXT ) as admit_type_description\n , cast(null as TEXT ) as discharge_disposition_code\n , cast(null as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(null as TEXT ) as facility_npi\n , cast(null as TEXT ) as primary_diagnosis_code_type\n , cast(null as TEXT ) as primary_diagnosis_code\n , cast(null as TEXT ) as primary_diagnosis_description\n , cast(null as TEXT ) as ms_drg_code\n , cast(null as TEXT ) as ms_drg_description\n , cast(null as TEXT ) as apr_drg_code\n , cast(null as TEXT ) as apr_drg_description\n , cast(null as numeric(28,6) ) as paid_amount\n , cast(null as numeric(28,6) ) as allowed_amount\n , cast(null as numeric(28,6) ) as charge_amount\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.lab_result": {"database": "tuva", "schema": "input_layer", "name": "lab_result", "resource_type": "model", "package_name": "input_layer", "path": "lab_result.sql", "original_file_path": "models\\lab_result.sql", "unique_id": "model.input_layer.lab_result", "fqn": ["input_layer", "lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "46aef97252e6408feeb23ae4e452e12dbf5f1e5ce40259c7ac62d5ca99694e62"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2440412, "relation_name": "tuva.input_layer.lab_result", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as accession_number\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as source_component\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_component\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as date) as result_date\r\n , cast(null as date) as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_int() }} ) as source_abnormal_flag\r\n , cast(null as {{ dbt.type_int() }} ) as normalized_abnormal_flag\r\n , cast(null as {{ dbt.type_string() }} ) as specimen\r\n , cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\lab_result.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as lab_result_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as accession_number\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as source_component\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as normalized_component\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as result\n , cast(null as date) as result_date\n , cast(null as date) as collection_date\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as INT ) as source_abnormal_flag\n , cast(null as INT ) as normalized_abnormal_flag\n , cast(null as TEXT ) as specimen\n , cast(null as TEXT ) as ordering_practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.location": {"database": "tuva", "schema": "input_layer", "name": "location", "resource_type": "model", "package_name": "input_layer", "path": "location.sql", "original_file_path": "models\\location.sql", "unique_id": "model.input_layer.location", "fqn": ["input_layer", "location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "a3cc89396df2108c97443fd31d5d477be676335833a32273412335cea3846d32"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2495544, "relation_name": "tuva.input_layer.location", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as location_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(null as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\location.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as location_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as name\n , cast(null as TEXT ) as facility_type\n , cast(null as TEXT ) as parent_organization\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.medical_claim": {"database": "tuva", "schema": "input_layer", "name": "medical_claim", "resource_type": "model", "package_name": "input_layer", "path": "medical_claim.sql", "original_file_path": "models\\medical_claim.sql", "unique_id": "model.input_layer.medical_claim", "fqn": ["input_layer", "medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "b8acd6c51e8d818339390054e79658a5c1f43fb1c78c8315fcaafad1a6c905be"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The medical_claim table contains information on healthcare services and supplies provided to patients, billed by providers, and paid for by health insurers. It includes information on the provider who rendered the service, the amount paid for the service by the health insurer, and the underlying reason for the service (i.e. diagnosis).\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.207985, "relation_name": "tuva.input_layer.medical_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\nfrom {{ ref('medical_claim_seed') }}", "language": "sql", "refs": [{"name": "medical_claim_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.medical_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\medical_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom dev_thuxuan._tuva_synthetic.medical_claim_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.medication": {"database": "tuva", "schema": "input_layer", "name": "medication", "resource_type": "model", "package_name": "input_layer", "path": "medication.sql", "original_file_path": "models\\medication.sql", "unique_id": "model.input_layer.medication", "fqn": ["input_layer", "medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "edd84aa9ccae7f9dcb9b35251db51aaf59471621f9d7ddb3839cacba4e44665f"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2575572, "relation_name": "tuva.input_layer.medication", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as medication_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as date) as dispensing_date\r\n , cast(null as date) as prescribing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_description\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_description\r\n , cast(null as {{ dbt.type_string() }} ) as atc_code\r\n , cast(null as {{ dbt.type_string() }} ) as atc_description\r\n , cast(null as {{ dbt.type_string() }} ) as route\r\n , cast(null as {{ dbt.type_string() }} ) as strength\r\n , cast(null as {{ dbt.type_int() }} ) as quantity\r\n , cast(null as {{ dbt.type_string() }} ) as quantity_unit\r\n , cast(null as {{ dbt.type_int() }} ) as days_supply\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\medication.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as medication_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as date) as dispensing_date\n , cast(null as date) as prescribing_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as ndc_code\n , cast(null as TEXT ) as ndc_description\n , cast(null as TEXT ) as rxnorm_code\n , cast(null as TEXT ) as rxnorm_description\n , cast(null as TEXT ) as atc_code\n , cast(null as TEXT ) as atc_description\n , cast(null as TEXT ) as route\n , cast(null as TEXT ) as strength\n , cast(null as INT ) as quantity\n , cast(null as TEXT ) as quantity_unit\n , cast(null as INT ) as days_supply\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.observation": {"database": "tuva", "schema": "input_layer", "name": "observation", "resource_type": "model", "package_name": "input_layer", "path": "observation.sql", "original_file_path": "models\\observation.sql", "unique_id": "model.input_layer.observation", "fqn": ["input_layer", "observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "8e2826bb0302d2bc2414217c29d3c5f23a0cae4a2f360b9f3da32f4cc9265b2b"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2636485, "relation_name": "tuva.input_layer.observation", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as observation_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as panel_id\r\n , cast(null as date) as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as observation_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\observation.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as observation_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as panel_id\n , cast(null as date) as observation_date\n , cast(null as TEXT ) as observation_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as result\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.patient": {"database": "tuva", "schema": "input_layer", "name": "patient", "resource_type": "model", "package_name": "input_layer", "path": "patient.sql", "original_file_path": "models\\patient.sql", "unique_id": "model.input_layer.patient", "fqn": ["input_layer", "patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "9f00210edb56da76d293454989e473d5319a2286eaa72a3811de1c6eaac53711"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2704139, "relation_name": "tuva.input_layer.patient", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as sex\r\n , cast(null as {{ dbt.type_string() }} ) as race\r\n , cast(null as date) as birth_date\r\n , cast(null as date) as death_date\r\n , cast(null as {{ dbt.type_int() }} ) as death_flag\r\n , cast(null as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_string() }} ) as county\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\patient.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as sex\n , cast(null as TEXT ) as race\n , cast(null as date) as birth_date\n , cast(null as date) as death_date\n , cast(null as INT ) as death_flag\n , cast(null as TEXT ) as social_security_number\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as TEXT ) as county\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.pharmacy_claim": {"database": "tuva", "schema": "input_layer", "name": "pharmacy_claim", "resource_type": "model", "package_name": "input_layer", "path": "pharmacy_claim.sql", "original_file_path": "models\\pharmacy_claim.sql", "unique_id": "model.input_layer.pharmacy_claim", "fqn": ["input_layer", "pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a9e35276505dba374dbf183f43276406c21f3ace585c9aa4953b2340abbca4ad"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The pharmacy_claim table includes information about retail and specialty drug prescriptions that have been filled by a patient, billed by a pharmacy, and paid by an insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2157505, "relation_name": "tuva.input_layer.pharmacy_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , prescribing_provider_npi\r\n , dispensing_provider_npi\r\n , dispensing_date\r\n , ndc_code\r\n , quantity\r\n , days_supply\r\n , refills\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , data_source\r\nfrom {{ ref('pharmacy_claim_seed') }}", "language": "sql", "refs": [{"name": "pharmacy_claim_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.pharmacy_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\pharmacy_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom dev_thuxuan._tuva_synthetic.pharmacy_claim_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.practitioner": {"database": "tuva", "schema": "input_layer", "name": "practitioner", "resource_type": "model", "package_name": "input_layer", "path": "practitioner.sql", "original_file_path": "models\\practitioner.sql", "unique_id": "model.input_layer.practitioner", "fqn": ["input_layer", "practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "9fe84cd99530a39b3a4dc46666835452ba3737366cdc09319eec8db1e5938446"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.2744133, "relation_name": "tuva.input_layer.practitioner", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(null as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\practitioner.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as practice_affiliation\n , cast(null as TEXT ) as specialty\n , cast(null as TEXT ) as sub_specialty\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.procedure": {"database": "tuva", "schema": "input_layer", "name": "procedure", "resource_type": "model", "package_name": "input_layer", "path": "procedure.sql", "original_file_path": "models\\procedure.sql", "unique_id": "model.input_layer.procedure", "fqn": ["input_layer", "procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "e8c500fd5c02e356b37b6ceb88b3ab6709d5ed9bf878f965220f1050631630fa"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715349084.28312, "relation_name": "tuva.input_layer.procedure", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as procedure_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\procedure.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as procedure_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as procedure_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as modifier_1\n , cast(null as TEXT ) as modifier_2\n , cast(null as TEXT ) as modifier_3\n , cast(null as TEXT ) as modifier_4\n , cast(null as TEXT ) as modifier_5\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "seed.input_layer.eligibility_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "eligibility_seed", "resource_type": "seed", "package_name": "input_layer", "path": "eligibility_seed.csv", "original_file_path": "../seeds\\eligibility_seed.csv", "unique_id": "seed.input_layer.eligibility_seed", "fqn": ["input_layer", "eligibility_seed"], "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "2549b857a561cbc456ea0c03aeb4f92ad34297a41ae1b59a7a8959234bc910eb"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "subscriber_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "social_security_number": "varchar(255)", "subscriber_relation": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "subscriber_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "social_security_number": "varchar(255)", "subscriber_relation": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1715349084.0218532, "relation_name": "dev_thuxuan._tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.lab_result_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "lab_result_seed", "resource_type": "seed", "package_name": "input_layer", "path": "lab_result_seed.csv", "original_file_path": "../seeds\\lab_result_seed.csv", "unique_id": "seed.input_layer.lab_result_seed", "fqn": ["input_layer", "lab_result_seed"], "alias": "lab_result_seed", "checksum": {"name": "sha256", "checksum": "200211d64758e470275cc23e72be5ea67da2ed0355d3cf7cb950a84f6d121654"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"lab_result_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "accession_number": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "source_component": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "normalized_component": "varchar(255)", "status": "varchar(255)", "result": "varchar(255)", "result_date": "date", "collection_date": "date", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "source_abnormal_flag": "integer", "normalized_abnormal_flag": "integer", "specimen": "varchar(255)", "ordering_practitioner_id": "varchar(255)", "data_source": "varchar(255)", "tuva_last_run": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"lab_result_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "accession_number": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "source_component": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "normalized_component": "varchar(255)", "status": "varchar(255)", "result": "varchar(255)", "result_date": "date", "collection_date": "date", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "source_abnormal_flag": "integer", "normalized_abnormal_flag": "integer", "specimen": "varchar(255)", "ordering_practitioner_id": "varchar(255)", "data_source": "varchar(255)", "tuva_last_run": "varchar(255)"}}, "created_at": 1715349084.0403807, "relation_name": "dev_thuxuan._tuva_synthetic.lab_result_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.medical_claim_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "medical_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "medical_claim_seed.csv", "original_file_path": "../seeds\\medical_claim_seed.csv", "unique_id": "seed.input_layer.medical_claim_seed", "fqn": ["input_layer", "medical_claim_seed"], "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "b4abfdab9f7f5860d89707f27e7785218af75b4d3e66e24e6ec6b6d2307dcc3e"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "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": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "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": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "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": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "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": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}}, "created_at": 1715349084.110272, "relation_name": "dev_thuxuan._tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.observation_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "observation_seed", "resource_type": "seed", "package_name": "input_layer", "path": "observation_seed.csv", "original_file_path": "../seeds\\observation_seed.csv", "unique_id": "seed.input_layer.observation_seed", "fqn": ["input_layer", "observation_seed"], "alias": "observation_seed", "checksum": {"name": "sha256", "checksum": "e2ac2f9ddeed287c2d9029d95c30b881e8fe06fc3d2877c593c0778f6f25f30a"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"observation_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "panel_id": "varchar(255)", "observation_date": "date", "observation_type": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "result": "varchar(255)", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"observation_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "panel_id": "varchar(255)", "observation_date": "date", "observation_type": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "result": "varchar(255)", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1715349084.124295, "relation_name": "dev_thuxuan._tuva_synthetic.observation_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.pharmacy_claim_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "pharmacy_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds\\pharmacy_claim_seed.csv", "unique_id": "seed.input_layer.pharmacy_claim_seed", "fqn": ["input_layer", "pharmacy_claim_seed"], "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "66096b86d7bd198c82e3c67c5546791e094b980d06ab9379d00e3b58c054dfd0"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}}, "created_at": 1715349084.1338086, "relation_name": "dev_thuxuan._tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__long_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__long_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__long_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__long_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_condition_category"], "alias": "long_condition_category", "checksum": {"name": "sha256", "checksum": "04e7070502746dfc43e411d6398cca515fd69b52f9fab4f45137ade4aff0965f"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0004861, "relation_name": "dev_thuxuan.ccsr.long_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith ccsr__dx_vertical_pivot as (\r\n \r\n select * from {{ ref('ccsr__dx_vertical_pivot') }} \r\n\r\n), condition as (\r\n \r\n select * from {{ ref('ccsr__stg_core__condition') }}\r\n\r\n), dxccsr_body_systems as (\r\n\r\n select * from {{ ref('ccsr__dxccsr_v2023_1_body_systems') }}\r\n\r\n)\r\n\r\nselect \r\n condition.encounter_id,\r\n condition.claim_id,\r\n condition.patient_id,\r\n condition.normalized_code,\r\n ccsr__dx_vertical_pivot.code_description,\r\n condition.condition_rank,\r\n ccsr__dx_vertical_pivot.ccsr_parent_category,\r\n dxccsr_body_systems.body_system,\r\n dxccsr_body_systems.parent_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category,\r\n ccsr__dx_vertical_pivot.ccsr_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category_rank,\r\n ccsr__dx_vertical_pivot.is_ip_default_category,\r\n ccsr__dx_vertical_pivot.is_op_default_category,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom condition\r\nleft join ccsr__dx_vertical_pivot\r\n on condition.normalized_code = ccsr__dx_vertical_pivot.code\r\nleft join dxccsr_body_systems using(ccsr_parent_category)", "language": "sql", "refs": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__stg_core__condition", "package": null, "version": null}, {"name": "ccsr__dxccsr_v2023_1_body_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'\n),ccsr__dx_vertical_pivot as (\n \n select * from dev_thuxuan.ccsr.dx_vertical_pivot \n\n), condition as (\n \n select * from __dbt__cte__ccsr__stg_core__condition\n\n), dxccsr_body_systems as (\n\n select * from dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_body_systems\n\n)\n\nselect \n condition.encounter_id,\n condition.claim_id,\n condition.patient_id,\n condition.normalized_code,\n ccsr__dx_vertical_pivot.code_description,\n condition.condition_rank,\n ccsr__dx_vertical_pivot.ccsr_parent_category,\n dxccsr_body_systems.body_system,\n dxccsr_body_systems.parent_category_description,\n ccsr__dx_vertical_pivot.ccsr_category,\n ccsr__dx_vertical_pivot.ccsr_category_description,\n ccsr__dx_vertical_pivot.ccsr_category_rank,\n ccsr__dx_vertical_pivot.is_ip_default_category,\n ccsr__dx_vertical_pivot.is_op_default_category,\n '2023.1' as dxccsr_version,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom condition\nleft join ccsr__dx_vertical_pivot\n on condition.normalized_code = ccsr__dx_vertical_pivot.code\nleft join dxccsr_body_systems using(ccsr_parent_category)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ccsr__stg_core__condition", "sql": " __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__long_procedure_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__long_procedure_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__long_procedure_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__long_procedure_category.sql", "unique_id": "model.the_tuva_project.ccsr__long_procedure_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_procedure_category"], "alias": "long_procedure_category", "checksum": {"name": "sha256", "checksum": "b730558911e6223946a523c8ce17320e7825cf8daa66a43d5f6447522c8a5b49"}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0105176, "relation_name": "dev_thuxuan.ccsr.long_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith procedure as (\r\n \r\n select * from {{ ref('ccsr__stg_core__procedure') }}\r\n\r\n), ccsr__procedure_category_map as (\r\n\r\n select * from {{ ref ('ccsr__procedure_category_map') }}\r\n\r\n)\r\n\r\nselect distinct\r\n procedure.encounter_id,\r\n procedure.patient_id,\r\n procedure.normalized_code,\r\n ccsr__procedure_category_map.code_description,\r\n ccsr__procedure_category_map.ccsr_parent_category,\r\n ccsr__procedure_category_map.ccsr_category,\r\n ccsr__procedure_category_map.ccsr_category_description,\r\n ccsr__procedure_category_map.clinical_domain,\r\n {{ var('prccsr_version') }} as prccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom procedure\r\nleft join ccsr__procedure_category_map\r\n on procedure.normalized_code = ccsr__procedure_category_map.code", "language": "sql", "refs": [{"name": "ccsr__stg_core__procedure", "package": null, "version": null}, {"name": "ccsr__procedure_category_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),procedure as (\n \n select * from __dbt__cte__ccsr__stg_core__procedure\n\n), ccsr__procedure_category_map as (\n\n select * from dev_thuxuan.ccsr.procedure_category_map\n\n)\n\nselect distinct\n procedure.encounter_id,\n procedure.patient_id,\n procedure.normalized_code,\n ccsr__procedure_category_map.code_description,\n ccsr__procedure_category_map.ccsr_parent_category,\n ccsr__procedure_category_map.ccsr_category,\n ccsr__procedure_category_map.ccsr_category_description,\n ccsr__procedure_category_map.clinical_domain,\n '2023.1' as prccsr_version,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom procedure\nleft join ccsr__procedure_category_map\n on procedure.normalized_code = ccsr__procedure_category_map.code", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ccsr__stg_core__procedure", "sql": " __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__singular_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__singular_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__singular_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__singular_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__singular_condition_category"], "alias": "singular_condition_category", "checksum": {"name": "sha256", "checksum": "854eb4524c34f5adc61603a23e98a40537fc0be4c24fcb6b47bccfabec9b4e24"}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "singular_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.005492, "relation_name": "dev_thuxuan.ccsr.singular_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n ccsr_category_description,\r\n ccsr_parent_category,\r\n parent_category_description,\r\n body_system,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ref('ccsr__long_condition_category')}}\r\nwhere \r\n is_{{ var('record_type', 'ip') }}_default_category = true\r\n and condition_rank = 1", "language": "sql", "refs": [{"name": "ccsr__long_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n ccsr_category_description,\n ccsr_parent_category,\n parent_category_description,\n body_system,\n '2023.1' as dxccsr_version,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.ccsr.long_condition_category\nwhere \n is_ip_default_category = true\n and condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dx_vertical_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "original_file_path": "models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__dx_vertical_pivot"], "alias": "dx_vertical_pivot", "checksum": {"name": "sha256", "checksum": "c9f8e28a9410fcf064b1981808503dfc12fb104051f21fc0e68e1b95ae036185"}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "dx_vertical_pivot", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349084.9896827, "relation_name": "dev_thuxuan.ccsr.dx_vertical_pivot", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith codes as (\r\n \r\n select\r\n icd_10_cm_code as code, \r\n icd_10_cm_code_description as code_description,\r\n -- loop to generate columns for CCSR categories 1-6\r\n {%- for i in range(1,7) %}\r\n ccsr_category_{{ i }},\r\n ccsr_category_{{ i }}_description,\r\n {%- endfor %}\r\n default_ccsr_category_ip,\r\n default_ccsr_category_op\r\n from {{ ref('ccsr__dxccsr_v2023_1_cleaned_map') }}\r\n\r\n), long_union as (\r\n -- generate select & union statements to pivot category columns to rows\r\n {% for i in range(1,7,1) %}\r\n select \r\n code,\r\n code_description,\r\n left(ccsr_category_{{ i }}, 3) as ccsr_parent_category,\r\n ccsr_category_{{ i }} as ccsr_category,\r\n ccsr_category_{{ i }}_description as ccsr_category_description,\r\n {{ i }} as ccsr_category_rank,\r\n (ccsr_category_{{ i }} = default_ccsr_category_ip) as is_ip_default_category,\r\n (ccsr_category_{{ i }} = default_ccsr_category_op) as is_op_default_category\r\n from codes \r\n {{ \"union all\" if not loop.last else \"\" }}\r\n {%- endfor %}\r\n\r\n)\r\n\r\nselect distinct\r\n *,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom long_union\r\n-- as not all diagnosis codes have multiple categories, we can discard nulls\r\nwhere ccsr_category is not null", "language": "sql", "refs": [{"name": "ccsr__dxccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "compiled": true, "compiled_code": "\n\nwith codes as (\n \n select\n icd_10_cm_code as code, \n icd_10_cm_code_description as code_description,\n -- loop to generate columns for CCSR categories 1-6\n ccsr_category_1,\n ccsr_category_1_description,\n ccsr_category_2,\n ccsr_category_2_description,\n ccsr_category_3,\n ccsr_category_3_description,\n ccsr_category_4,\n ccsr_category_4_description,\n ccsr_category_5,\n ccsr_category_5_description,\n ccsr_category_6,\n ccsr_category_6_description,\n default_ccsr_category_ip,\n default_ccsr_category_op\n from dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_cleaned_map\n\n), long_union as (\n -- generate select & union statements to pivot category columns to rows\n \n select \n code,\n code_description,\n left(ccsr_category_1, 3) as ccsr_parent_category,\n ccsr_category_1 as ccsr_category,\n ccsr_category_1_description as ccsr_category_description,\n 1 as ccsr_category_rank,\n (ccsr_category_1 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_1 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_2, 3) as ccsr_parent_category,\n ccsr_category_2 as ccsr_category,\n ccsr_category_2_description as ccsr_category_description,\n 2 as ccsr_category_rank,\n (ccsr_category_2 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_2 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_3, 3) as ccsr_parent_category,\n ccsr_category_3 as ccsr_category,\n ccsr_category_3_description as ccsr_category_description,\n 3 as ccsr_category_rank,\n (ccsr_category_3 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_3 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_4, 3) as ccsr_parent_category,\n ccsr_category_4 as ccsr_category,\n ccsr_category_4_description as ccsr_category_description,\n 4 as ccsr_category_rank,\n (ccsr_category_4 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_4 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_5, 3) as ccsr_parent_category,\n ccsr_category_5 as ccsr_category,\n ccsr_category_5_description as ccsr_category_description,\n 5 as ccsr_category_rank,\n (ccsr_category_5 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_5 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_6, 3) as ccsr_parent_category,\n ccsr_category_6 as ccsr_category,\n ccsr_category_6_description as ccsr_category_description,\n 6 as ccsr_category_rank,\n (ccsr_category_6 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_6 = default_ccsr_category_op) as is_op_default_category\n from codes \n \n\n)\n\nselect distinct\n *,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom long_union\n-- as not all diagnosis codes have multiple categories, we can discard nulls\nwhere ccsr_category is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__procedure_category_map", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\intermediate\\ccsr__procedure_category_map.sql", "original_file_path": "models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "unique_id": "model.the_tuva_project.ccsr__procedure_category_map", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__procedure_category_map"], "alias": "procedure_category_map", "checksum": {"name": "sha256", "checksum": "0f6cd9ed03c512e1112e451dc9e2705bf170e21e45792fea675af9c9f27b1df9"}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "procedure_category_map", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349084.9936934, "relation_name": "dev_thuxuan.ccsr.procedure_category_map", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n icd_10_pcs as code,\r\n icd_10_pcs_description as code_description,\r\n prccsr as ccsr_category,\r\n left(prccsr, 3) as ccsr_parent_category,\r\n prccsr_description as ccsr_category_description,\r\n clinical_domain,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ccsr__prccsr_v2023_1_cleaned_map')}}", "language": "sql", "refs": [{"name": "ccsr__prccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "compiled": true, "compiled_code": "\n\nselect \n icd_10_pcs as code,\n icd_10_pcs_description as code_description,\n prccsr as ccsr_category,\n left(prccsr, 3) as ccsr_parent_category,\n prccsr_description as ccsr_category_description,\n clinical_domain,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "ccsr__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__condition.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__condition", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__condition"], "alias": "ccsr__stg_core__condition", "checksum": {"name": "sha256", "checksum": "53dcf3e02727e62f515ca661a5e705fa89f77182e14fd4c3e0105043d36c3b95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.012494, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , claim_id\r\n , patient_id\r\n , normalized_code\r\n , condition_rank\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}\r\nwhere normalized_code_type = 'icd-10-cm'", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "ccsr__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__procedure.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__procedure", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__procedure"], "alias": "ccsr__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "5c6186a586734d9fb78d7bfd57195a09b8cdea3ac126cfff7833b4ba8a0bc987"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0144987, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id\r\n , patient_id\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_long"], "alias": "cms_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "0214ba9004298fcecf5b2b221352442efb5afa854edd2c4752f1ee4edc2c7c08"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "cms_chronic_conditions_long", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0604784, "relation_name": "dev_thuxuan.chronic_conditions.cms_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions_unioned as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hiv_aids') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_oud') }}\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , start_date\r\n , chronic_condition_type\r\n , condition_category\r\n , condition\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom conditions_unioned", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith conditions_unioned as (\n\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\n union distinct\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\n union distinct\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\n\n)\n\nselect\n patient_id\n , claim_id\n , start_date\n , chronic_condition_type\n , condition_category\n , condition\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_wide"], "alias": "cms_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "50e44c6afcc69f43ad2bc6a07d331cc8102bdba94a61b5d7c6a20b4f43f28f5e"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "cms_chronic_conditions_wide", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0544713, "relation_name": "dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n chronic_conditions_unioned.patient_id\r\n , chronic_conditions.condition_column_name\r\n , 1 as condition_count\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_long') }} as chronic_conditions_unioned\r\n inner join chronic_conditions as chronic_conditions\r\n on chronic_conditions_unioned.condition = chronic_conditions.condition\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref ('chronic_conditions__cms_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n , order_by= 'condition_column_name'\r\n )\r\n , agg='max'\r\n , then_value= 1\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('cms_chronic_conditions__stg_core__patient') }} p\r\n left join conditions\r\n on p.patient_id = conditions.patient_id\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n\n)\n\n, conditions as (\n\n select\n chronic_conditions_unioned.patient_id\n , chronic_conditions.condition_column_name\n , 1 as condition_count\n from dev_thuxuan.chronic_conditions.cms_chronic_conditions_long as chronic_conditions_unioned\n inner join chronic_conditions as chronic_conditions\n on chronic_conditions_unioned.condition = chronic_conditions.condition\n\n)\n\nselect\n p.patient_id\n , \n \n max(\n \n case\n when condition_column_name = 'acute_myocardial_infarction'\n then 1\n else 0\n end\n )\n \n \n as acute_myocardial_infarction\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'adhd_conduct_disorders_and_hyperkinetic_syndrome'\n then 1\n else 0\n end\n )\n \n \n as adhd_conduct_disorders_and_hyperkinetic_syndrome\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'alcohol_use_disorders'\n then 1\n else 0\n end\n )\n \n \n as alcohol_use_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'alzheimers_disease'\n then 1\n else 0\n end\n )\n \n \n as alzheimers_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'anemia'\n then 1\n else 0\n end\n )\n \n \n as anemia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'anxiety_disorders'\n then 1\n else 0\n end\n )\n \n \n as anxiety_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'asthma'\n then 1\n else 0\n end\n )\n \n \n as asthma\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'atrial_fibrillation_and_flutter'\n then 1\n else 0\n end\n )\n \n \n as atrial_fibrillation_and_flutter\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'autism_spectrum_disorders'\n then 1\n else 0\n end\n )\n \n \n as autism_spectrum_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'benign_prostatic_hyperplasia'\n then 1\n else 0\n end\n )\n \n \n as benign_prostatic_hyperplasia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'bipolar_disorder'\n then 1\n else 0\n end\n )\n \n \n as bipolar_disorder\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_breast'\n then 1\n else 0\n end\n )\n \n \n as cancer_breast\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_colorectal'\n then 1\n else 0\n end\n )\n \n \n as cancer_colorectal\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_endometrial'\n then 1\n else 0\n end\n )\n \n \n as cancer_endometrial\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_lung'\n then 1\n else 0\n end\n )\n \n \n as cancer_lung\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_prostate'\n then 1\n else 0\n end\n )\n \n \n as cancer_prostate\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_urologic_kidney_renal_pelvis_and_ureter'\n then 1\n else 0\n end\n )\n \n \n as cancer_urologic_kidney_renal_pelvis_and_ureter\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cataract'\n then 1\n else 0\n end\n )\n \n \n as cataract\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cerebral_palsy'\n then 1\n else 0\n end\n )\n \n \n as cerebral_palsy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'chronic_kidney_disease'\n then 1\n else 0\n end\n )\n \n \n as chronic_kidney_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'chronic_obstructive_pulmonary_disease'\n then 1\n else 0\n end\n )\n \n \n as chronic_obstructive_pulmonary_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cystic_fibrosis_and_other_metabolic_developmental_disorders'\n then 1\n else 0\n end\n )\n \n \n as cystic_fibrosis_and_other_metabolic_developmental_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'depression_bipolar_or_other_depressive_mood_disorders'\n then 1\n else 0\n end\n )\n \n \n as depression_bipolar_or_other_depressive_mood_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'depressive_disorders'\n then 1\n else 0\n end\n )\n \n \n as depressive_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'diabetes'\n then 1\n else 0\n end\n )\n \n \n as diabetes\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'drug_use_disorders'\n then 1\n else 0\n end\n )\n \n \n as drug_use_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'epilepsy'\n then 1\n else 0\n end\n )\n \n \n as epilepsy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'fibromyalgia_and_chronic_pain_and_fatigue'\n then 1\n else 0\n end\n )\n \n \n as fibromyalgia_and_chronic_pain_and_fatigue\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'glaucoma'\n then 1\n else 0\n end\n )\n \n \n as glaucoma\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'heart_failure_and_non_ischemic_heart_disease'\n then 1\n else 0\n end\n )\n \n \n as heart_failure_and_non_ischemic_heart_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_a'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_a\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_b_acute_or_unspecified'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_b_acute_or_unspecified\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_b_chronic'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_b_chronic\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_acute'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_acute\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_chronic'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_chronic\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_unspecified'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_unspecified\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_d'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_d\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_e'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_e\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hip_pelvic_fracture'\n then 1\n else 0\n end\n )\n \n \n as hip_pelvic_fracture\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids'\n then 1\n else 0\n end\n )\n \n \n as human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hyperlipidemia'\n then 1\n else 0\n end\n )\n \n \n as hyperlipidemia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hypertension'\n then 1\n else 0\n end\n )\n \n \n as hypertension\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hypothyroidism'\n then 1\n else 0\n end\n )\n \n \n as hypothyroidism\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'intellectual_disabilities_and_related_conditions'\n then 1\n else 0\n end\n )\n \n \n as intellectual_disabilities_and_related_conditions\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'ischemic_heart_disease'\n then 1\n else 0\n end\n )\n \n \n as ischemic_heart_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'learning_disabilities'\n then 1\n else 0\n end\n )\n \n \n as learning_disabilities\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'leukemias_and_lymphomas'\n then 1\n else 0\n end\n )\n \n \n as leukemias_and_lymphomas\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis'\n then 1\n else 0\n end\n )\n \n \n as liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'migraine_and_chronic_headache'\n then 1\n else 0\n end\n )\n \n \n as migraine_and_chronic_headache\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'mobility_impairments'\n then 1\n else 0\n end\n )\n \n \n as mobility_impairments\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'multiple_sclerosis_and_transverse_myelitis'\n then 1\n else 0\n end\n )\n \n \n as multiple_sclerosis_and_transverse_myelitis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'muscular_dystrophy'\n then 1\n else 0\n end\n )\n \n \n as muscular_dystrophy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'non_alzheimers_dementia'\n then 1\n else 0\n end\n )\n \n \n as non_alzheimers_dementia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'obesity'\n then 1\n else 0\n end\n )\n \n \n as obesity\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'opioid_use_disorder_oud'\n then 1\n else 0\n end\n )\n \n \n as opioid_use_disorder_oud\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'osteoporosis_with_or_without_pathological_fracture'\n then 1\n else 0\n end\n )\n \n \n as osteoporosis_with_or_without_pathological_fracture\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'other_developmental_delays'\n then 1\n else 0\n end\n )\n \n \n as other_developmental_delays\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'parkinsons_disease_and_secondary_parkinsonism'\n then 1\n else 0\n end\n )\n \n \n as parkinsons_disease_and_secondary_parkinsonism\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'peripheral_vascular_disease_pvd'\n then 1\n else 0\n end\n )\n \n \n as peripheral_vascular_disease_pvd\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'personality_disorders'\n then 1\n else 0\n end\n )\n \n \n as personality_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'pneumonia_all_cause'\n then 1\n else 0\n end\n )\n \n \n as pneumonia_all_cause\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'post_traumatic_stress_disorder_ptsd'\n then 1\n else 0\n end\n )\n \n \n as post_traumatic_stress_disorder_ptsd\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'pressure_and_chronic_ulcers'\n then 1\n else 0\n end\n )\n \n \n as pressure_and_chronic_ulcers\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'rheumatoid_arthritis_osteoarthritis'\n then 1\n else 0\n end\n )\n \n \n as rheumatoid_arthritis_osteoarthritis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'schizophrenia'\n then 1\n else 0\n end\n )\n \n \n as schizophrenia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'schizophrenia_and_other_psychotic_disorders'\n then 1\n else 0\n end\n )\n \n \n as schizophrenia_and_other_psychotic_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sensory_blindness_and_visual_impairment'\n then 1\n else 0\n end\n )\n \n \n as sensory_blindness_and_visual_impairment\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sensory_deafness_and_hearing_impairment'\n then 1\n else 0\n end\n )\n \n \n as sensory_deafness_and_hearing_impairment\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sickle_cell_disease'\n then 1\n else 0\n end\n )\n \n \n as sickle_cell_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'spina_bifida_and_other_congenital_anomalies_of_the_nervous_system'\n then 1\n else 0\n end\n )\n \n \n as spina_bifida_and_other_congenital_anomalies_of_the_nervous_system\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'spinal_cord_injury'\n then 1\n else 0\n end\n )\n \n \n as spinal_cord_injury\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'stroke_transient_ischemic_attack'\n then 1\n else 0\n end\n )\n \n \n as stroke_transient_ischemic_attack\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'tobacco_use'\n then 1\n else 0\n end\n )\n \n \n as tobacco_use\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage'\n then 1\n else 0\n end\n )\n \n \n as traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'viral_hepatitis_general'\n then 1\n else 0\n end\n )\n \n \n as viral_hepatitis_general\n \n \n \n \n\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__cms_chronic_conditions__stg_core__patient p\n left join conditions\n on p.patient_id = conditions.patient_id\ngroup by\n p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_long"], "alias": "tuva_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "238205021f8f37691a836918d59008a60e8647c64ce4139bbb83c51ba95254c8"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_long", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.123481, "relation_name": "dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_conditions as (\r\nselect \r\n patient_id,\r\n normalized_code,\r\n recorded_date\r\n from {{ ref('tuva_chronic_conditions__stg_core__condition') }}\r\n),\r\n\r\n\r\nconditions_with_first_and_last_diagnosis_date as (\r\nselect \r\n patient_id,\r\n normalized_code as icd_10_cm,\r\n min(recorded_date) as first_diagnosis_date,\r\n max(recorded_date) as last_diagnosis_date\r\nfrom all_conditions\r\ngroup by patient_id, normalized_code\r\n\r\n)\r\n\r\n\r\nselect\r\n aa.patient_id,\r\n bb.concept_name as condition,\r\n min(first_diagnosis_date) as first_diagnosis_date,\r\n max(last_diagnosis_date) as last_diagnosis_date,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom conditions_with_first_and_last_diagnosis_date aa\r\ninner join {{ ref('value_set_member_relevant_fields') }} bb\r\non aa.icd_10_cm = bb.code\r\ngroup by aa.patient_id, bb.concept_name", "language": "sql", "refs": [{"name": "tuva_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "value_set_member_relevant_fields", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "model.the_tuva_project.value_set_member_relevant_fields"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__tuva_chronic_conditions__stg_core__condition as (\n\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n),all_conditions as (\nselect \n patient_id,\n normalized_code,\n recorded_date\n from __dbt__cte__tuva_chronic_conditions__stg_core__condition\n),\n\n\nconditions_with_first_and_last_diagnosis_date as (\nselect \n patient_id,\n normalized_code as icd_10_cm,\n min(recorded_date) as first_diagnosis_date,\n max(recorded_date) as last_diagnosis_date\nfrom all_conditions\ngroup by patient_id, normalized_code\n\n)\n\n\nselect\n aa.patient_id,\n bb.concept_name as condition,\n min(first_diagnosis_date) as first_diagnosis_date,\n max(last_diagnosis_date) as last_diagnosis_date,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom conditions_with_first_and_last_diagnosis_date aa\ninner join dev_thuxuan.clinical_concept_library.value_set_member_relevant_fields bb\non aa.icd_10_cm = bb.code\ngroup by aa.patient_id, bb.concept_name", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__tuva_chronic_conditions__stg_core__condition as (\n\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_wide"], "alias": "tuva_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "e262e74fea6bef9fff50e8562484f873cd9f1503f65f495f70e8da5b15362ad7"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_wide", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.147166, "relation_name": "dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\n),\r\n\r\nobesity as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Obesity'\r\n),\r\n\r\n\r\nosteoarthritis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Osteoarthritis'\r\n),\r\n\r\ncopd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Obstructive Pulmonary Disease'\r\n),\r\n\r\nanxiety_disorders as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Anxiety Disorders'\r\n),\r\n\r\nckd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Kidney Disease'\r\n),\r\n\r\nt2d as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Type 2 Diabetes Mellitus'\r\n),\r\n\r\ncll as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Lymphocytic Leukemia'\r\n),\r\n\r\ndysplipidemias as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Dyslipidemias'\r\n),\r\n\r\nhypertension as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Hypertension'\r\n),\r\n\r\natherosclerosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Atherosclerosis'\r\n),\r\n\r\ndementia as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Dementia'\r\n),\r\n\r\nrheumatoid_arthritis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Rheumatoid Arthritis'\r\n),\r\n\r\nceliac as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Celiac Disease'\r\n),\r\n\r\nhip_fracture as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Hip Fracture'\r\n),\r\n\r\nimmunodeficiencies_and_white_blood_cell_disorders as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Specified Immunodeficiencies and White Blood Cell Disorders (HCC v28 concept #115)'\r\n),\r\n\r\nasthma as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Asthma'\r\n),\r\n\r\nt1d as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Type 1 Diabetes Mellitus'\r\n),\r\n\r\nulcerative_colitis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Ulcerative colitis'\r\n),\r\n\r\nchrohns as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chrohn\\'s Disease'\r\n),\r\n\r\nholicobacter as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Helicobacter pylori Infection'\r\n),\r\n\r\nbipolar as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Bipolar Affective Disorder'\r\n),\r\n\r\nheart_failure as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Heart Failure'\r\n),\r\n\r\ntabacco as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Tobacco Use'\r\n),\r\n\r\nlyme as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Lyme Disease'\r\n),\r\n\r\nbreast_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Breast Cancer'\r\n),\r\n\r\nosteoporosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Osteoporosis'\r\n),\r\n\r\npulmonary_embolism as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Pulmonary Embolism, Thrombotic or Unspecified'\r\n),\r\n\r\nschizophrenia as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Schizophrenia'\r\n),\r\n\r\natrial_fibrillation as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Atrial Fibrillation'\r\n),\r\n\r\ncolorectal_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Colorectal Cancer'\r\n),\r\n\r\ndepression as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Major Depressive Disorder'\r\n),\r\n\r\ndeep_vein_thrombosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Deep Vein Thrombosis of Extremities or Central Veins'\r\n),\r\n\r\nalzheimer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Alzheimer Disease'\r\n),\r\n\r\nstroke as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Stroke'\r\n),\r\n\r\nmyocardial_infraction as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Myocardial Infarction'\r\n),\r\n\r\nopiod_use_disorder as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Opioid Use Disorder'\r\n),\r\n\r\nlung_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Lung cancer, primary or unspecified'\r\n),\r\n\r\nherpes as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Herpes Simplex Infection'\r\n),\r\n\r\nrickettsiosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Rickettsiosis'\r\n),\r\n\r\nms as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Multiple Sclerosis'\r\n),\r\n\r\nalchohol as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Alcohol Use Disorder'\r\n),\r\n\r\nadhd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Attention Deficit-Hyperactivity Disorder'\r\n),\r\n\r\nhiv as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'HIV/AIDS (HCC v28 concept #1)'\r\n),\r\n\r\nptsd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Post-Traumatic Stress Disorder'\r\n),\r\n\r\nlupus as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Systemic Lupus Erythematosus'\r\n)\r\n\r\n\r\n\r\n\r\nselect\r\n patient_id,\r\n case when patient_id in (select * from obesity) then 1\r\n else 0\r\n end as obesity,\r\n case when patient_id in (select * from osteoarthritis) then 1\r\n else 0\r\n end as osteoarthritis,\r\n case when patient_id in (select * from copd) then 1\r\n else 0\r\n end as copd,\r\n case when patient_id in (select * from anxiety_disorders) then 1\r\n else 0\r\n end as anxiety_disorders,\r\n case when patient_id in (select * from ckd) then 1\r\n else 0\r\n end as ckd,\r\n case when patient_id in (select * from t2d) then 1\r\n else 0\r\n end as t2d,\r\n case when patient_id in (select * from cll) then 1\r\n else 0\r\n end as cll,\r\n case when patient_id in (select * from dysplipidemias) then 1\r\n else 0\r\n end as dysplipidemias,\r\n case when patient_id in (select * from hypertension) then 1\r\n else 0\r\n end as hypertension,\r\n case when patient_id in (select * from atherosclerosis) then 1\r\n else 0\r\n end as atherosclerosis,\r\n case when patient_id in (select * from dementia) then 1\r\n else 0\r\n end as dementia,\r\n case when patient_id in (select * from rheumatoid_arthritis) then 1\r\n else 0\r\n end as rheumatoid_arthritis,\r\n case when patient_id in (select * from celiac) then 1\r\n else 0\r\n end as celiac,\r\n case when patient_id in (select * from hip_fracture) then 1\r\n else 0\r\n end as hip_fracture,\r\n case when patient_id in (select * from immunodeficiencies_and_white_blood_cell_disorders) then 1\r\n else 0\r\n end as immunodeficiencies_and_white_blood_cell_disorders,\r\n case when patient_id in (select * from asthma) then 1\r\n else 0\r\n end as asthma,\r\n case when patient_id in (select * from t1d) then 1\r\n else 0\r\n end as t1d,\r\n case when patient_id in (select * from ulcerative_colitis) then 1\r\n else 0\r\n end as ulcerative_colitis,\r\n case when patient_id in (select * from chrohns) then 1\r\n else 0\r\n end as chrohns,\r\n case when patient_id in (select * from holicobacter) then 1\r\n else 0\r\n end as holicobacter,\r\n case when patient_id in (select * from bipolar) then 1\r\n else 0\r\n end as bipolar,\r\n case when patient_id in (select * from heart_failure) then 1\r\n else 0\r\n end as heart_failure,\r\n case when patient_id in (select * from tabacco) then 1\r\n else 0\r\n end as tabacco,\r\n case when patient_id in (select * from lyme) then 1\r\n else 0\r\n end as lyme,\r\n case when patient_id in (select * from breast_cancer) then 1\r\n else 0\r\n end as breast_cancer,\r\n case when patient_id in (select * from osteoporosis) then 1\r\n else 0\r\n end as osteoporosis,\r\n case when patient_id in (select * from pulmonary_embolism) then 1\r\n else 0\r\n end as pulmonary_embolism,\r\n case when patient_id in (select * from schizophrenia) then 1\r\n else 0\r\n end as schizophrenia,\r\n case when patient_id in (select * from atrial_fibrillation) then 1\r\n else 0\r\n end as atrial_fibrillation,\r\n case when patient_id in (select * from colorectal_cancer) then 1\r\n else 0\r\n end as colorectal_cancer,\r\n case when patient_id in (select * from depression) then 1\r\n else 0\r\n end as depression,\r\n case when patient_id in (select * from deep_vein_thrombosis) then 1\r\n else 0\r\n end as deep_vein_thrombosis,\r\n case when patient_id in (select * from alzheimer) then 1\r\n else 0\r\n end as alzheimer,\r\n case when patient_id in (select * from stroke) then 1\r\n else 0\r\n end as stroke,\r\n case when patient_id in (select * from myocardial_infraction) then 1\r\n else 0\r\n end as myocardial_infraction,\r\n case when patient_id in (select * from opiod_use_disorder) then 1\r\n else 0\r\n end as opiod_use_disorder,\r\n case when patient_id in (select * from lung_cancer) then 1\r\n else 0\r\n end as lung_cancer,\r\n case when patient_id in (select * from herpes) then 1\r\n else 0\r\n end as herpes,\r\n case when patient_id in (select * from rickettsiosis) then 1\r\n else 0\r\n end as rickettsiosis,\r\n case when patient_id in (select * from ms) then 1\r\n else 0\r\n end as ms,\r\n case when patient_id in (select * from alchohol) then 1\r\n else 0\r\n end as alchohol,\r\n case when patient_id in (select * from adhd) then 1\r\n else 0\r\n end as adhd,\r\n case when patient_id in (select * from hiv) then 1\r\n else 0\r\n end as hiv,\r\n case when patient_id in (select * from ptsd) then 1\r\n else 0\r\n end as ptsd,\r\n case when patient_id in (select * from lupus) then 1\r\n else 0\r\n end as lupus,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom patients", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith patients as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\n),\n\nobesity as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Obesity'\n),\n\n\nosteoarthritis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Osteoarthritis'\n),\n\ncopd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Obstructive Pulmonary Disease'\n),\n\nanxiety_disorders as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Anxiety Disorders'\n),\n\nckd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Kidney Disease'\n),\n\nt2d as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Type 2 Diabetes Mellitus'\n),\n\ncll as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Lymphocytic Leukemia'\n),\n\ndysplipidemias as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Dyslipidemias'\n),\n\nhypertension as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Hypertension'\n),\n\natherosclerosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Atherosclerosis'\n),\n\ndementia as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Dementia'\n),\n\nrheumatoid_arthritis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Rheumatoid Arthritis'\n),\n\nceliac as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Celiac Disease'\n),\n\nhip_fracture as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Hip Fracture'\n),\n\nimmunodeficiencies_and_white_blood_cell_disorders as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Specified Immunodeficiencies and White Blood Cell Disorders (HCC v28 concept #115)'\n),\n\nasthma as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Asthma'\n),\n\nt1d as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Type 1 Diabetes Mellitus'\n),\n\nulcerative_colitis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Ulcerative colitis'\n),\n\nchrohns as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chrohn\\'s Disease'\n),\n\nholicobacter as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Helicobacter pylori Infection'\n),\n\nbipolar as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Bipolar Affective Disorder'\n),\n\nheart_failure as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Heart Failure'\n),\n\ntabacco as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Tobacco Use'\n),\n\nlyme as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Lyme Disease'\n),\n\nbreast_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Breast Cancer'\n),\n\nosteoporosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Osteoporosis'\n),\n\npulmonary_embolism as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Pulmonary Embolism, Thrombotic or Unspecified'\n),\n\nschizophrenia as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Schizophrenia'\n),\n\natrial_fibrillation as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Atrial Fibrillation'\n),\n\ncolorectal_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Colorectal Cancer'\n),\n\ndepression as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Major Depressive Disorder'\n),\n\ndeep_vein_thrombosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Deep Vein Thrombosis of Extremities or Central Veins'\n),\n\nalzheimer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Alzheimer Disease'\n),\n\nstroke as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Stroke'\n),\n\nmyocardial_infraction as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Myocardial Infarction'\n),\n\nopiod_use_disorder as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Opioid Use Disorder'\n),\n\nlung_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Lung cancer, primary or unspecified'\n),\n\nherpes as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Herpes Simplex Infection'\n),\n\nrickettsiosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Rickettsiosis'\n),\n\nms as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Multiple Sclerosis'\n),\n\nalchohol as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Alcohol Use Disorder'\n),\n\nadhd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Attention Deficit-Hyperactivity Disorder'\n),\n\nhiv as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'HIV/AIDS (HCC v28 concept #1)'\n),\n\nptsd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Post-Traumatic Stress Disorder'\n),\n\nlupus as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Systemic Lupus Erythematosus'\n)\n\n\n\n\nselect\n patient_id,\n case when patient_id in (select * from obesity) then 1\n else 0\n end as obesity,\n case when patient_id in (select * from osteoarthritis) then 1\n else 0\n end as osteoarthritis,\n case when patient_id in (select * from copd) then 1\n else 0\n end as copd,\n case when patient_id in (select * from anxiety_disorders) then 1\n else 0\n end as anxiety_disorders,\n case when patient_id in (select * from ckd) then 1\n else 0\n end as ckd,\n case when patient_id in (select * from t2d) then 1\n else 0\n end as t2d,\n case when patient_id in (select * from cll) then 1\n else 0\n end as cll,\n case when patient_id in (select * from dysplipidemias) then 1\n else 0\n end as dysplipidemias,\n case when patient_id in (select * from hypertension) then 1\n else 0\n end as hypertension,\n case when patient_id in (select * from atherosclerosis) then 1\n else 0\n end as atherosclerosis,\n case when patient_id in (select * from dementia) then 1\n else 0\n end as dementia,\n case when patient_id in (select * from rheumatoid_arthritis) then 1\n else 0\n end as rheumatoid_arthritis,\n case when patient_id in (select * from celiac) then 1\n else 0\n end as celiac,\n case when patient_id in (select * from hip_fracture) then 1\n else 0\n end as hip_fracture,\n case when patient_id in (select * from immunodeficiencies_and_white_blood_cell_disorders) then 1\n else 0\n end as immunodeficiencies_and_white_blood_cell_disorders,\n case when patient_id in (select * from asthma) then 1\n else 0\n end as asthma,\n case when patient_id in (select * from t1d) then 1\n else 0\n end as t1d,\n case when patient_id in (select * from ulcerative_colitis) then 1\n else 0\n end as ulcerative_colitis,\n case when patient_id in (select * from chrohns) then 1\n else 0\n end as chrohns,\n case when patient_id in (select * from holicobacter) then 1\n else 0\n end as holicobacter,\n case when patient_id in (select * from bipolar) then 1\n else 0\n end as bipolar,\n case when patient_id in (select * from heart_failure) then 1\n else 0\n end as heart_failure,\n case when patient_id in (select * from tabacco) then 1\n else 0\n end as tabacco,\n case when patient_id in (select * from lyme) then 1\n else 0\n end as lyme,\n case when patient_id in (select * from breast_cancer) then 1\n else 0\n end as breast_cancer,\n case when patient_id in (select * from osteoporosis) then 1\n else 0\n end as osteoporosis,\n case when patient_id in (select * from pulmonary_embolism) then 1\n else 0\n end as pulmonary_embolism,\n case when patient_id in (select * from schizophrenia) then 1\n else 0\n end as schizophrenia,\n case when patient_id in (select * from atrial_fibrillation) then 1\n else 0\n end as atrial_fibrillation,\n case when patient_id in (select * from colorectal_cancer) then 1\n else 0\n end as colorectal_cancer,\n case when patient_id in (select * from depression) then 1\n else 0\n end as depression,\n case when patient_id in (select * from deep_vein_thrombosis) then 1\n else 0\n end as deep_vein_thrombosis,\n case when patient_id in (select * from alzheimer) then 1\n else 0\n end as alzheimer,\n case when patient_id in (select * from stroke) then 1\n else 0\n end as stroke,\n case when patient_id in (select * from myocardial_infraction) then 1\n else 0\n end as myocardial_infraction,\n case when patient_id in (select * from opiod_use_disorder) then 1\n else 0\n end as opiod_use_disorder,\n case when patient_id in (select * from lung_cancer) then 1\n else 0\n end as lung_cancer,\n case when patient_id in (select * from herpes) then 1\n else 0\n end as herpes,\n case when patient_id in (select * from rickettsiosis) then 1\n else 0\n end as rickettsiosis,\n case when patient_id in (select * from ms) then 1\n else 0\n end as ms,\n case when patient_id in (select * from alchohol) then 1\n else 0\n end as alchohol,\n case when patient_id in (select * from adhd) then 1\n else 0\n end as adhd,\n case when patient_id in (select * from hiv) then 1\n else 0\n end as hiv,\n case when patient_id in (select * from ptsd) then 1\n else 0\n end as ptsd,\n case when patient_id in (select * from lupus) then 1\n else 0\n end as lupus,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n\nfrom patients", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_all", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_all"], "alias": "_int_cms_chronic_condition_all", "checksum": {"name": "sha256", "checksum": "a18ad9a5b0f085f926819b82e6d17431e78e0f15dfdad2ef15bf40df621db48a"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_all", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.063476, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, exclusions_diagnosis as (\r\n\r\n select distinct\r\n patient_conditions.claim_id\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Exclude'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_ms_drg\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_diagnosis\r\n on inclusions_unioned.claim_id = exclusions_diagnosis.claim_id\r\n and inclusions_unioned.condition = exclusions_diagnosis.condition\r\nwhere exclusions_diagnosis.claim_id is null", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_ms_drgs as (\n\n select\n patient_id\n , claim_id\n , claim_start_date as start_date\n , 'MS-DRG' as code_type\n , ms_drg_code as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_medical_claim\n\n)\n\n, patient_procedures as (\n\n select\n patient_id\n , claim_id\n , procedure_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__procedure\n\n)\n\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, inclusions_ms_drg as (\n\n select\n patient_ms_drgs.patient_id\n , patient_ms_drgs.claim_id\n , patient_ms_drgs.start_date\n , patient_ms_drgs.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_ms_drgs\n inner join chronic_conditions\n on patient_ms_drgs.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'MS-DRG'\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, inclusions_procedure as (\n\n select\n patient_procedures.patient_id\n , patient_procedures.claim_id\n , patient_procedures.start_date\n , patient_procedures.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_procedures\n inner join chronic_conditions\n on patient_procedures.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, exclusions_diagnosis as (\n\n select distinct\n patient_conditions.claim_id\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Exclude'\n and chronic_conditions.code_system = 'ICD-10-CM'\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_procedure\n union distinct\n select * from inclusions_ms_drg\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom inclusions_unioned\n left join exclusions_diagnosis\n on inclusions_unioned.claim_id = exclusions_diagnosis.claim_id\n and inclusions_unioned.condition = exclusions_diagnosis.condition\nwhere exclusions_diagnosis.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_hiv_aids"], "alias": "_int_cms_chronic_condition_hiv_aids", "checksum": {"name": "sha256", "checksum": "4f52818afa1d5527e38e7356d2d3b07c2181460240a4df8fcc43d8e8ccab3997"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_hiv_aids", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.069282, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)' -%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE excludes encounters with the exception code. Those encounters\r\n will be evaluated separately.\r\n*/\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code <> 'R75'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE includes encounters with the exception code only where that\r\n patient has another encounter that is not R75.\r\n*/\r\n, exception_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n inner join inclusions_diagnosis\r\n on patient_conditions.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code = 'R75'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_ms_drg\r\n union distinct\r\n select * from exception_diagnosis\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n where condition = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)'\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_ms_drgs as (\n\n select\n patient_id\n , claim_id\n , claim_start_date as start_date\n , 'MS-DRG' as code_type\n , ms_drg_code as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_medical_claim\n\n)\n\n/*\n Exception logic: a claim with the diagnosis code R75 requires a second\n qualifying claim that is not R75 (a screening code)\n\n This CTE excludes encounters with the exception code. Those encounters\n will be evaluated separately.\n*/\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.code <> 'R75'\n\n)\n\n, inclusions_ms_drg as (\n\n select\n patient_ms_drgs.patient_id\n , patient_ms_drgs.claim_id\n , patient_ms_drgs.start_date\n , patient_ms_drgs.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_ms_drgs\n inner join chronic_conditions\n on patient_ms_drgs.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'MS-DRG'\n\n)\n\n/*\n Exception logic: a claim with the diagnosis code R75 requires a second\n qualifying claim that is not R75 (a screening code)\n\n This CTE includes encounters with the exception code only where that\n patient has another encounter that is not R75.\n*/\n, exception_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n inner join inclusions_diagnosis\n on patient_conditions.patient_id = inclusions_diagnosis.patient_id\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.code = 'R75'\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_ms_drg\n union distinct\n select * from exception_diagnosis\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom inclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_oud", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_oud"], "alias": "_int_cms_chronic_condition_oud", "checksum": {"name": "sha256", "checksum": "9eee4de2dfb008c08c12e666840e4637a62d57305ab567f01e978bd7e695a0ee"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_oud", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0742917, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Opioid Use Disorder (OUD)' -%}\r\n\r\n{%- set naltrexone_ndcs = (\r\n '00056001122', '00056001130', '00056001170', '00056007950', '00056008050',\r\n '00185003901', '00185003930', '00406009201', '00406009203', '00406117001',\r\n '00406117003', '00555090201', '00555090202', '00904703604', '16729008101',\r\n '16729008110', '42291063230', '43063059115', '47335032683', '47335032688',\r\n '50090286600', '50436010501', '51224020630', '51224020650', '51285027501',\r\n '51285027502', '52152010502', '52152010504', '52152010530', '54868557400',\r\n '63459030042', '63629104601', '63629104701', '65694010003', '65694010010',\r\n '65757030001', '65757030202', '68084029111', '68084029121', '68094085362',\r\n '68115068030'\r\n )\r\n-%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_medications as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , paid_date as start_date\r\n , replace(ndc_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE excludes medication encounters with the exception codes for\r\n Naltrexone. Those encounters will be evaluated separately.\r\n*/\r\n, inclusions_medication as (\r\n\r\n select\r\n patient_medications.patient_id\r\n , patient_medications.claim_id\r\n , patient_medications.start_date\r\n , patient_medications.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code not in {{ naltrexone_ndcs }}\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE includes patients with evidence of the chronic conditions Alcohol\r\n Use Disorders or Drug Use Disorders.\r\n*/\r\n, exclusions_other_chronic_conditions as (\r\n\r\n select distinct patient_id\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n where condition in (\r\n 'Alcohol Use Disorders'\r\n , 'Drug Use Disorders'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE creates the exclusion list which consists of patients with\r\n medication encounters for Naltrexone having Alcohol Use Disorder or Drug\r\n Use Disorder and missing the Opioid Use Disorder diagnosis codes.\r\n*/\r\n, exclusions_medication as (\r\n select distinct\r\n patient_medications.patient_id\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n inner join exclusions_other_chronic_conditions\r\n on patient_medications.patient_id = exclusions_other_chronic_conditions.patient_id\r\n left join inclusions_diagnosis\r\n on patient_medications.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code in {{ naltrexone_ndcs }}\r\n and inclusions_diagnosis.patient_id is null\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_medication\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_medication\r\n on inclusions_unioned.patient_id = exclusions_medication.patient_id\r\nwhere exclusions_medication.patient_id is null", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_pharmacy_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim as (\n\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n where condition = 'Opioid Use Disorder (OUD)'\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_medications as (\n\n select\n patient_id\n , claim_id\n , paid_date as start_date\n , replace(ndc_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim\n\n)\n\n, patient_procedures as (\n\n select\n patient_id\n , claim_id\n , procedure_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__procedure\n\n)\n\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n\n)\n\n, inclusions_procedure as (\n\n select\n patient_procedures.patient_id\n , patient_procedures.claim_id\n , patient_procedures.start_date\n , patient_procedures.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_procedures\n inner join chronic_conditions\n on patient_procedures.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE excludes medication encounters with the exception codes for\n Naltrexone. Those encounters will be evaluated separately.\n*/\n, inclusions_medication as (\n\n select\n patient_medications.patient_id\n , patient_medications.claim_id\n , patient_medications.start_date\n , patient_medications.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_medications\n inner join chronic_conditions\n on patient_medications.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'NDC'\n and chronic_conditions.code not in ('00056001122', '00056001130', '00056001170', '00056007950', '00056008050', '00185003901', '00185003930', '00406009201', '00406009203', '00406117001', '00406117003', '00555090201', '00555090202', '00904703604', '16729008101', '16729008110', '42291063230', '43063059115', '47335032683', '47335032688', '50090286600', '50436010501', '51224020630', '51224020650', '51285027501', '51285027502', '52152010502', '52152010504', '52152010530', '54868557400', '63459030042', '63629104601', '63629104701', '65694010003', '65694010010', '65757030001', '65757030202', '68084029111', '68084029121', '68094085362', '68115068030')\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE includes patients with evidence of the chronic conditions Alcohol\n Use Disorders or Drug Use Disorders.\n*/\n, exclusions_other_chronic_conditions as (\n\n select distinct patient_id\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\n where condition in (\n 'Alcohol Use Disorders'\n , 'Drug Use Disorders'\n )\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE creates the exclusion list which consists of patients with\n medication encounters for Naltrexone having Alcohol Use Disorder or Drug\n Use Disorder and missing the Opioid Use Disorder diagnosis codes.\n*/\n, exclusions_medication as (\n select distinct\n patient_medications.patient_id\n from patient_medications\n inner join chronic_conditions\n on patient_medications.code = chronic_conditions.code\n inner join exclusions_other_chronic_conditions\n on patient_medications.patient_id = exclusions_other_chronic_conditions.patient_id\n left join inclusions_diagnosis\n on patient_medications.patient_id = inclusions_diagnosis.patient_id\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'NDC'\n and chronic_conditions.code in ('00056001122', '00056001130', '00056001170', '00056007950', '00056008050', '00185003901', '00185003930', '00406009201', '00406009203', '00406117001', '00406117003', '00555090201', '00555090202', '00904703604', '16729008101', '16729008110', '42291063230', '43063059115', '47335032683', '47335032688', '50090286600', '50436010501', '51224020630', '51224020650', '51285027501', '51285027502', '52152010502', '52152010504', '52152010530', '54868557400', '63459030042', '63629104601', '63629104701', '65694010003', '65694010010', '65757030001', '65757030202', '68084029111', '68084029121', '68094085362', '68115068030')\n and inclusions_diagnosis.patient_id is null\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_procedure\n union distinct\n select * from inclusions_medication\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom inclusions_unioned\n left join exclusions_medication\n on inclusions_unioned.patient_id = exclusions_medication.patient_id\nwhere exclusions_medication.patient_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim as (\n\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "a70e41749804fd6e994d9e402d8009d0ac5056125b8406bd3b3c83d7bcb6b89b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0762823, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}\r\nwhere claim_id is not null", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "07322cb7611f42c7a13dc4eb47bef985761aa7d22f76edf64f311600572837ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0782793, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "53d00e7c521d7f492d420fda96b6d32320ec8fbb2cbdfe289086366cf25a24ce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.080285, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , procedure_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}\r\nwhere claim_id is not null", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "13658bee1ace9ca1182c47521f91379a9f01c2acea63cc7ac6ebbd20f5c11c43"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.081857, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , claim_start_date\r\n , ms_drg_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "ecc2a524daafc432ac31406a35143ad8149f911db369e71f86d2c40481339e94"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.0839436, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , paid_date\r\n , ndc_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [{"name": "pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "tuva_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "f370672047f2b026bd5104b700c770c40070642f54642308ade51083b49abd3d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1493843, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition')}}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "dev_thuxuan", "schema": "test", "name": "tuva_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "47a2c172b79fd191be1a9e81b8f5a936d1cfc42b4bfb4f24c5436c775ff9e8a5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1514697, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.medical_claim_expanded": {"database": "dev_thuxuan", "schema": "claims_expanded", "name": "medical_claim_expanded", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_expanded\\medical_claim_expanded.sql", "original_file_path": "models\\claims_expanded\\medical_claim_expanded.sql", "unique_id": "model.the_tuva_project.medical_claim_expanded", "fqn": ["the_tuva_project", "claims_expanded", "medical_claim_expanded"], "alias": "medical_claim_expanded", "checksum": {"name": "sha256", "checksum": "04ff66dd3885b586f0e72f7a5acbb9ece6c6a162a10835ee6e4d0893ea9b63c5"}, "config": {"enabled": true, "alias": null, "schema": "claims_expanded", "database": null, "tags": ["claims_expanded"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["claims_expanded"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_expanded\\_claims_expanded_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_expanded", "materialized": "table", "tags": "claims_expanded", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1574755, "relation_name": "dev_thuxuan.claims_expanded.medical_claim_expanded", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect *\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_expanded\\medical_claim_expanded.sql", "compiled": true, "compiled_code": "\n\n\nselect *\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "unique_id": "model.the_tuva_project.acute_inpatient__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "final", "acute_inpatient__summary"], "alias": "acute_inpatient_summary", "checksum": {"name": "sha256", "checksum": "d96d82c8fa390ed36d4c75f02f9a2d17968b5f777f562e4edd109615cc4cf2ab"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the acute inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "acute_inpatient_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1692188, "relation_name": "dev_thuxuan.claims_preprocessing.acute_inpatient_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith distinct_encounters as (\r\n select distinct\r\n a.encounter_id\r\n , a.patient_id\r\n , b.encounter_start_date\r\n , b.encounter_end_date\r\nfrom {{ ref('acute_inpatient__encounter_id') }} a\r\ninner join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('acute_inpatient__first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('acute_inpatient__last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\n select\r\n b.encounter_id\r\n , sum(paid_amount) as prof_paid_amount\r\n , sum(allowed_amount) as prof_allowed_amount\r\n , sum(charge_amount) as prof_charge_amount\r\n from {{ ref('acute_inpatient__stg_medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\n select distinct\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n from {{ ref('acute_inpatient__stg_eligibility') }}\r\n )\r\n\r\n, provider as (\r\n select\r\n a.encounter_id\r\n , max(a.facility_npi) as facility_npi\r\n , b.provider_first_name\r\n , b.provider_last_name\r\n , count(distinct facility_npi) as npi_count\r\n from {{ ref('acute_inpatient__institutional_encounter_id') }} a\r\n left join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\n group by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n, a.encounter_start_date\r\n, a.encounter_end_date\r\n, a.patient_id\r\n, {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n, e.gender\r\n, e.race\r\n, c.diagnosis_code_type as primary_diagnosis_code_type\r\n, c.diagnosis_code_1 as primary_diagnosis_code\r\n, coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\r\n, f.facility_npi\r\n, f.provider_first_name\r\n, f.provider_last_name\r\n, c.ms_drg_code\r\n, j.ms_drg_description\r\n, j.medical_surgical\r\n, c.apr_drg_code\r\n, k.apr_drg_description\r\n, c.admit_source_code\r\n, h.admit_source_description\r\n, c.admit_type_code\r\n, i.admit_type_description\r\n, c.discharge_disposition_code\r\n, g.discharge_disposition_description\r\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n, {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n, case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__first_claim_values", "package": null, "version": null}, {"name": "acute_inpatient__last_claim_values", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_eligibility", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n),distinct_encounters as (\n select distinct\n a.encounter_id\n , a.patient_id\n , b.encounter_start_date\n , b.encounter_end_date\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id a\ninner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\n select\n b.encounter_id\n , sum(paid_amount) as prof_paid_amount\n , sum(allowed_amount) as prof_allowed_amount\n , sum(charge_amount) as prof_charge_amount\n from __dbt__cte__acute_inpatient__stg_medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\n select distinct\n patient_id\n , birth_date\n , gender\n , race\n from __dbt__cte__acute_inpatient__stg_eligibility\n )\n\n, provider as (\n select\n a.encounter_id\n , max(a.facility_npi) as facility_npi\n , b.provider_first_name\n , b.provider_last_name\n , count(distinct facility_npi) as npi_count\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id a\n left join dev_thuxuan.terminology.provider b\n on a.facility_npi = b.npi\n group by 1,3,4\n)\n\nselect\n a.encounter_id\n, a.encounter_start_date\n, a.encounter_end_date\n, a.patient_id\n, datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n, e.gender\n, e.race\n, c.diagnosis_code_type as primary_diagnosis_code_type\n, c.diagnosis_code_1 as primary_diagnosis_code\n, coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\n, f.facility_npi\n, f.provider_first_name\n, f.provider_last_name\n, c.ms_drg_code\n, j.ms_drg_description\n, j.medical_surgical\n, c.apr_drg_code\n, k.apr_drg_description\n, c.admit_source_code\n, h.admit_source_description\n, c.admit_type_code\n, i.admit_type_description\n, c.discharge_disposition_code\n, g.discharge_disposition_description\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n, datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n, case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n, data_source\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom distinct_encounters a\nleft join institutional_claim_details c\n on a.encounter_id = c.encounter_id\nleft join professional_claim_details d\n on a.encounter_id = d.encounter_id\nleft join patient e\n on a.patient_id = e.patient_id\nleft join provider f\n on a.encounter_id = f.encounter_id\nleft join dev_thuxuan.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join dev_thuxuan.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join dev_thuxuan.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join dev_thuxuan.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join dev_thuxuan.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "sql": " __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__claims_with_encounter_data", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__claims_with_encounter_data"], "alias": "_int_acute_inpatient_claims_with_encounter_data", "checksum": {"name": "sha256", "checksum": "e1a9951d714eb969fe7106960d6cd71fa4769a2467c7b70cf9dff3cf17370154"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_claims_with_encounter_data", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1898508, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_claims_with_encounter_data", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns relevant encounter-level\r\n-- data for every professional or institutional\r\n-- acute inpatient claim that is part of an encounter\r\n-- (note that all institutional acute inpatienet claims\r\n-- are part of an acute inpatient encounter, but only\r\n-- professional acute inpatient claims that are not\r\n-- orphan claims and that belong to one and only\r\n-- one encounter, i.e. have encounter_count = 1,\r\n-- are part of an acute inpatient encounter).\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_id\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.admit_type_code,\r\n aa.admit_source_code,\r\n aa.discharge_disposition_code,\r\n aa.start_date,\r\n aa.end_date,\r\n\r\n bb.encounter_id,\r\n\r\n cc.encounter_start_date,\r\n cc.encounter_end_date\r\n\r\nfrom {{ ref('acute_inpatient__institutional_claims') }} aa\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_id') }} bb\r\non aa.claim_id = bb.claim_id\r\nand aa.patient_id = bb.patient_id\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_start_and_end_dates') }} cc\r\non bb.encounter_id = cc.encounter_id\r\nand bb.patient_id = cc.patient_id\r\n),\r\n\r\n\r\n\r\nadmit_codes as (\r\nselect\r\n encounter_id,\r\n max(admit_source_code) as encounter_admit_source_code,\r\n max(admit_type_code) as encounter_admit_type_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere start_date = encounter_start_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\ndischarge_code as (\r\nselect\r\n encounter_id,\r\n max(discharge_disposition_code) as encounter_discharge_disposition_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere end_date = encounter_end_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\nall_useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.encounter_start_date,\r\n aa.encounter_end_date,\r\n\r\n bb.encounter_admit_source_code,\r\n bb.encounter_admit_type_code,\r\n \r\n cc.encounter_discharge_disposition_code\r\n\r\nfrom useful_fields_at_claim_id_level aa \r\n left join admit_codes bb on aa.encounter_id = bb.encounter_id\r\n left join discharge_code cc on aa.encounter_id = cc.encounter_id\r\n)\r\n\r\n\r\n\r\nselect \r\n *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_useful_fields_at_claim_id_level", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns relevant encounter-level\n-- data for every professional or institutional\n-- acute inpatient claim that is part of an encounter\n-- (note that all institutional acute inpatienet claims\n-- are part of an acute inpatient encounter, but only\n-- professional acute inpatient claims that are not\n-- orphan claims and that belong to one and only\n-- one encounter, i.e. have encounter_count = 1,\n-- are part of an acute inpatient encounter).\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_id\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- *************************************************\n\n\n\n\nwith useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.admit_type_code,\n aa.admit_source_code,\n aa.discharge_disposition_code,\n aa.start_date,\n aa.end_date,\n\n bb.encounter_id,\n\n cc.encounter_start_date,\n cc.encounter_end_date\n\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims aa\n\nleft join\ndev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id bb\non aa.claim_id = bb.claim_id\nand aa.patient_id = bb.patient_id\n\nleft join\ndev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates cc\non bb.encounter_id = cc.encounter_id\nand bb.patient_id = cc.patient_id\n),\n\n\n\nadmit_codes as (\nselect\n encounter_id,\n max(admit_source_code) as encounter_admit_source_code,\n max(admit_type_code) as encounter_admit_type_code\nfrom useful_fields_at_claim_id_level\nwhere start_date = encounter_start_date\ngroup by encounter_id\n),\n\n\ndischarge_code as (\nselect\n encounter_id,\n max(discharge_disposition_code) as encounter_discharge_disposition_code\nfrom useful_fields_at_claim_id_level\nwhere end_date = encounter_end_date\ngroup by encounter_id\n),\n\n\nall_useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.encounter_start_date,\n aa.encounter_end_date,\n\n bb.encounter_admit_source_code,\n bb.encounter_admit_type_code,\n \n cc.encounter_discharge_disposition_code\n\nfrom useful_fields_at_claim_id_level aa \n left join admit_codes bb on aa.encounter_id = bb.encounter_id\n left join discharge_code cc on aa.encounter_id = cc.encounter_id\n)\n\n\n\nselect \n *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__data_quality_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__data_quality_summary"], "alias": "_int_acute_inpatient_data_quality_summary", "checksum": {"name": "sha256", "checksum": "15282b45f8a715704fcf456517f324f18136338f9a5ba67618c709a0583b4e34"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_data_quality_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.175195, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_data_quality_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model summarizes data quality issues\r\n-- that could affect claims preprocessing.\r\n-- The table returns 2 fields:\r\n-- field\r\n-- total_count\r\n--\r\n-- If we order the results by 'field', the first\r\n-- 3 rows give us a high level summary:\r\n--\r\n-- 01 Total acute inpatient institutional claims:\r\n-- This is the total number of acute inpatient\r\n-- institutional claims\r\n-- 02 Acute inpatient institutional claims with insights:\r\n-- This is the number of acute inpatient institutional\r\n-- claims for which something is not ideal (e.g. they\r\n-- are missing a claim_start_date) but it's not something\r\n-- that prevents the claim from being used in the\r\n-- encounter grouper.\r\n\r\n-- 03 Acute inpatient institutional claims with problems:\r\n-- This is the number of acute inpatient institutional\r\n-- claims that have a data quality problem that\r\n-- prevents them from being used in the encounter grouper.\r\n\r\n-- The rest of the rows in the table give us counts\r\n-- of the number of acute inpatient institutional claims\r\n-- that have specific data quality problems.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith total_acute_inpatient__institutional_claims as (\r\nselect\r\n '01 Total acute inpatient institutional claims' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ntotal_claims_with_insights as (\r\nselect\r\n '02 Acute inpatient institutional claims with insights' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_insight = 1\r\n),\r\n\r\n\r\ntotal_claims_with_problems as (\r\nselect\r\n '03 Acute inpatient institutional claims with problems' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_problem = 1\r\n),\r\n\r\n\r\npatient_id_not_unique as (\r\nselect\r\n '04 patient_id_not_unique' as field,\r\n sum(patient_id_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\npatient_id_missing as (\r\nselect\r\n '05 patient_id_missing' as field,\r\n sum(patient_id_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_not_unique as (\r\nselect\r\n '06 claim_start_date_not_unique' as field,\r\n sum(claim_start_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_missing as (\r\nselect\r\n '07 claim_start_date_missing' as field,\r\n sum(claim_start_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_not_unique as (\r\nselect\r\n '08 claim_end_date_not_unique' as field,\r\n sum(claim_end_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_missing as (\r\nselect\r\n '09 claim_end_date_missing' as field,\r\n sum(claim_end_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_after_claim_end_date as (\r\nselect\r\n '10 claim_start_date_after_claim_end_date' as field,\r\n sum(claim_start_date_after_claim_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_not_unique as (\r\nselect\r\n '11 admission_date_not_unique' as field,\r\n sum(admission_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_missing as (\r\nselect\r\n '12 admission_date_missing' as field,\r\n sum(admission_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_not_unique as (\r\nselect\r\n '13 discharge_date_not_unique' as field,\r\n sum(discharge_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_missing as (\r\nselect\r\n '14 discharge_date_missing' as field,\r\n sum(discharge_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_after_discharge_date as (\r\nselect\r\n '15 admission_date_after_discharge_date' as field,\r\n sum(admission_date_after_discharge_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_not_unique as (\r\nselect\r\n '16 admit_type_code_not_unique' as field,\r\n sum(admit_type_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_missing as (\r\nselect\r\n '17 admit_type_code_missing' as field,\r\n sum(admit_type_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_not_unique as (\r\nselect\r\n '18 admit_source_code_not_unique' as field,\r\n sum(admit_source_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_missing as (\r\nselect\r\n '19 admit_source_code_missing' as field,\r\n sum(admit_source_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_not_unique as (\r\nselect\r\n '20 discharge_disposition_code_not_unique' as field,\r\n sum(discharge_disposition_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_missing as (\r\nselect\r\n '21 discharge_disposition_code_missing' as field,\r\n sum(discharge_disposition_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_not_unique as (\r\nselect\r\n '22 facility_npi_not_unique' as field,\r\n sum(facility_npi_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_missing as (\r\nselect\r\n '23 facility_npi_missing' as field,\r\n sum(facility_npi_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_unique as (\r\nselect\r\n '24 claim_type_not_unique' as field,\r\n sum(claim_type_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_missing as (\r\nselect\r\n '25 claim_type_missing' as field,\r\n sum(claim_type_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_institutional as (\r\nselect\r\n '26 claim_type_not_institutional' as field,\r\n sum(claim_type_not_institutional) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_not_determined as (\r\nselect\r\n '27 start_date_not_determined' as field,\r\n sum(start_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nend_date_not_determined as (\r\nselect\r\n '28 end_date_not_determined' as field,\r\n sum(end_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_after_end_date as (\r\nselect\r\n '29 start_date_after_end_date' as field,\r\n sum(start_date_after_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\n\r\nunion_cte as (\r\nselect *\r\nfrom total_acute_inpatient__institutional_claims\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_insights\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_problems\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_after_claim_end_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_after_discharge_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_institutional\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom end_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_after_end_date\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model summarizes data quality issues\n-- that could affect claims preprocessing.\n-- The table returns 2 fields:\n-- field\n-- total_count\n--\n-- If we order the results by 'field', the first\n-- 3 rows give us a high level summary:\n--\n-- 01 Total acute inpatient institutional claims:\n-- This is the total number of acute inpatient\n-- institutional claims\n-- 02 Acute inpatient institutional claims with insights:\n-- This is the number of acute inpatient institutional\n-- claims for which something is not ideal (e.g. they\n-- are missing a claim_start_date) but it's not something\n-- that prevents the claim from being used in the\n-- encounter grouper.\n\n-- 03 Acute inpatient institutional claims with problems:\n-- This is the number of acute inpatient institutional\n-- claims that have a data quality problem that\n-- prevents them from being used in the encounter grouper.\n\n-- The rest of the rows in the table give us counts\n-- of the number of acute inpatient institutional claims\n-- that have specific data quality problems.\n-- *************************************************\n\n\n\n\nwith total_acute_inpatient__institutional_claims as (\nselect\n '01 Total acute inpatient institutional claims' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ntotal_claims_with_insights as (\nselect\n '02 Acute inpatient institutional claims with insights' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\nwhere dq_insight = 1\n),\n\n\ntotal_claims_with_problems as (\nselect\n '03 Acute inpatient institutional claims with problems' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\nwhere dq_problem = 1\n),\n\n\npatient_id_not_unique as (\nselect\n '04 patient_id_not_unique' as field,\n sum(patient_id_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\npatient_id_missing as (\nselect\n '05 patient_id_missing' as field,\n sum(patient_id_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_not_unique as (\nselect\n '06 claim_start_date_not_unique' as field,\n sum(claim_start_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_missing as (\nselect\n '07 claim_start_date_missing' as field,\n sum(claim_start_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_end_date_not_unique as (\nselect\n '08 claim_end_date_not_unique' as field,\n sum(claim_end_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_end_date_missing as (\nselect\n '09 claim_end_date_missing' as field,\n sum(claim_end_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_after_claim_end_date as (\nselect\n '10 claim_start_date_after_claim_end_date' as field,\n sum(claim_start_date_after_claim_end_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_not_unique as (\nselect\n '11 admission_date_not_unique' as field,\n sum(admission_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_missing as (\nselect\n '12 admission_date_missing' as field,\n sum(admission_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_date_not_unique as (\nselect\n '13 discharge_date_not_unique' as field,\n sum(discharge_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_date_missing as (\nselect\n '14 discharge_date_missing' as field,\n sum(discharge_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_after_discharge_date as (\nselect\n '15 admission_date_after_discharge_date' as field,\n sum(admission_date_after_discharge_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_type_code_not_unique as (\nselect\n '16 admit_type_code_not_unique' as field,\n sum(admit_type_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_type_code_missing as (\nselect\n '17 admit_type_code_missing' as field,\n sum(admit_type_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_source_code_not_unique as (\nselect\n '18 admit_source_code_not_unique' as field,\n sum(admit_source_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_source_code_missing as (\nselect\n '19 admit_source_code_missing' as field,\n sum(admit_source_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_disposition_code_not_unique as (\nselect\n '20 discharge_disposition_code_not_unique' as field,\n sum(discharge_disposition_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_disposition_code_missing as (\nselect\n '21 discharge_disposition_code_missing' as field,\n sum(discharge_disposition_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nfacility_npi_not_unique as (\nselect\n '22 facility_npi_not_unique' as field,\n sum(facility_npi_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nfacility_npi_missing as (\nselect\n '23 facility_npi_missing' as field,\n sum(facility_npi_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_not_unique as (\nselect\n '24 claim_type_not_unique' as field,\n sum(claim_type_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_missing as (\nselect\n '25 claim_type_missing' as field,\n sum(claim_type_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_not_institutional as (\nselect\n '26 claim_type_not_institutional' as field,\n sum(claim_type_not_institutional) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nstart_date_not_determined as (\nselect\n '27 start_date_not_determined' as field,\n sum(start_date_not_determined) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nend_date_not_determined as (\nselect\n '28 end_date_not_determined' as field,\n sum(end_date_not_determined) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nstart_date_after_end_date as (\nselect\n '29 start_date_after_end_date' as field,\n sum(start_date_after_end_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\n\nunion_cte as (\nselect *\nfrom total_acute_inpatient__institutional_claims\n\nunion all\n\nselect *\nfrom total_claims_with_insights\n\nunion all\n\nselect *\nfrom total_claims_with_problems\n\nunion all\n\nselect *\nfrom patient_id_not_unique\n\nunion all\n\nselect *\nfrom patient_id_missing\n\nunion all\n\nselect *\nfrom claim_start_date_not_unique\n\nunion all\n\nselect *\nfrom claim_start_date_missing\n\nunion all\n\nselect *\nfrom claim_end_date_not_unique\n\nunion all\n\nselect *\nfrom claim_end_date_missing\n\nunion all\n\nselect *\nfrom claim_start_date_after_claim_end_date\n\nunion all\n\nselect *\nfrom admission_date_not_unique\n\nunion all\n\nselect *\nfrom admission_date_missing\n\nunion all\n\nselect *\nfrom discharge_date_not_unique\n\nunion all\n\nselect *\nfrom discharge_date_missing\n\nunion all\n\nselect *\nfrom admission_date_after_discharge_date\n\nunion all\n\nselect *\nfrom admit_type_code_not_unique\n\nunion all\n\nselect *\nfrom admit_type_code_missing\n\nunion all\n\nselect *\nfrom admit_source_code_not_unique\n\nunion all\n\nselect *\nfrom admit_source_code_missing\n\nunion all\n\nselect *\nfrom discharge_disposition_code_not_unique\n\nunion all\n\nselect *\nfrom discharge_disposition_code_missing\n\nunion all\n\nselect *\nfrom facility_npi_not_unique\n\nunion all\n\nselect *\nfrom facility_npi_missing\n\nunion all\n\nselect *\nfrom claim_type_not_unique\n\nunion all\n\nselect *\nfrom claim_type_missing\n\nunion all\n\nselect *\nfrom claim_type_not_institutional\n\nunion all\n\nselect *\nfrom start_date_not_determined\n\nunion all\n\nselect *\nfrom end_date_not_determined\n\nunion all\n\nselect *\nfrom start_date_after_end_date\n)\n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_data_for_medical_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_data_for_medical_claims"], "alias": "_int_encounter_data_for_medical_claims", "checksum": {"name": "sha256", "checksum": "88e533b9c572f2d70b39f28e985d31860d6b8b00f8cb7935f23f4dcc1d2551d9"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_encounter_data_for_medical_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1928673, "relation_name": "dev_thuxuan.claims_preprocessing._int_encounter_data_for_medical_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns all the columns with relevant\r\n-- encounter fields that we will append to the medical_claim\r\n-- table.\r\n\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_type\r\n-- encounter_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- orphan_claim_flag (always 0 or 1) (never null)\r\n-- encounter_count (could be 0,1,2,3,...) (never null)\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith acute_inpatient_claims_with_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' as encounter_type,\r\n encounter_id,\r\n encounter_start_date,\r\n encounter_end_date,\r\n encounter_admit_source_code,\r\n encounter_admit_type_code,\r\n encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n 0 as orphan_claim_flag,\r\n 1 as encounter_count\r\nfrom {{ ref('acute_inpatient__claims_with_encounter_data') }}\r\n),\r\n\r\n\r\nacute_inpatient_claims_without_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' encounter_type,\r\n cast(null as {{ dbt.type_string() }}) as encounter_id,\r\n cast(null as date) as encounter_start_date,\r\n cast(null as date) as encounter_end_date,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_source_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_type_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n orphan_claim_flag,\r\n encounter_count\r\n \r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_with_encounter_id\r\n\r\nunion all\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_without_encounter_id", "language": "sql", "refs": [{"name": "acute_inpatient__claims_with_encounter_data", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns all the columns with relevant\n-- encounter fields that we will append to the medical_claim\n-- table.\n\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- encounter_type\n-- encounter_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- orphan_claim_flag (always 0 or 1) (never null)\n-- encounter_count (could be 0,1,2,3,...) (never null)\n-- *************************************************\n\n\n\n\nwith acute_inpatient_claims_with_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' as encounter_type,\n encounter_id,\n encounter_start_date,\n encounter_end_date,\n encounter_admit_source_code,\n encounter_admit_type_code,\n encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n 0 as orphan_claim_flag,\n 1 as encounter_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_claims_with_encounter_data\n),\n\n\nacute_inpatient_claims_without_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' encounter_type,\n cast(null as TEXT) as encounter_id,\n cast(null as date) as encounter_start_date,\n cast(null as date) as encounter_end_date,\n cast(null as TEXT) as encounter_admit_source_code,\n cast(null as TEXT) as encounter_admit_type_code,\n cast(null as TEXT) as encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n orphan_claim_flag,\n encounter_count\n \nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_id"], "alias": "_int_acute_inpatient_encounter_id", "checksum": {"name": "sha256", "checksum": "db38237e33ffd492574e6c5ad5ebea49fccc7cd892c82fbca60b60398714e637"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1868658, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns an encounter_id to each\r\n-- institutional or professional acute inpatient claim\r\n-- that is eligible to be part of an encounter.\r\n-- Professional acute inpatient claims that are\r\n-- orphan claims (don't overlap with an institutional\r\n-- acute inpatient claim) or that have\r\n-- encounter_count > 1 (overlap with more than one different\r\n-- acute inpatient encounter) are not included here.\r\n-- It returns a table with these 3 columns:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }} inst\r\nleft join {{ ref('acute_inpatient__stg_medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)-- *************************************************\n-- This dbt model assigns an encounter_id to each\n-- institutional or professional acute inpatient claim\n-- that is eligible to be part of an encounter.\n-- Professional acute inpatient claims that are\n-- orphan claims (don't overlap with an institutional\n-- acute inpatient claim) or that have\n-- encounter_count > 1 (overlap with more than one different\n-- acute inpatient encounter) are not included here.\n-- It returns a table with these 3 columns:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- *************************************************\n\n\n\n\nselect\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id inst\nleft join __dbt__cte__acute_inpatient__stg_medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_start_and_end_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_start_and_end_dates"], "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "57037b341f7e9ff8d6b3804ee4e5b1e5fe1f2294bf6c2934d1091b830e4ce0eb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1801162, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns an encounter_start_date and\r\n-- an encounter_end_date to each acute inpatient\r\n-- encounter_id.\r\n-- This returns a table with 4 fields:\r\n-- patient_id\r\n-- encounter_id\r\n-- encounter_start_date\r\n-- encounter_end_date\r\n-- The number of rows in the table should be equal\r\n-- to the number of acute inpatient encounters.\r\n-- *************************************************\r\n\r\n\r\nwith add_encounter_id_to_acute_inpatient_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('acute_inpatient__institutional_claims') }} aip\r\nleft join {{ ref('acute_inpatient__institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_acute_inpatient_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_start_date and\n-- an encounter_end_date to each acute inpatient\n-- encounter_id.\n-- This returns a table with 4 fields:\n-- patient_id\n-- encounter_id\n-- encounter_start_date\n-- encounter_end_date\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient encounters.\n-- *************************************************\n\n\nwith add_encounter_id_to_acute_inpatient_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims aip\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_acute_inpatient_encounters\ngroup by patient_id, encounter_id\n)\n\nselect\n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__first_claim_values"], "alias": "_int_acute_inpatient_first_claim_values", "checksum": {"name": "sha256", "checksum": "b9cfe221cd15388a374f8fe6d6d8a3de682efe4065e75162c4ad51fb146160d9"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_first_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1958363, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('acute_inpatient__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join __dbt__cte__acute_inpatient__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__institutional_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_claims"], "alias": "_int_acute_inpatient_institutional_claims", "checksum": {"name": "sha256", "checksum": "deff2167566d0415c0d661bf0f9eaac277f5fad00d5ac1964d2e8d8555cc52d6"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1722102, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model gives us all acute inpatient institutional claims.\r\n-- We have one row per claim_id (for all claim_ids belonging to\r\n-- acute inpatient institutinal claims).\r\n-- The number of rows in the table is equal to the number of unique\r\n-- claim_ids (i.e. claim_id is a primary key).\r\n-- Note that we are assuming that a claim_id is unique across\r\n-- all people in the datset, i.e.\r\n-- that no two people can have the same claim_id.\r\n-- *************************************************\r\n\r\nwith acute_inpatient_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\r\ninner join {{ ref('acute_inpatient__stg_service_category')}} sc\r\n on mc.claim_id = sc.claim_id\r\nwhere mc.claim_type = 'institutional'\r\n and sc.service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [{"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__stg_service_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model gives us all acute inpatient institutional claims.\n-- We have one row per claim_id (for all claim_ids belonging to\n-- acute inpatient institutinal claims).\n-- The number of rows in the table is equal to the number of unique\n-- claim_ids (i.e. claim_id is a primary key).\n-- Note that we are assuming that a claim_id is unique across\n-- all people in the datset, i.e.\n-- that no two people can have the same claim_id.\n-- *************************************************\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n),acute_inpatient_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join __dbt__cte__acute_inpatient__stg_service_category sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Acute Inpatient'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom acute_inpatient_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom acute_inpatient_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n\nfrom header_level_values h\nleft join data_quality_flags dq\n on h.claim_id = dq.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_encounter_id"], "alias": "_int_acute_inpatient_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "78875daea25541f4c85eeb70dd86b8a4c4991ecb85252f1cd2ab6fcb85c5b4c4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.178198, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model groups acute inpatient institutional\r\n-- claims into encounters. It assigns an encounter_id\r\n-- to each acute inpatient institutional claim.\r\n-- This returns a table with 3 fields:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id\r\n-- The number of rows in the table should be equal\r\n-- to the number of acute inpatient institutional claims.\r\n-- *************************************************\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n\r\n -- Claims with different end_date and start_date that are\r\n -- adjacent (i.e. separated by 1 day) should be merged:\r\n when ( {{ dbt.dateadd(datepart= 'day', interval=1, from_date_or_timestamp='aa.end_date') }} = bb.start_date\r\n and aa.facility_npi = bb.facility_npi\r\n\t and aa.discharge_disposition_code = '30') then 1\r\n\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model groups acute inpatient institutional\n-- claims into encounters. It assigns an encounter_id\n-- to each acute inpatient institutional claim.\n-- This returns a table with 3 fields:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient institutional claims.\n-- *************************************************\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\ncheck_for_merges_with_larger_row_num as (\nselect\n aa.patient_id,\n aa.claim_id as claim_id_a,\n bb.claim_id as claim_id_b,\n aa.row_num as row_num_a,\n bb.row_num as row_num_b,\n case\n -- Claims with same end_date and same facility_npi should be merged:\n when (aa.end_date = bb.end_date\n and aa.facility_npi = bb.facility_npi) then 1\n\n -- Claims with different end_date and start_date that are\n -- adjacent (i.e. separated by 1 day) should be merged:\n when ( \n\n dateadd(\n day,\n 1,\n aa.end_date\n )\n\n = bb.start_date\n and aa.facility_npi = bb.facility_npi\n\t and aa.discharge_disposition_code = '30') then 1\n\n -- Claims with different end_date \n -- should be merged if they overlap:\n when ( (aa.end_date <> bb.end_date) and \n (aa.end_date >= bb.start_date) and --overlap requirement\n (aa.facility_npi = bb.facility_npi)\n\t )then 1\n else 0\n end as merge_flag\nfrom add_row_num aa\n inner join add_row_num bb\n on aa.patient_id = bb.patient_id\n and aa.row_num < bb.row_num\n),\n\nmerges_with_larger_row_num as (\nselect\n patient_id,\n claim_id_a,\n claim_id_b,\n row_num_a,\n row_num_b,\n merge_flag\nfrom check_for_merges_with_larger_row_num\nwhere merge_flag = 1\n),\n\n\nclaim_ids_that_merge_with_larger_row_num as (\nselect distinct claim_id_a as claim_id\nfrom merges_with_larger_row_num\n),\n\n\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\nselect distinct aa.claim_id as claim_id\nfrom add_row_num aa\n inner join\n merges_with_larger_row_num bb\n on aa.patient_id = bb.patient_id\n and bb.row_num_a < aa.row_num\n and bb.row_num_b > aa.row_num\n),\n\n\nclose_flags as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.row_num,\n case when (bb.claim_id is null and cc.claim_id is null) then 1\n else 0\n end as close_flag\n\nfrom add_row_num aa\n\nleft join claim_ids_that_merge_with_larger_row_num bb\non aa.claim_id = bb.claim_id\n\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\non aa.claim_id = cc.claim_id\n),\n\n\njoin_every_row_to_later_closes as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.row_num as row_num,\n bb.row_num as row_num_b\nfrom close_flags aa inner join close_flags bb\n on aa.patient_id = bb.patient_id\n and aa.row_num <= bb.row_num\nwhere bb.close_flag = 1\n),\n\n\nfind_min_closing_row_num_for_every_claim as (\nselect\n patient_id,\n claim_id,\n min(row_num_b) as min_closing_row\nfrom join_every_row_to_later_closes\ngroup by patient_id, claim_id\n),\n\n\nadd_min_closing_row_to_every_claim as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n bb.min_closing_row as min_closing_row\nfrom close_flags aa\n left join find_min_closing_row_num_for_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.claim_id = bb.claim_id\n),\n\n\nadd_encounter_id as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n aa.min_closing_row as min_closing_row,\n bb.claim_id as encounter_id\nfrom add_min_closing_row_to_every_claim aa\n left join add_min_closing_row_to_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.min_closing_row = bb.row_num\n)\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__last_claim_values"], "alias": "_int_acute_inpatient_last_claim_values", "checksum": {"name": "sha256", "checksum": "718a965cebd0fb4a4c0f5c8e49931c8b7c6595a1bae02803c753efc9e7dce173"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_last_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.198424, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('acute_inpatient__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join __dbt__cte__acute_inpatient__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__professional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__professional_encounter_id"], "alias": "_int_acute_inpatient_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "b716ead5414e5010295289940ec23bca7fad99fb2edf1caf05c253c36f8c11ba"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.1838305, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns professional acute inpatient\r\n-- claims to acute inpatient encounters.\r\n-- Some acute inpatient professional claims do not fall\r\n-- within an acute inpatient encounter. We call these\r\n-- orphan claims, and they do not have an encounter_id.\r\n-- Some acute inpatient professional claims fall within\r\n-- more than one acute inpatient encounter. Since we do not\r\n-- know what encounter these claims should be mapped to\r\n-- we do not assign them an encounter_id. These claims\r\n-- have encounter_count > 1.\r\n-- This model returns a table with 5 fields:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id (is null for orphan claims or claims\r\n-- that fall within more than one encounter)\r\n-- orphan_claim_flag (is always 0 or 1)\r\n-- encounter_count (an integer that represents the number\r\n-- of acute inpatient encounters this\r\n-- professional claim could fall into:\r\n-- could be 0,1,2,3,... but is never null\r\n-- for acute inpatient professional claims)\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith acute_inpatient_professional_claim_ids as (\r\nselect distinct \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('acute_inpatient__stg_service_category') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\nacute_inpatient_professional_claim_lines as (\r\nselect\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.patient_id,\r\n mc.claim_start_date as start_date,\r\n mc.claim_end_date as end_date\t \r\nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\r\ninner join acute_inpatient_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nacute_inpatient_professional_claim_dates as (\r\nselect\r\n claim_id,\r\n claim_line_number,\r\n patient_id,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date\r\nfrom acute_inpatient_professional_claim_lines\r\ngroup by claim_id, claim_line_number, patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n bb.encounter_id,\r\n case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\nfrom acute_inpatient_professional_claim_dates aa\r\nleft join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date,\r\n count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_line_number, claim_id\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_acute_inpatient_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_acute_inpatient_professional_claims", "language": "sql", "refs": [{"name": "acute_inpatient__stg_service_category", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns professional acute inpatient\n-- claims to acute inpatient encounters.\n-- Some acute inpatient professional claims do not fall\n-- within an acute inpatient encounter. We call these\n-- orphan claims, and they do not have an encounter_id.\n-- Some acute inpatient professional claims fall within\n-- more than one acute inpatient encounter. Since we do not\n-- know what encounter these claims should be mapped to\n-- we do not assign them an encounter_id. These claims\n-- have encounter_count > 1.\n-- This model returns a table with 5 fields:\n-- patient_id\n-- claim_id\n-- encounter_id (is null for orphan claims or claims\n-- that fall within more than one encounter)\n-- orphan_claim_flag (is always 0 or 1)\n-- encounter_count (an integer that represents the number\n-- of acute inpatient encounters this\n-- professional claim could fall into:\n-- could be 0,1,2,3,... but is never null\n-- for acute inpatient professional claims)\n-- *************************************************\n\n\n\n\nwith __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n), __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),acute_inpatient_professional_claim_ids as (\nselect distinct \n claim_id\n , claim_line_number\nfrom __dbt__cte__acute_inpatient__stg_service_category \nwhere claim_type = 'professional'\n and service_category_2 = 'Acute Inpatient'\n),\n\nacute_inpatient_professional_claim_lines as (\nselect\n mc.claim_id,\n mc.claim_line_number,\n mc.patient_id,\n mc.claim_start_date as start_date,\n mc.claim_end_date as end_date\t \nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join acute_inpatient_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\n claim_line_number,\n patient_id,\n min(start_date) as start_date,\n max(end_date) as end_date\nfrom acute_inpatient_professional_claim_lines\ngroup by claim_id, claim_line_number, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n bb.encounter_id,\n case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\nfrom acute_inpatient_professional_claim_dates aa\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n min(start_date) as start_date,\n max(end_date) as end_date,\n count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_line_number, claim_id\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_acute_inpatient_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom all_acute_inpatient_professional_claims", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_eligibility"], "alias": "acute_inpatient__stg_eligibility", "checksum": {"name": "sha256", "checksum": "8ea3cc5c41ed888f9eb8efd0e440f74e67e7b33dd4969c4267f859b5abb3909c"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_eligibility", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2005196, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_medical_claim"], "alias": "acute_inpatient__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "d56bfd67210f050492eb94d5324158b86000e550d4e6d69848d578e691130f0c"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_medical_claim", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.202523, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , claim_type\r\n , claim_start_date\r\n , claim_end_date\r\n , admission_date\r\n , discharge_date\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_service_category": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category"], "alias": "acute_inpatient__stg_service_category", "checksum": {"name": "sha256", "checksum": "a1155be311fc6b6f364f6c5baec9b3195835afc5d81fb895ab4c3a996f08ad09"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_service_category", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_service_category", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2045217, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\r\n, claim_line_number\r\n, service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "refs": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "unique_id": "model.the_tuva_project.emergency_department__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "final", "emergency_department__summary"], "alias": "emergency_department_summary", "checksum": {"name": "sha256", "checksum": "38032361837dc54cd177da94ad9d8631951c349f763df55304038ffe78ecaa73"}, "config": {"enabled": true, "alias": "emergency_department_summary", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "emergency_department_summary", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.216788, "relation_name": "dev_thuxuan.claims_preprocessing.emergency_department_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith distinct_encounters as (\r\nselect distinct\r\n a.encounter_id\r\n, a.patient_id\r\n, b.encounter_start_date\r\n, b.encounter_end_date\r\nfrom {{ ref('emergency_department__int_encounter_id') }} a\r\ninner join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('emergency_department__int_first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('emergency_department__int_last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\nselect\r\n b.encounter_id\r\n, sum(paid_amount) as prof_paid_amount\r\n, sum(allowed_amount) as prof_allowed_amount\r\n, sum(charge_amount) as prof_charge_amount\r\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\nselect distinct\r\n patient_id\r\n, birth_date\r\n, gender\r\n, race\r\nfrom {{ ref('eligibility') }}\r\n)\r\n\r\n, provider as (\r\nselect\r\n a.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, b.provider_first_name\r\n, b.provider_last_name\r\n, count(distinct facility_npi) as npi_count\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} a\r\nleft join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\ngroup by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n , a.encounter_start_date\r\n , a.encounter_end_date\r\n , a.patient_id\r\n , {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n , e.gender\r\n , e.race\r\n , c.diagnosis_code_type as primary_diagnosis_code_type\r\n , c.diagnosis_code_1 as primary_diagnosis_code\r\n , coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\r\n , f.facility_npi\r\n , f.provider_first_name\r\n , f.provider_last_name\r\n , c.ms_drg_code\r\n , j.ms_drg_description\r\n , j.medical_surgical\r\n , c.apr_drg_code\r\n , k.apr_drg_description\r\n , c.admit_source_code\r\n , h.admit_source_description\r\n , c.admit_type_code\r\n , i.admit_type_description\r\n , c.discharge_disposition_code\r\n , g.discharge_disposition_description\r\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n , {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n , case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_first_claim_values", "package": null, "version": null}, {"name": "emergency_department__int_last_claim_values", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.eligibility", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "compiled": true, "compiled_code": "\n\nwith distinct_encounters as (\nselect distinct\n a.encounter_id\n, a.patient_id\n, b.encounter_start_date\n, b.encounter_end_date\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id a\ninner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\nselect\n b.encounter_id\n, sum(paid_amount) as prof_paid_amount\n, sum(allowed_amount) as prof_allowed_amount\n, sum(charge_amount) as prof_charge_amount\nfrom tuva.input_layer.medical_claim a\ninner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\nselect distinct\n patient_id\n, birth_date\n, gender\n, race\nfrom tuva.input_layer.eligibility\n)\n\n, provider as (\nselect\n a.encounter_id\n, max(a.facility_npi) as facility_npi\n, b.provider_first_name\n, b.provider_last_name\n, count(distinct facility_npi) as npi_count\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id a\nleft join dev_thuxuan.terminology.provider b\n on a.facility_npi = b.npi\ngroup by 1,3,4\n)\n\nselect\n a.encounter_id\n , a.encounter_start_date\n , a.encounter_end_date\n , a.patient_id\n , datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n , e.gender\n , e.race\n , c.diagnosis_code_type as primary_diagnosis_code_type\n , c.diagnosis_code_1 as primary_diagnosis_code\n , coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\n , f.facility_npi\n , f.provider_first_name\n , f.provider_last_name\n , c.ms_drg_code\n , j.ms_drg_description\n , j.medical_surgical\n , c.apr_drg_code\n , k.apr_drg_description\n , c.admit_source_code\n , h.admit_source_description\n , c.admit_type_code\n , i.admit_type_description\n , c.discharge_disposition_code\n , g.discharge_disposition_description\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n , datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n , case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom distinct_encounters a\nleft join institutional_claim_details c\n on a.encounter_id = c.encounter_id\nleft join professional_claim_details d\n on a.encounter_id = d.encounter_id\nleft join patient e\n on a.patient_id = e.patient_id\nleft join provider f\n on a.encounter_id = f.encounter_id\nleft join dev_thuxuan.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join dev_thuxuan.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join dev_thuxuan.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join dev_thuxuan.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join dev_thuxuan.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_id"], "alias": "_int_emergency_department_encounter_id", "checksum": {"name": "sha256", "checksum": "c0da17d4d9bba71141dded7bde3f6526a4b912aa332e6a76a58c4eb2f6c55a50"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2198107, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} inst\r\nleft join {{ ref('emergency_department__stg_medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__int_professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id inst\nleft join __dbt__cte__emergency_department__stg_medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_start_and_end_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_start_and_end_dates"], "alias": "_int_emergency_department_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "63e6cb67b07f7f259b4abb0475a8414cd8e52181a89c82f391e1424402c5cae5"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Defines encounter start and end dates for emergency_department encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_start_and_end_dates", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2224905, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith add_encounter_id_to_emergency_department_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('emergency_department__int_institutional_claims') }} aip\r\nleft join {{ ref('emergency_department__int_institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_emergency_department_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect \r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\r\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_claims", "package": null, "version": null}, {"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n\nwith add_encounter_id_to_emergency_department_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims aip\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_emergency_department_encounters\ngroup by patient_id, encounter_id\n)\n\nselect \n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_first_claim_values"], "alias": "_int_emergency_department_first_claim_values", "checksum": {"name": "sha256", "checksum": "097b5828d393facda2ee2f01b8c5c39e72338c8b35e3b32d1db5c2c52a1cecd0"}, "config": {"enabled": true, "alias": "_int_emergency_department_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_first_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2254949, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('emergency_department__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id e\n inner join __dbt__cte__emergency_department__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_claims"], "alias": "_int_emergency_department_institutional_claims", "checksum": {"name": "sha256", "checksum": "b782e9ffb8cfbb5dbe444291364c94d3e3e0e11f854f1169a4794439d17c5095"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "All emergency_department institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_claims", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2284892, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith emergency_department_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('emergency_department__stg_medical_claim') }} mc\r\ninner join {{ ref('emergency_department__stg_service_category')}} sc\r\n on mc.claim_id = sc.claim_id\r\nwhere mc.claim_type = 'institutional'\r\n and sc.service_category_2 = 'Emergency Department'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [{"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__stg_service_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n),emergency_department_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom __dbt__cte__emergency_department__stg_medical_claim mc\ninner join __dbt__cte__emergency_department__stg_service_category sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Emergency Department'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom emergency_department_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom emergency_department_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n\nfrom header_level_values h\nleft join data_quality_flags dq\n on h.claim_id = dq.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.emergency_department__stg_service_category", "sql": " __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_encounter_id"], "alias": "_int_emergency_department_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "be89cc93df22e01f04c5e8e3e31be246b28d5955e104252e562343534b3ea2c6"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department institutional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.23149, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('emergency_department__int_institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims\n),\n\ncheck_for_merges_with_larger_row_num as (\nselect\n aa.patient_id,\n aa.claim_id as claim_id_a,\n bb.claim_id as claim_id_b,\n aa.row_num as row_num_a,\n bb.row_num as row_num_b,\n case\n -- Claims with same end_date and same facility_npi should be merged:\n when (aa.end_date = bb.end_date\n and aa.facility_npi = bb.facility_npi) then 1\n -- Claims with different end_date \n -- should be merged if they overlap:\n when ( (aa.end_date <> bb.end_date) and \n (aa.end_date >= bb.start_date) and --overlap requirement\n (aa.facility_npi = bb.facility_npi)\n\t )then 1\n else 0\n end as merge_flag\nfrom add_row_num aa\n inner join add_row_num bb\n on aa.patient_id = bb.patient_id\n and aa.row_num < bb.row_num\n),\n\nmerges_with_larger_row_num as (\nselect\n patient_id,\n claim_id_a,\n claim_id_b,\n row_num_a,\n row_num_b,\n merge_flag\nfrom check_for_merges_with_larger_row_num\nwhere merge_flag = 1\n),\n\n\nclaim_ids_that_merge_with_larger_row_num as (\nselect distinct claim_id_a as claim_id\nfrom merges_with_larger_row_num\n),\n\n\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\nselect distinct aa.claim_id as claim_id\nfrom add_row_num aa\n inner join\n merges_with_larger_row_num bb\n on aa.patient_id = bb.patient_id\n and bb.row_num_a < aa.row_num\n and bb.row_num_b > aa.row_num\n),\n\n\nclose_flags as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.row_num,\n case when (bb.claim_id is null and cc.claim_id is null) then 1\n else 0\n end as close_flag\n\nfrom add_row_num aa\n\nleft join claim_ids_that_merge_with_larger_row_num bb\non aa.claim_id = bb.claim_id\n\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\non aa.claim_id = cc.claim_id\n),\n\n\njoin_every_row_to_later_closes as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.row_num as row_num,\n bb.row_num as row_num_b\nfrom close_flags aa inner join close_flags bb\n on aa.patient_id = bb.patient_id\n and aa.row_num <= bb.row_num\nwhere bb.close_flag = 1\n),\n\n\nfind_min_closing_row_num_for_every_claim as (\nselect\n patient_id,\n claim_id,\n min(row_num_b) as min_closing_row\nfrom join_every_row_to_later_closes\ngroup by patient_id, claim_id\n),\n\n\nadd_min_closing_row_to_every_claim as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n bb.min_closing_row as min_closing_row\nfrom close_flags aa\n left join find_min_closing_row_num_for_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.claim_id = bb.claim_id\n),\n\n\nadd_encounter_id as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n aa.min_closing_row as min_closing_row,\n bb.claim_id as encounter_id\nfrom add_min_closing_row_to_every_claim aa\n left join add_min_closing_row_to_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.min_closing_row = bb.row_num\n)\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_last_claim_values"], "alias": "_int_emergency_department_last_claim_values", "checksum": {"name": "sha256", "checksum": "cdcac307509e32aa888cb1e58695612ac6662adfcba02c437da3ebc21fc98728"}, "config": {"enabled": true, "alias": "_int_emergency_department_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (discharge disposition, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_last_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2372007, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('emergency_department__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id e\n inner join __dbt__cte__emergency_department__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_professional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_professional_encounter_id"], "alias": "_int_emergency_department_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "23eae8edab63adc6216c2326a32f50d69e54d18ae92541e5ad76659ce1faeb12"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department professional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.234197, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_professional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith emergency_department_professional_claim_ids as (\r\nselect \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('emergency_department__stg_service_category') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Emergency Department'\r\n),\r\n\r\nemergency_department_professional_claim_lines as (\r\nselect\r\n mc.claim_id\r\n , mc.claim_line_number\r\n , mc.patient_id\r\n , mc.claim_start_date as start_date\r\n , mc.claim_end_date as end_date\t \r\nfrom {{ ref('emergency_department__stg_medical_claim') }} mc\r\ninner join emergency_department_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nemergency_department_professional_claim_dates as (\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\nfrom emergency_department_professional_claim_lines\r\ngroup by \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\n select\r\n aa.patient_id\r\n , aa.claim_id\r\n , aa.claim_line_number\r\n , aa.start_date\r\n , aa.end_date\r\n , bb.encounter_id\r\n , case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\n from emergency_department_professional_claim_dates aa\r\n left join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\n , count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_id, claim_line_number\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_emergency_department_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_emergency_department_professional_claims", "language": "sql", "refs": [{"name": "emergency_department__stg_service_category", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__stg_service_category", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n), __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),emergency_department_professional_claim_ids as (\nselect \n claim_id\n , claim_line_number\nfrom __dbt__cte__emergency_department__stg_service_category \nwhere claim_type = 'professional'\n and service_category_2 = 'Emergency Department'\n),\n\nemergency_department_professional_claim_lines as (\nselect\n mc.claim_id\n , mc.claim_line_number\n , mc.patient_id\n , mc.claim_start_date as start_date\n , mc.claim_end_date as end_date\t \nfrom __dbt__cte__emergency_department__stg_medical_claim mc\ninner join emergency_department_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nemergency_department_professional_claim_dates as (\nselect\n claim_id\n , claim_line_number\n , patient_id\n , min(start_date) as start_date\n , max(end_date) as end_date\nfrom emergency_department_professional_claim_lines\ngroup by \n claim_id\n , claim_line_number\n , patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\n select\n aa.patient_id\n , aa.claim_id\n , aa.claim_line_number\n , aa.start_date\n , aa.end_date\n , bb.encounter_id\n , case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\n from emergency_department_professional_claim_dates aa\n left join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id\n , claim_id\n , claim_line_number\n , min(start_date) as start_date\n , max(end_date) as end_date\n , count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_id, claim_line_number\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_emergency_department_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom all_emergency_department_professional_claims", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_service_category", "sql": " __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}, {"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_eligibility"], "alias": "emergency_department__stg_eligibility", "checksum": {"name": "sha256", "checksum": "ceb2bdec3e0b46fb8c63d40d7bcbee052bd6475870be65545bffe8bb480c1fec"}, "config": {"enabled": true, "alias": "emergency_department__stg_eligibility", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_eligibility", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2392244, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_medical_claim"], "alias": "emergency_department__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "67ad20964677e6cb8dd410b85642938bcb60c12291002e5d7f7a12eba87f19e8"}, "config": {"enabled": true, "alias": "emergency_department__stg_medical_claim", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_medical_claim", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2411993, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , claim_type\r\n , claim_start_date\r\n , claim_end_date\r\n , admission_date\r\n , discharge_date\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_service_category": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_service_category", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_service_category"], "alias": "emergency_department__stg_service_category", "checksum": {"name": "sha256", "checksum": "105b5186427b29374ee4c199260f7b53e255ff14deb730a79942e66b4ae6cc40"}, "config": {"enabled": true, "alias": "emergency_department__stg_service_category", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_service_category", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2441983, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_type\r\n , claim_line_number\r\n , service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "refs": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__eligibility": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "unique_id": "model.the_tuva_project.normalized_input__eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__eligibility"], "alias": "normalized_input_eligibility", "checksum": {"name": "sha256", "checksum": "dd1a750618a90eb4478ad0b5362f71b6d2545fc829565dc20947de2197218b9c"}, "config": {"enabled": true, "alias": "normalized_input_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The eligibility table contains information on patient health plan and \nsupplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_eligibility", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.36046, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(elig.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(elig.member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(elig.subscriber_id as {{ dbt.type_string() }} ) as subscriber_id\r\n , cast(elig.gender as {{ dbt.type_string() }} ) as gender\r\n , cast(elig.race as {{ dbt.type_string() }} ) as race\r\n , cast(date_norm.normalized_birth_date as date ) as birth_date\r\n , cast(date_norm.normalized_death_date as date ) as death_date\r\n , cast(elig.death_flag as int ) as death_flag\r\n , cast(date_norm.normalized_enrollment_start_date as date ) as enrollment_start_date\r\n , cast(date_norm.normalized_enrollment_end_date as date ) as enrollment_end_date\r\n , cast(elig.payer as {{ dbt.type_string() }} ) as payer\r\n , cast(elig.payer_type as {{ dbt.type_string() }} ) as payer_type\r\n , cast(elig.plan as {{ dbt.type_string() }} ) as plan\r\n , cast(elig.original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\r\n , cast(elig.dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\r\n , cast(elig.medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\r\n , cast(elig.first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(elig.last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(elig.social_security_number as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(elig.subscriber_relation as {{ dbt.type_string() }} ) as subscriber_relation\r\n , cast(elig.address as {{ dbt.type_string() }} ) as address\r\n , cast(elig.city as {{ dbt.type_string() }} ) as city\r\n , cast(elig.state as {{ dbt.type_string() }} ) as state\r\n , cast(elig.zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(elig.phone as {{ dbt.type_string() }} ) as phone\r\n , cast(elig.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_eligibility') }} elig\r\nleft join {{ ref('normalized_input__int_eligibility_dates_normalize') }} date_norm\r\n on elig.patient_id_key = date_norm.patient_id_key", "language": "sql", "refs": [{"name": "normalized_input__stg_eligibility", "package": null, "version": null}, {"name": "normalized_input__int_eligibility_dates_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__stg_eligibility", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)select\n cast(elig.patient_id as TEXT ) as patient_id\n , cast(elig.member_id as TEXT ) as member_id\n , cast(elig.subscriber_id as TEXT ) as subscriber_id\n , cast(elig.gender as TEXT ) as gender\n , cast(elig.race as TEXT ) as race\n , cast(date_norm.normalized_birth_date as date ) as birth_date\n , cast(date_norm.normalized_death_date as date ) as death_date\n , cast(elig.death_flag as int ) as death_flag\n , cast(date_norm.normalized_enrollment_start_date as date ) as enrollment_start_date\n , cast(date_norm.normalized_enrollment_end_date as date ) as enrollment_end_date\n , cast(elig.payer as TEXT ) as payer\n , cast(elig.payer_type as TEXT ) as payer_type\n , cast(elig.plan as TEXT ) as plan\n , cast(elig.original_reason_entitlement_code as TEXT ) as original_reason_entitlement_code\n , cast(elig.dual_status_code as TEXT ) as dual_status_code\n , cast(elig.medicare_status_code as TEXT ) as medicare_status_code\n , cast(elig.first_name as TEXT ) as first_name\n , cast(elig.last_name as TEXT ) as last_name\n , cast(elig.social_security_number as TEXT ) as social_security_number\n , cast(elig.subscriber_relation as TEXT ) as subscriber_relation\n , cast(elig.address as TEXT ) as address\n , cast(elig.city as TEXT ) as city\n , cast(elig.state as TEXT ) as state\n , cast(elig.zip_code as TEXT ) as zip_code\n , cast(elig.phone as TEXT ) as phone\n , cast(elig.data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_eligibility elig\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_eligibility_dates_normalize date_norm\n on elig.patient_id_key = date_norm.patient_id_key", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_eligibility", "sql": " __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__medical_claim": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__medical_claim"], "alias": "normalized_input_medical_claim", "checksum": {"name": "sha256", "checksum": "df62308dfe919d72c9b017de1aeeb02c7051fd9d6c78a78a81c5a8981be4b2c5"}, "config": {"enabled": true, "alias": "normalized_input_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The medical claim table contains information on services rendered to \npatients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_medical_claim", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3771396, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n\tcast(med.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n\t, cast(med.claim_line_number as int ) as claim_line_number\r\n\t, cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\r\n\t, cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n\t, cast(med.member_id as {{ dbt.type_string() }} ) as member_id\r\n\t, cast(med.payer as {{ dbt.type_string() }} ) as payer\r\n\t, cast(med.plan as {{ dbt.type_string() }} ) as plan\r\n\t, cast(coalesce(dates.minimum_claim_start_date, undetermined.claim_start_date) as date ) as claim_start_date\r\n\t, cast(coalesce(dates.maximum_claim_end_date, undetermined.claim_start_date) as date ) as claim_end_date\r\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_start_date, undetermined.claim_line_start_date) as date ) as claim_line_start_date\r\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_end_date, undetermined.claim_line_end_date) as date ) as claim_line_end_date\r\n\t, cast(coalesce(dates.minimum_admission_date, undetermined.admission_date) as date ) as admission_date\r\n\t, cast(coalesce(dates.maximum_discharge_date, undetermined.discharge_date) as date ) as discharge_date\r\n\t, cast(coalesce(ad_source.normalized_code, undetermined.admit_source_code) as {{ dbt.type_string() }} ) as admit_source_code\r\n\t, cast(coalesce(ad_type.normalized_code, undetermined.admit_type_code) as {{ dbt.type_string() }} ) as admit_type_code\r\n\t, cast(coalesce(disch_disp.normalized_code, undetermined.discharge_disposition_code) as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n\t, cast(coalesce(pos.normalized_code, undetermined.place_of_service_code) as {{ dbt.type_string() }} ) as place_of_service_code\r\n\t, cast(coalesce(bill.normalized_code, undetermined.bill_type_code) as {{ dbt.type_string() }} ) as bill_type_code\r\n\t, cast(coalesce(ms.normalized_code, undetermined.ms_drg_code) as {{ dbt.type_string() }} ) as ms_drg_code\r\n\t, cast(coalesce(apr.normalized_code, undetermined.apr_drg_code) as {{ dbt.type_string() }} ) as apr_drg_code\r\n\t, cast(coalesce(rev.normalized_code, undetermined.revenue_center_code) as {{ dbt.type_string() }} ) as revenue_center_code\r\n\t, cast(med.service_unit_quantity as {{ dbt.type_string() }} ) as service_unit_quantity\r\n\t, cast(med.hcpcs_code as {{ dbt.type_string() }} ) as hcpcs_code\r\n\t, cast(med.hcpcs_modifier_1 as {{ dbt.type_string() }} ) as hcpcs_modifier_1\r\n\t, cast(med.hcpcs_modifier_2 as {{ dbt.type_string() }} ) as hcpcs_modifier_2\r\n\t, cast(med.hcpcs_modifier_3 as {{ dbt.type_string() }} ) as hcpcs_modifier_3\r\n\t, cast(med.hcpcs_modifier_4 as {{ dbt.type_string() }} ) as hcpcs_modifier_4\r\n\t, cast(med.hcpcs_modifier_5 as {{ dbt.type_string() }} ) as hcpcs_modifier_5\r\n\t, cast(coalesce(med_npi.normalized_rendering_npi, undetermined.rendering_npi) as {{ dbt.type_string() }} ) as rendering_npi\r\n\t, cast(coalesce(med_npi.normalized_billing_npi, undetermined.billing_npi) as {{ dbt.type_string() }} ) as billing_npi\r\n\t, cast(coalesce(med_npi.normalized_facility_npi, undetermined.facility_npi) as {{ dbt.type_string() }} ) as facility_npi\r\n\t, cast(med.paid_date as date ) as paid_date\r\n\t, cast(med.paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n\t, cast(med.allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n\t, cast(med.charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n\t, cast(med.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n\t, cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n\t, cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n\t, cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\r\n\t, cast(med.diagnosis_code_type as {{ dbt.type_string() }} ) as diagnosis_code_type\r\n\t, cast(coalesce(dx_code.diagnosis_code_1, undetermined.diagnosis_code_1) as {{ dbt.type_string() }} ) as diagnosis_code_1\r\n\t, cast(coalesce(dx_code.diagnosis_code_2, undetermined.diagnosis_code_2) as {{ dbt.type_string() }} ) as diagnosis_code_2\r\n\t, cast(coalesce(dx_code.diagnosis_code_3, undetermined.diagnosis_code_3) as {{ dbt.type_string() }} ) as diagnosis_code_3\r\n\t, cast(coalesce(dx_code.diagnosis_code_4, undetermined.diagnosis_code_4) as {{ dbt.type_string() }} ) as diagnosis_code_4\r\n\t, cast(coalesce(dx_code.diagnosis_code_5, undetermined.diagnosis_code_5) as {{ dbt.type_string() }} ) as diagnosis_code_5\r\n\t, cast(coalesce(dx_code.diagnosis_code_6, undetermined.diagnosis_code_6) as {{ dbt.type_string() }} ) as diagnosis_code_6\r\n\t, cast(coalesce(dx_code.diagnosis_code_7, undetermined.diagnosis_code_7) as {{ dbt.type_string() }} ) as diagnosis_code_7\r\n\t, cast(coalesce(dx_code.diagnosis_code_8, undetermined.diagnosis_code_8) as {{ dbt.type_string() }} ) as diagnosis_code_8\r\n\t, cast(coalesce(dx_code.diagnosis_code_9, undetermined.diagnosis_code_9) as {{ dbt.type_string() }} ) as diagnosis_code_9\r\n\t, cast(coalesce(dx_code.diagnosis_code_10, undetermined.diagnosis_code_10) as {{ dbt.type_string() }} ) as diagnosis_code_10\r\n\t, cast(coalesce(dx_code.diagnosis_code_11, undetermined.diagnosis_code_11) as {{ dbt.type_string() }} ) as diagnosis_code_11\r\n\t, cast(coalesce(dx_code.diagnosis_code_12, undetermined.diagnosis_code_12) as {{ dbt.type_string() }} ) as diagnosis_code_12\r\n\t, cast(coalesce(dx_code.diagnosis_code_13, undetermined.diagnosis_code_13) as {{ dbt.type_string() }} ) as diagnosis_code_13\r\n\t, cast(coalesce(dx_code.diagnosis_code_14, undetermined.diagnosis_code_14) as {{ dbt.type_string() }} ) as diagnosis_code_14\r\n\t, cast(coalesce(dx_code.diagnosis_code_15, undetermined.diagnosis_code_15) as {{ dbt.type_string() }} ) as diagnosis_code_15\r\n\t, cast(coalesce(dx_code.diagnosis_code_16, undetermined.diagnosis_code_16) as {{ dbt.type_string() }} ) as diagnosis_code_16\r\n\t, cast(coalesce(dx_code.diagnosis_code_17, undetermined.diagnosis_code_17) as {{ dbt.type_string() }} ) as diagnosis_code_17\r\n\t, cast(coalesce(dx_code.diagnosis_code_18, undetermined.diagnosis_code_18) as {{ dbt.type_string() }} ) as diagnosis_code_18\r\n\t, cast(coalesce(dx_code.diagnosis_code_19, undetermined.diagnosis_code_19) as {{ dbt.type_string() }} ) as diagnosis_code_19\r\n\t, cast(coalesce(dx_code.diagnosis_code_20, undetermined.diagnosis_code_20) as {{ dbt.type_string() }} ) as diagnosis_code_20\r\n\t, cast(coalesce(dx_code.diagnosis_code_21, undetermined.diagnosis_code_21) as {{ dbt.type_string() }} ) as diagnosis_code_21\r\n\t, cast(coalesce(dx_code.diagnosis_code_22, undetermined.diagnosis_code_22) as {{ dbt.type_string() }} ) as diagnosis_code_22\r\n\t, cast(coalesce(dx_code.diagnosis_code_23, undetermined.diagnosis_code_23) as {{ dbt.type_string() }} ) as diagnosis_code_23\r\n\t, cast(coalesce(dx_code.diagnosis_code_24, undetermined.diagnosis_code_24) as {{ dbt.type_string() }} ) as diagnosis_code_24\r\n\t, cast(coalesce(dx_code.diagnosis_code_25, undetermined.diagnosis_code_25) as {{ dbt.type_string() }} ) as diagnosis_code_25\r\n\t, cast(coalesce(poa.diagnosis_poa_1, undetermined.diagnosis_poa_1) as {{ dbt.type_string() }} ) as diagnosis_poa_1\r\n\t, cast(coalesce(poa.diagnosis_poa_2, undetermined.diagnosis_poa_2) as {{ dbt.type_string() }} ) as diagnosis_poa_2\r\n\t, cast(coalesce(poa.diagnosis_poa_3, undetermined.diagnosis_poa_3) as {{ dbt.type_string() }} ) as diagnosis_poa_3\r\n\t, cast(coalesce(poa.diagnosis_poa_4, undetermined.diagnosis_poa_4) as {{ dbt.type_string() }} ) as diagnosis_poa_4\r\n\t, cast(coalesce(poa.diagnosis_poa_5, undetermined.diagnosis_poa_5) as {{ dbt.type_string() }} ) as diagnosis_poa_5\r\n\t, cast(coalesce(poa.diagnosis_poa_6, undetermined.diagnosis_poa_6) as {{ dbt.type_string() }} ) as diagnosis_poa_6\r\n\t, cast(coalesce(poa.diagnosis_poa_7, undetermined.diagnosis_poa_7) as {{ dbt.type_string() }} ) as diagnosis_poa_7\r\n\t, cast(coalesce(poa.diagnosis_poa_8, undetermined.diagnosis_poa_8) as {{ dbt.type_string() }} ) as diagnosis_poa_8\r\n\t, cast(coalesce(poa.diagnosis_poa_9, undetermined.diagnosis_poa_9) as {{ dbt.type_string() }} ) as diagnosis_poa_9\r\n\t, cast(coalesce(poa.diagnosis_poa_10, undetermined.diagnosis_poa_10) as {{ dbt.type_string() }} ) as diagnosis_poa_10\r\n\t, cast(coalesce(poa.diagnosis_poa_11, undetermined.diagnosis_poa_11) as {{ dbt.type_string() }} ) as diagnosis_poa_11\r\n\t, cast(coalesce(poa.diagnosis_poa_12, undetermined.diagnosis_poa_12) as {{ dbt.type_string() }} ) as diagnosis_poa_12\r\n\t, cast(coalesce(poa.diagnosis_poa_13, undetermined.diagnosis_poa_13) as {{ dbt.type_string() }} ) as diagnosis_poa_13\r\n\t, cast(coalesce(poa.diagnosis_poa_14, undetermined.diagnosis_poa_14) as {{ dbt.type_string() }} ) as diagnosis_poa_14\r\n\t, cast(coalesce(poa.diagnosis_poa_15, undetermined.diagnosis_poa_15) as {{ dbt.type_string() }} ) as diagnosis_poa_15\r\n\t, cast(coalesce(poa.diagnosis_poa_16, undetermined.diagnosis_poa_16) as {{ dbt.type_string() }} ) as diagnosis_poa_16\r\n\t, cast(coalesce(poa.diagnosis_poa_17, undetermined.diagnosis_poa_17) as {{ dbt.type_string() }} ) as diagnosis_poa_17\r\n\t, cast(coalesce(poa.diagnosis_poa_18, undetermined.diagnosis_poa_18) as {{ dbt.type_string() }} ) as diagnosis_poa_18\r\n\t, cast(coalesce(poa.diagnosis_poa_19, undetermined.diagnosis_poa_19) as {{ dbt.type_string() }} ) as diagnosis_poa_19\r\n\t, cast(coalesce(poa.diagnosis_poa_20, undetermined.diagnosis_poa_20) as {{ dbt.type_string() }} ) as diagnosis_poa_20\r\n\t, cast(coalesce(poa.diagnosis_poa_21, undetermined.diagnosis_poa_21) as {{ dbt.type_string() }} ) as diagnosis_poa_21\r\n\t, cast(coalesce(poa.diagnosis_poa_22, undetermined.diagnosis_poa_22) as {{ dbt.type_string() }} ) as diagnosis_poa_22\r\n\t, cast(coalesce(poa.diagnosis_poa_23, undetermined.diagnosis_poa_23) as {{ dbt.type_string() }} ) as diagnosis_poa_23\r\n\t, cast(coalesce(poa.diagnosis_poa_24, undetermined.diagnosis_poa_24) as {{ dbt.type_string() }} ) as diagnosis_poa_24\r\n\t, cast(coalesce(poa.diagnosis_poa_25, undetermined.diagnosis_poa_25) as {{ dbt.type_string() }} ) as diagnosis_poa_25\r\n\t, cast(med.procedure_code_type as {{ dbt.type_string() }} ) as procedure_code_type\r\n\t, cast(coalesce(px_code.procedure_code_1, undetermined.procedure_code_1) as {{ dbt.type_string() }} ) as procedure_code_1\r\n\t, cast(coalesce(px_code.procedure_code_2, undetermined.procedure_code_2) as {{ dbt.type_string() }} ) as procedure_code_2\r\n\t, cast(coalesce(px_code.procedure_code_3, undetermined.procedure_code_3) as {{ dbt.type_string() }} ) as procedure_code_3\r\n\t, cast(coalesce(px_code.procedure_code_4, undetermined.procedure_code_4) as {{ dbt.type_string() }} ) as procedure_code_4\r\n\t, cast(coalesce(px_code.procedure_code_5, undetermined.procedure_code_5) as {{ dbt.type_string() }} ) as procedure_code_5\r\n\t, cast(coalesce(px_code.procedure_code_6, undetermined.procedure_code_6) as {{ dbt.type_string() }} ) as procedure_code_6\r\n\t, cast(coalesce(px_code.procedure_code_7, undetermined.procedure_code_7) as {{ dbt.type_string() }} ) as procedure_code_7\r\n\t, cast(coalesce(px_code.procedure_code_8, undetermined.procedure_code_8) as {{ dbt.type_string() }} ) as procedure_code_8\r\n\t, cast(coalesce(px_code.procedure_code_9, undetermined.procedure_code_9) as {{ dbt.type_string() }} ) as procedure_code_9\r\n\t, cast(coalesce(px_code.procedure_code_10, undetermined.procedure_code_10) as {{ dbt.type_string() }} ) as procedure_code_10\r\n\t, cast(coalesce(px_code.procedure_code_11, undetermined.procedure_code_11) as {{ dbt.type_string() }} ) as procedure_code_11\r\n\t, cast(coalesce(px_code.procedure_code_12, undetermined.procedure_code_12) as {{ dbt.type_string() }} ) as procedure_code_12\r\n\t, cast(coalesce(px_code.procedure_code_13, undetermined.procedure_code_13) as {{ dbt.type_string() }} ) as procedure_code_13\r\n\t, cast(coalesce(px_code.procedure_code_14, undetermined.procedure_code_14) as {{ dbt.type_string() }} ) as procedure_code_14\r\n\t, cast(coalesce(px_code.procedure_code_15, undetermined.procedure_code_15) as {{ dbt.type_string() }} ) as procedure_code_15\r\n\t, cast(coalesce(px_code.procedure_code_16, undetermined.procedure_code_16) as {{ dbt.type_string() }} ) as procedure_code_16\r\n\t, cast(coalesce(px_code.procedure_code_17, undetermined.procedure_code_17) as {{ dbt.type_string() }} ) as procedure_code_17\r\n\t, cast(coalesce(px_code.procedure_code_18, undetermined.procedure_code_18) as {{ dbt.type_string() }} ) as procedure_code_18\r\n\t, cast(coalesce(px_code.procedure_code_19, undetermined.procedure_code_19) as {{ dbt.type_string() }} ) as procedure_code_19\r\n\t, cast(coalesce(px_code.procedure_code_20, undetermined.procedure_code_20) as {{ dbt.type_string() }} ) as procedure_code_20\r\n\t, cast(coalesce(px_code.procedure_code_21, undetermined.procedure_code_21) as {{ dbt.type_string() }} ) as procedure_code_21\r\n\t, cast(coalesce(px_code.procedure_code_22, undetermined.procedure_code_22) as {{ dbt.type_string() }} ) as procedure_code_22\r\n\t, cast(coalesce(px_code.procedure_code_23, undetermined.procedure_code_23) as {{ dbt.type_string() }} ) as procedure_code_23\r\n\t, cast(coalesce(px_code.procedure_code_24, undetermined.procedure_code_24) as {{ dbt.type_string() }} ) as procedure_code_24\r\n\t, cast(coalesce(px_code.procedure_code_25, undetermined.procedure_code_25) as {{ dbt.type_string() }} ) as procedure_code_25\r\n\t, cast(coalesce(px_date.procedure_date_1, undetermined.procedure_date_1) as date ) as procedure_date_1\r\n\t, cast(coalesce(px_date.procedure_date_2, undetermined.procedure_date_2) as date ) as procedure_date_2\r\n\t, cast(coalesce(px_date.procedure_date_3, undetermined.procedure_date_3) as date ) as procedure_date_3\r\n\t, cast(coalesce(px_date.procedure_date_4, undetermined.procedure_date_4) as date ) as procedure_date_4\r\n\t, cast(coalesce(px_date.procedure_date_5, undetermined.procedure_date_5) as date ) as procedure_date_5\r\n\t, cast(coalesce(px_date.procedure_date_6, undetermined.procedure_date_6) as date ) as procedure_date_6\r\n\t, cast(coalesce(px_date.procedure_date_7, undetermined.procedure_date_7) as date ) as procedure_date_7\r\n\t, cast(coalesce(px_date.procedure_date_8, undetermined.procedure_date_8) as date ) as procedure_date_8\r\n\t, cast(coalesce(px_date.procedure_date_9, undetermined.procedure_date_9) as date ) as procedure_date_9\r\n\t, cast(coalesce(px_date.procedure_date_10, undetermined.procedure_date_10) as date ) as procedure_date_10\r\n\t, cast(coalesce(px_date.procedure_date_11, undetermined.procedure_date_11) as date ) as procedure_date_11\r\n\t, cast(coalesce(px_date.procedure_date_12, undetermined.procedure_date_12) as date ) as procedure_date_12\r\n\t, cast(coalesce(px_date.procedure_date_13, undetermined.procedure_date_13) as date ) as procedure_date_13\r\n\t, cast(coalesce(px_date.procedure_date_14, undetermined.procedure_date_14) as date ) as procedure_date_14\r\n\t, cast(coalesce(px_date.procedure_date_15, undetermined.procedure_date_15) as date ) as procedure_date_15\r\n\t, cast(coalesce(px_date.procedure_date_16, undetermined.procedure_date_16) as date ) as procedure_date_16\r\n\t, cast(coalesce(px_date.procedure_date_17, undetermined.procedure_date_17) as date ) as procedure_date_17\r\n\t, cast(coalesce(px_date.procedure_date_18, undetermined.procedure_date_18) as date ) as procedure_date_18\r\n\t, cast(coalesce(px_date.procedure_date_19, undetermined.procedure_date_19) as date ) as procedure_date_19\r\n\t, cast(coalesce(px_date.procedure_date_20, undetermined.procedure_date_20) as date ) as procedure_date_20\r\n\t, cast(coalesce(px_date.procedure_date_21, undetermined.procedure_date_21) as date ) as procedure_date_21\r\n\t, cast(coalesce(px_date.procedure_date_22, undetermined.procedure_date_22) as date ) as procedure_date_22\r\n\t, cast(coalesce(px_date.procedure_date_23, undetermined.procedure_date_23) as date ) as procedure_date_23\r\n\t, cast(coalesce(px_date.procedure_date_24, undetermined.procedure_date_24) as date ) as procedure_date_24\r\n\t, cast(coalesce(px_date.procedure_date_25, undetermined.procedure_date_25) as date ) as procedure_date_25\r\n\t, cast(med.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ref('normalized_input__int_admit_source_final') }} ad_source\r\n on med.claim_id = ad_source.claim_id\r\n and med.data_source = ad_source.data_source\r\nleft join {{ref('normalized_input__int_admit_type_final') }} ad_type\r\n on med.claim_id = ad_type.claim_id\r\n and med.data_source = ad_type.data_source\r\nleft join {{ref('normalized_input__int_apr_drg_final') }} apr\r\n on med.claim_id = apr.claim_id\r\n and med.data_source = apr.data_source\r\nleft join {{ref('normalized_input__int_bill_type_final') }} bill\r\n on med.claim_id = bill.claim_id\r\n and med.data_source = bill.data_source\r\nleft join {{ref('normalized_input__int_medical_claim_date_normalize') }} claim_line_dates\r\n on med.claim_id = claim_line_dates.claim_id\r\n and med.claim_line_number = claim_line_dates.claim_line_number\r\n and med.data_source = claim_line_dates.data_source\r\nleft join {{ref('normalized_input__int_medical_date_aggregation') }} dates\r\n on med.claim_id = dates.claim_id\r\n and med.data_source = dates.data_source\r\nleft join {{ref('normalized_input__int_medical_npi_normalize') }} med_npi\r\n on med.claim_id = med_npi.claim_id\r\n and med.claim_line_number = med_npi.claim_line_number\r\n and med.data_source = med_npi.data_source\r\nleft join {{ref('normalized_input__int_discharge_disposition_final') }} disch_disp\r\n on med.claim_id = disch_disp.claim_id\r\n and med.data_source = disch_disp.data_source\r\nleft join {{ref('normalized_input__int_ms_drg_final') }} ms\r\n on med.claim_id = ms.claim_id\r\n and med.data_source = ms.data_source\r\nleft join {{ref('normalized_input__int_place_of_service_normalize') }} pos\r\n on med.claim_id = pos.claim_id\r\n and med.claim_line_number = pos.claim_line_number\r\n and med.data_source = pos.data_source\r\nleft join {{ref('normalized_input__int_diagnosis_code_final') }} dx_code\r\n on med.claim_id = dx_code.claim_id\r\n and med.data_source = dx_code.data_source\r\nleft join {{ref('normalized_input__int_present_on_admit_final') }} poa\r\n on med.claim_id = poa.claim_id\r\n and med.data_source = poa.data_source\r\nleft join {{ref('normalized_input__int_procedure_code_final') }} px_code\r\n on med.claim_id = px_code.claim_id\r\n and med.data_source = px_code.data_source\r\nleft join {{ref('normalized_input__int_procedure_date_final') }} px_date\r\n on med.claim_id = px_date.claim_id\r\n and med.data_source = px_date.data_source\r\nleft join {{ref('normalized_input__int_revenue_center_normalize') }} rev\r\n on med.claim_id = rev.claim_id\r\n and med.claim_line_number = rev.claim_line_number\r\n and med.data_source = rev.data_source\r\nleft join {{ref('normalized_input__int_undetermined_claim_type') }} undetermined\r\n on med.claim_id = undetermined.claim_id\r\n and med.claim_line_number = undetermined.claim_line_number\r\n and med.data_source = undetermined.data_source", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__int_admit_source_final", "package": null, "version": null}, {"name": "normalized_input__int_admit_type_final", "package": null, "version": null}, {"name": "normalized_input__int_apr_drg_final", "package": null, "version": null}, {"name": "normalized_input__int_bill_type_final", "package": null, "version": null}, {"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}, {"name": "normalized_input__int_medical_date_aggregation", "package": null, "version": null}, {"name": "normalized_input__int_medical_npi_normalize", "package": null, "version": null}, {"name": "normalized_input__int_discharge_disposition_final", "package": null, "version": null}, {"name": "normalized_input__int_ms_drg_final", "package": null, "version": null}, {"name": "normalized_input__int_place_of_service_normalize", "package": null, "version": null}, {"name": "normalized_input__int_diagnosis_code_final", "package": null, "version": null}, {"name": "normalized_input__int_present_on_admit_final", "package": null, "version": null}, {"name": "normalized_input__int_procedure_code_final", "package": null, "version": null}, {"name": "normalized_input__int_procedure_date_final", "package": null, "version": null}, {"name": "normalized_input__int_revenue_center_normalize", "package": null, "version": null}, {"name": "normalized_input__int_undetermined_claim_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__int_admit_source_final", "model.the_tuva_project.normalized_input__int_admit_type_final", "model.the_tuva_project.normalized_input__int_apr_drg_final", "model.the_tuva_project.normalized_input__int_bill_type_final", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "model.the_tuva_project.normalized_input__int_ms_drg_final", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "model.the_tuva_project.normalized_input__int_present_on_admit_final", "model.the_tuva_project.normalized_input__int_procedure_code_final", "model.the_tuva_project.normalized_input__int_procedure_date_final", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n\tcast(med.claim_id as TEXT ) as claim_id\n\t, cast(med.claim_line_number as int ) as claim_line_number\n\t, cast(med.claim_type as TEXT ) as claim_type\n\t, cast(med.patient_id as TEXT ) as patient_id\n\t, cast(med.member_id as TEXT ) as member_id\n\t, cast(med.payer as TEXT ) as payer\n\t, cast(med.plan as TEXT ) as plan\n\t, cast(coalesce(dates.minimum_claim_start_date, undetermined.claim_start_date) as date ) as claim_start_date\n\t, cast(coalesce(dates.maximum_claim_end_date, undetermined.claim_start_date) as date ) as claim_end_date\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_start_date, undetermined.claim_line_start_date) as date ) as claim_line_start_date\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_end_date, undetermined.claim_line_end_date) as date ) as claim_line_end_date\n\t, cast(coalesce(dates.minimum_admission_date, undetermined.admission_date) as date ) as admission_date\n\t, cast(coalesce(dates.maximum_discharge_date, undetermined.discharge_date) as date ) as discharge_date\n\t, cast(coalesce(ad_source.normalized_code, undetermined.admit_source_code) as TEXT ) as admit_source_code\n\t, cast(coalesce(ad_type.normalized_code, undetermined.admit_type_code) as TEXT ) as admit_type_code\n\t, cast(coalesce(disch_disp.normalized_code, undetermined.discharge_disposition_code) as TEXT ) as discharge_disposition_code\n\t, cast(coalesce(pos.normalized_code, undetermined.place_of_service_code) as TEXT ) as place_of_service_code\n\t, cast(coalesce(bill.normalized_code, undetermined.bill_type_code) as TEXT ) as bill_type_code\n\t, cast(coalesce(ms.normalized_code, undetermined.ms_drg_code) as TEXT ) as ms_drg_code\n\t, cast(coalesce(apr.normalized_code, undetermined.apr_drg_code) as TEXT ) as apr_drg_code\n\t, cast(coalesce(rev.normalized_code, undetermined.revenue_center_code) as TEXT ) as revenue_center_code\n\t, cast(med.service_unit_quantity as TEXT ) as service_unit_quantity\n\t, cast(med.hcpcs_code as TEXT ) as hcpcs_code\n\t, cast(med.hcpcs_modifier_1 as TEXT ) as hcpcs_modifier_1\n\t, cast(med.hcpcs_modifier_2 as TEXT ) as hcpcs_modifier_2\n\t, cast(med.hcpcs_modifier_3 as TEXT ) as hcpcs_modifier_3\n\t, cast(med.hcpcs_modifier_4 as TEXT ) as hcpcs_modifier_4\n\t, cast(med.hcpcs_modifier_5 as TEXT ) as hcpcs_modifier_5\n\t, cast(coalesce(med_npi.normalized_rendering_npi, undetermined.rendering_npi) as TEXT ) as rendering_npi\n\t, cast(coalesce(med_npi.normalized_billing_npi, undetermined.billing_npi) as TEXT ) as billing_npi\n\t, cast(coalesce(med_npi.normalized_facility_npi, undetermined.facility_npi) as TEXT ) as facility_npi\n\t, cast(med.paid_date as date ) as paid_date\n\t, cast(med.paid_amount as numeric(28,6) ) as paid_amount\n\t, cast(med.allowed_amount as numeric(28,6) ) as allowed_amount\n\t, cast(med.charge_amount as numeric(28,6) ) as charge_amount\n\t, cast(med.coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n\t, cast(med.copayment_amount as numeric(28,6) ) as copayment_amount\n\t, cast(med.deductible_amount as numeric(28,6) ) as deductible_amount\n\t, cast(med.total_cost_amount as numeric(28,6) ) as total_cost_amount\n\t, cast(med.diagnosis_code_type as TEXT ) as diagnosis_code_type\n\t, cast(coalesce(dx_code.diagnosis_code_1, undetermined.diagnosis_code_1) as TEXT ) as diagnosis_code_1\n\t, cast(coalesce(dx_code.diagnosis_code_2, undetermined.diagnosis_code_2) as TEXT ) as diagnosis_code_2\n\t, cast(coalesce(dx_code.diagnosis_code_3, undetermined.diagnosis_code_3) as TEXT ) as diagnosis_code_3\n\t, cast(coalesce(dx_code.diagnosis_code_4, undetermined.diagnosis_code_4) as TEXT ) as diagnosis_code_4\n\t, cast(coalesce(dx_code.diagnosis_code_5, undetermined.diagnosis_code_5) as TEXT ) as diagnosis_code_5\n\t, cast(coalesce(dx_code.diagnosis_code_6, undetermined.diagnosis_code_6) as TEXT ) as diagnosis_code_6\n\t, cast(coalesce(dx_code.diagnosis_code_7, undetermined.diagnosis_code_7) as TEXT ) as diagnosis_code_7\n\t, cast(coalesce(dx_code.diagnosis_code_8, undetermined.diagnosis_code_8) as TEXT ) as diagnosis_code_8\n\t, cast(coalesce(dx_code.diagnosis_code_9, undetermined.diagnosis_code_9) as TEXT ) as diagnosis_code_9\n\t, cast(coalesce(dx_code.diagnosis_code_10, undetermined.diagnosis_code_10) as TEXT ) as diagnosis_code_10\n\t, cast(coalesce(dx_code.diagnosis_code_11, undetermined.diagnosis_code_11) as TEXT ) as diagnosis_code_11\n\t, cast(coalesce(dx_code.diagnosis_code_12, undetermined.diagnosis_code_12) as TEXT ) as diagnosis_code_12\n\t, cast(coalesce(dx_code.diagnosis_code_13, undetermined.diagnosis_code_13) as TEXT ) as diagnosis_code_13\n\t, cast(coalesce(dx_code.diagnosis_code_14, undetermined.diagnosis_code_14) as TEXT ) as diagnosis_code_14\n\t, cast(coalesce(dx_code.diagnosis_code_15, undetermined.diagnosis_code_15) as TEXT ) as diagnosis_code_15\n\t, cast(coalesce(dx_code.diagnosis_code_16, undetermined.diagnosis_code_16) as TEXT ) as diagnosis_code_16\n\t, cast(coalesce(dx_code.diagnosis_code_17, undetermined.diagnosis_code_17) as TEXT ) as diagnosis_code_17\n\t, cast(coalesce(dx_code.diagnosis_code_18, undetermined.diagnosis_code_18) as TEXT ) as diagnosis_code_18\n\t, cast(coalesce(dx_code.diagnosis_code_19, undetermined.diagnosis_code_19) as TEXT ) as diagnosis_code_19\n\t, cast(coalesce(dx_code.diagnosis_code_20, undetermined.diagnosis_code_20) as TEXT ) as diagnosis_code_20\n\t, cast(coalesce(dx_code.diagnosis_code_21, undetermined.diagnosis_code_21) as TEXT ) as diagnosis_code_21\n\t, cast(coalesce(dx_code.diagnosis_code_22, undetermined.diagnosis_code_22) as TEXT ) as diagnosis_code_22\n\t, cast(coalesce(dx_code.diagnosis_code_23, undetermined.diagnosis_code_23) as TEXT ) as diagnosis_code_23\n\t, cast(coalesce(dx_code.diagnosis_code_24, undetermined.diagnosis_code_24) as TEXT ) as diagnosis_code_24\n\t, cast(coalesce(dx_code.diagnosis_code_25, undetermined.diagnosis_code_25) as TEXT ) as diagnosis_code_25\n\t, cast(coalesce(poa.diagnosis_poa_1, undetermined.diagnosis_poa_1) as TEXT ) as diagnosis_poa_1\n\t, cast(coalesce(poa.diagnosis_poa_2, undetermined.diagnosis_poa_2) as TEXT ) as diagnosis_poa_2\n\t, cast(coalesce(poa.diagnosis_poa_3, undetermined.diagnosis_poa_3) as TEXT ) as diagnosis_poa_3\n\t, cast(coalesce(poa.diagnosis_poa_4, undetermined.diagnosis_poa_4) as TEXT ) as diagnosis_poa_4\n\t, cast(coalesce(poa.diagnosis_poa_5, undetermined.diagnosis_poa_5) as TEXT ) as diagnosis_poa_5\n\t, cast(coalesce(poa.diagnosis_poa_6, undetermined.diagnosis_poa_6) as TEXT ) as diagnosis_poa_6\n\t, cast(coalesce(poa.diagnosis_poa_7, undetermined.diagnosis_poa_7) as TEXT ) as diagnosis_poa_7\n\t, cast(coalesce(poa.diagnosis_poa_8, undetermined.diagnosis_poa_8) as TEXT ) as diagnosis_poa_8\n\t, cast(coalesce(poa.diagnosis_poa_9, undetermined.diagnosis_poa_9) as TEXT ) as diagnosis_poa_9\n\t, cast(coalesce(poa.diagnosis_poa_10, undetermined.diagnosis_poa_10) as TEXT ) as diagnosis_poa_10\n\t, cast(coalesce(poa.diagnosis_poa_11, undetermined.diagnosis_poa_11) as TEXT ) as diagnosis_poa_11\n\t, cast(coalesce(poa.diagnosis_poa_12, undetermined.diagnosis_poa_12) as TEXT ) as diagnosis_poa_12\n\t, cast(coalesce(poa.diagnosis_poa_13, undetermined.diagnosis_poa_13) as TEXT ) as diagnosis_poa_13\n\t, cast(coalesce(poa.diagnosis_poa_14, undetermined.diagnosis_poa_14) as TEXT ) as diagnosis_poa_14\n\t, cast(coalesce(poa.diagnosis_poa_15, undetermined.diagnosis_poa_15) as TEXT ) as diagnosis_poa_15\n\t, cast(coalesce(poa.diagnosis_poa_16, undetermined.diagnosis_poa_16) as TEXT ) as diagnosis_poa_16\n\t, cast(coalesce(poa.diagnosis_poa_17, undetermined.diagnosis_poa_17) as TEXT ) as diagnosis_poa_17\n\t, cast(coalesce(poa.diagnosis_poa_18, undetermined.diagnosis_poa_18) as TEXT ) as diagnosis_poa_18\n\t, cast(coalesce(poa.diagnosis_poa_19, undetermined.diagnosis_poa_19) as TEXT ) as diagnosis_poa_19\n\t, cast(coalesce(poa.diagnosis_poa_20, undetermined.diagnosis_poa_20) as TEXT ) as diagnosis_poa_20\n\t, cast(coalesce(poa.diagnosis_poa_21, undetermined.diagnosis_poa_21) as TEXT ) as diagnosis_poa_21\n\t, cast(coalesce(poa.diagnosis_poa_22, undetermined.diagnosis_poa_22) as TEXT ) as diagnosis_poa_22\n\t, cast(coalesce(poa.diagnosis_poa_23, undetermined.diagnosis_poa_23) as TEXT ) as diagnosis_poa_23\n\t, cast(coalesce(poa.diagnosis_poa_24, undetermined.diagnosis_poa_24) as TEXT ) as diagnosis_poa_24\n\t, cast(coalesce(poa.diagnosis_poa_25, undetermined.diagnosis_poa_25) as TEXT ) as diagnosis_poa_25\n\t, cast(med.procedure_code_type as TEXT ) as procedure_code_type\n\t, cast(coalesce(px_code.procedure_code_1, undetermined.procedure_code_1) as TEXT ) as procedure_code_1\n\t, cast(coalesce(px_code.procedure_code_2, undetermined.procedure_code_2) as TEXT ) as procedure_code_2\n\t, cast(coalesce(px_code.procedure_code_3, undetermined.procedure_code_3) as TEXT ) as procedure_code_3\n\t, cast(coalesce(px_code.procedure_code_4, undetermined.procedure_code_4) as TEXT ) as procedure_code_4\n\t, cast(coalesce(px_code.procedure_code_5, undetermined.procedure_code_5) as TEXT ) as procedure_code_5\n\t, cast(coalesce(px_code.procedure_code_6, undetermined.procedure_code_6) as TEXT ) as procedure_code_6\n\t, cast(coalesce(px_code.procedure_code_7, undetermined.procedure_code_7) as TEXT ) as procedure_code_7\n\t, cast(coalesce(px_code.procedure_code_8, undetermined.procedure_code_8) as TEXT ) as procedure_code_8\n\t, cast(coalesce(px_code.procedure_code_9, undetermined.procedure_code_9) as TEXT ) as procedure_code_9\n\t, cast(coalesce(px_code.procedure_code_10, undetermined.procedure_code_10) as TEXT ) as procedure_code_10\n\t, cast(coalesce(px_code.procedure_code_11, undetermined.procedure_code_11) as TEXT ) as procedure_code_11\n\t, cast(coalesce(px_code.procedure_code_12, undetermined.procedure_code_12) as TEXT ) as procedure_code_12\n\t, cast(coalesce(px_code.procedure_code_13, undetermined.procedure_code_13) as TEXT ) as procedure_code_13\n\t, cast(coalesce(px_code.procedure_code_14, undetermined.procedure_code_14) as TEXT ) as procedure_code_14\n\t, cast(coalesce(px_code.procedure_code_15, undetermined.procedure_code_15) as TEXT ) as procedure_code_15\n\t, cast(coalesce(px_code.procedure_code_16, undetermined.procedure_code_16) as TEXT ) as procedure_code_16\n\t, cast(coalesce(px_code.procedure_code_17, undetermined.procedure_code_17) as TEXT ) as procedure_code_17\n\t, cast(coalesce(px_code.procedure_code_18, undetermined.procedure_code_18) as TEXT ) as procedure_code_18\n\t, cast(coalesce(px_code.procedure_code_19, undetermined.procedure_code_19) as TEXT ) as procedure_code_19\n\t, cast(coalesce(px_code.procedure_code_20, undetermined.procedure_code_20) as TEXT ) as procedure_code_20\n\t, cast(coalesce(px_code.procedure_code_21, undetermined.procedure_code_21) as TEXT ) as procedure_code_21\n\t, cast(coalesce(px_code.procedure_code_22, undetermined.procedure_code_22) as TEXT ) as procedure_code_22\n\t, cast(coalesce(px_code.procedure_code_23, undetermined.procedure_code_23) as TEXT ) as procedure_code_23\n\t, cast(coalesce(px_code.procedure_code_24, undetermined.procedure_code_24) as TEXT ) as procedure_code_24\n\t, cast(coalesce(px_code.procedure_code_25, undetermined.procedure_code_25) as TEXT ) as procedure_code_25\n\t, cast(coalesce(px_date.procedure_date_1, undetermined.procedure_date_1) as date ) as procedure_date_1\n\t, cast(coalesce(px_date.procedure_date_2, undetermined.procedure_date_2) as date ) as procedure_date_2\n\t, cast(coalesce(px_date.procedure_date_3, undetermined.procedure_date_3) as date ) as procedure_date_3\n\t, cast(coalesce(px_date.procedure_date_4, undetermined.procedure_date_4) as date ) as procedure_date_4\n\t, cast(coalesce(px_date.procedure_date_5, undetermined.procedure_date_5) as date ) as procedure_date_5\n\t, cast(coalesce(px_date.procedure_date_6, undetermined.procedure_date_6) as date ) as procedure_date_6\n\t, cast(coalesce(px_date.procedure_date_7, undetermined.procedure_date_7) as date ) as procedure_date_7\n\t, cast(coalesce(px_date.procedure_date_8, undetermined.procedure_date_8) as date ) as procedure_date_8\n\t, cast(coalesce(px_date.procedure_date_9, undetermined.procedure_date_9) as date ) as procedure_date_9\n\t, cast(coalesce(px_date.procedure_date_10, undetermined.procedure_date_10) as date ) as procedure_date_10\n\t, cast(coalesce(px_date.procedure_date_11, undetermined.procedure_date_11) as date ) as procedure_date_11\n\t, cast(coalesce(px_date.procedure_date_12, undetermined.procedure_date_12) as date ) as procedure_date_12\n\t, cast(coalesce(px_date.procedure_date_13, undetermined.procedure_date_13) as date ) as procedure_date_13\n\t, cast(coalesce(px_date.procedure_date_14, undetermined.procedure_date_14) as date ) as procedure_date_14\n\t, cast(coalesce(px_date.procedure_date_15, undetermined.procedure_date_15) as date ) as procedure_date_15\n\t, cast(coalesce(px_date.procedure_date_16, undetermined.procedure_date_16) as date ) as procedure_date_16\n\t, cast(coalesce(px_date.procedure_date_17, undetermined.procedure_date_17) as date ) as procedure_date_17\n\t, cast(coalesce(px_date.procedure_date_18, undetermined.procedure_date_18) as date ) as procedure_date_18\n\t, cast(coalesce(px_date.procedure_date_19, undetermined.procedure_date_19) as date ) as procedure_date_19\n\t, cast(coalesce(px_date.procedure_date_20, undetermined.procedure_date_20) as date ) as procedure_date_20\n\t, cast(coalesce(px_date.procedure_date_21, undetermined.procedure_date_21) as date ) as procedure_date_21\n\t, cast(coalesce(px_date.procedure_date_22, undetermined.procedure_date_22) as date ) as procedure_date_22\n\t, cast(coalesce(px_date.procedure_date_23, undetermined.procedure_date_23) as date ) as procedure_date_23\n\t, cast(coalesce(px_date.procedure_date_24, undetermined.procedure_date_24) as date ) as procedure_date_24\n\t, cast(coalesce(px_date.procedure_date_25, undetermined.procedure_date_25) as date ) as procedure_date_25\n\t, cast(med.data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_final ad_source\n on med.claim_id = ad_source.claim_id\n and med.data_source = ad_source.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_final ad_type\n on med.claim_id = ad_type.claim_id\n and med.data_source = ad_type.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_final apr\n on med.claim_id = apr.claim_id\n and med.data_source = apr.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_final bill\n on med.claim_id = bill.claim_id\n and med.data_source = bill.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize claim_line_dates\n on med.claim_id = claim_line_dates.claim_id\n and med.claim_line_number = claim_line_dates.claim_line_number\n and med.data_source = claim_line_dates.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_date_aggregation dates\n on med.claim_id = dates.claim_id\n and med.data_source = dates.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_npi_normalize med_npi\n on med.claim_id = med_npi.claim_id\n and med.claim_line_number = med_npi.claim_line_number\n and med.data_source = med_npi.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_final disch_disp\n on med.claim_id = disch_disp.claim_id\n and med.data_source = disch_disp.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_final ms\n on med.claim_id = ms.claim_id\n and med.data_source = ms.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_place_of_service_normalize pos\n on med.claim_id = pos.claim_id\n and med.claim_line_number = pos.claim_line_number\n and med.data_source = pos.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_final dx_code\n on med.claim_id = dx_code.claim_id\n and med.data_source = dx_code.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_final poa\n on med.claim_id = poa.claim_id\n and med.data_source = poa.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_final px_code\n on med.claim_id = px_code.claim_id\n and med.data_source = px_code.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_final px_date\n on med.claim_id = px_date.claim_id\n and med.data_source = px_date.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_revenue_center_normalize rev\n on med.claim_id = rev.claim_id\n and med.claim_line_number = rev.claim_line_number\n and med.data_source = rev.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_undetermined_claim_type undetermined\n on med.claim_id = undetermined.claim_id\n and med.claim_line_number = undetermined.claim_line_number\n and med.data_source = undetermined.data_source", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__pharmacy_claim": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__pharmacy_claim"], "alias": "normalized_input_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "13c54d60fafd00a820faf57ad03bb7af8d54c4cb4d2be5296dce9c50e24ce695"}, "config": {"enabled": true, "alias": "normalized_input_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The pharmacy claim table contains information on prescription drugs that \nwere filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_pharmacy_claim", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3868816, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(claim_line_number as int ) as claim_line_number\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\r\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\r\n , cast(dispensing_date as date ) as dispensing_date\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(quantity as int ) as quantity\r\n , cast(days_supply as int ) as days_supply\r\n , cast(refills as int ) as refills\r\n , cast(paid_date as date ) as paid_date\r\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_pharmacy_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.normalized_input__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_pharmacy_claim as (\n\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim\n)select\n cast(claim_id as TEXT ) as claim_id\n , cast(claim_line_number as int ) as claim_line_number\n , cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(payer as TEXT ) as payer\n , cast(plan as TEXT ) as plan\n , cast(prescribing_provider_npi as TEXT ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as TEXT ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(quantity as int ) as quantity\n , cast(days_supply as int ) as days_supply\n , cast(refills as int ) as refills\n , cast(paid_date as date ) as paid_date\n , cast(paid_amount as numeric(28,6) ) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_pharmacy_claim", "sql": " __dbt__cte__normalized_input__stg_pharmacy_claim as (\n\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_source_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_source_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_source_final"], "alias": "_int_normalized_input_admit_source_final", "checksum": {"name": "sha256", "checksum": "2475b1e651f4f5625932a6cc3215210a21b0f627b55cfec1dbc612adcb7e3608"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_source_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_source_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3898995, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_admit_source_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_admit_source_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_admit_source_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_source_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_source_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_source_voting"], "alias": "_int_normalized_input_admit_source_voting", "checksum": {"name": "sha256", "checksum": "5012935391e6295a3d2f9718345960a0e3fb07767fe11dbe8f11f54e9277d838"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_source_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_source_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3928807, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , admit.admit_source_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__admit_source') }} admit\r\n on med.admit_source_code = admit.admit_source_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , admit_source_code\r\n , count(*) as admit_source_occurrence_count\r\n from normalize\r\n where admit_source_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , admit_source_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'admit_source_code' as column_name\r\n , admit_source_code as normalized_code\r\n , admit_source_occurrence_count as occurrence_count\r\n , coalesce(lead(admit_source_occurrence_count) \r\n over (partition by claim_id, data_source order by admit_source_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by admit_source_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , admit.admit_source_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.admit_source admit\n on med.admit_source_code = admit.admit_source_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , admit_source_code\n , count(*) as admit_source_occurrence_count\n from normalize\n where admit_source_code is not null\n group by \n claim_id\n , data_source\n , admit_source_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'admit_source_code' as column_name\n , admit_source_code as normalized_code\n , admit_source_occurrence_count as occurrence_count\n , coalesce(lead(admit_source_occurrence_count) \n over (partition by claim_id, data_source order by admit_source_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by admit_source_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_type_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_type_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_type_final"], "alias": "_int_normalized_input_admit_type_final", "checksum": {"name": "sha256", "checksum": "edd86fb649c6c6e0ddf44f6bcf1f59af59fbb1b1e918f85eece29b831e8de407"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_type_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_type_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.395901, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_admit_type_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_admit_type_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_admit_type_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_normalize_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_type_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_type_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_type_voting"], "alias": "_int_normalized_input_admit_type_normalize_voting", "checksum": {"name": "sha256", "checksum": "f26fa7d7618bbaac0dec8ac1f90956683478f4118a6eb2d73428c4f6f88e5963"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_type_normalize_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_type_normalize_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3984644, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_normalize_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , admit.admit_type_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__admit_type') }} admit\r\n on med.admit_type_code = admit.admit_type_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , admit_type_code\r\n , count(*) as admit_type_occurrence_count\r\n from normalize\r\n where admit_type_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , admit_type_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'admit_type_code' as column_name\r\n , admit_type_code as normalized_code\r\n , admit_type_occurrence_count as occurrence_count\r\n , coalesce(lead(admit_type_occurrence_count) \r\n over (partition by claim_id, data_source order by admit_type_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by admit_type_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , admit.admit_type_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.admit_type admit\n on med.admit_type_code = admit.admit_type_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , admit_type_code\n , count(*) as admit_type_occurrence_count\n from normalize\n where admit_type_code is not null\n group by \n claim_id\n , data_source\n , admit_type_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'admit_type_code' as column_name\n , admit_type_code as normalized_code\n , admit_type_occurrence_count as occurrence_count\n , coalesce(lead(admit_type_occurrence_count) \n over (partition by claim_id, data_source order by admit_type_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by admit_type_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_apr_drg_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_apr_drg_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_apr_drg_final"], "alias": "_int_normalized_input_apr_drg_final", "checksum": {"name": "sha256", "checksum": "a90855fe902608f5c0cf01cb732fb912458f5c16759bcff83a39735658b9ffd8"}, "config": {"enabled": true, "alias": "_int_normalized_input_apr_drg_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_apr_drg_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4016364, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_apr_drg_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_apr_drg_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_apr_drg_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_apr_drg_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_apr_drg_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_apr_drg_voting"], "alias": "_int_normalized_input_apr_drg_voting", "checksum": {"name": "sha256", "checksum": "2df14baa50bbb4051d883fabdbd8a751c600b6e857fe9bb615bc979d36b88f93"}, "config": {"enabled": true, "alias": "_int_normalized_input_apr_drg_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_apr_drg_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4046364, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , apr.apr_drg_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__apr_drg') }} apr\r\n on med.apr_drg_code = apr.apr_drg_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , apr_drg_code\r\n , count(*) as apr_drg_occurrence_count\r\n from normalize\r\n where apr_drg_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , apr_drg_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'apr_drg_code' as column_name\r\n , apr_drg_code as normalized_code\r\n , apr_drg_occurrence_count as occurrence_count\r\n , coalesce(lead(apr_drg_occurrence_count) \r\n over (partition by claim_id, data_source order by apr_drg_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by apr_drg_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , apr.apr_drg_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.apr_drg apr\n on med.apr_drg_code = apr.apr_drg_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , apr_drg_code\n , count(*) as apr_drg_occurrence_count\n from normalize\n where apr_drg_code is not null\n group by \n claim_id\n , data_source\n , apr_drg_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'apr_drg_code' as column_name\n , apr_drg_code as normalized_code\n , apr_drg_occurrence_count as occurrence_count\n , coalesce(lead(apr_drg_occurrence_count) \n over (partition by claim_id, data_source order by apr_drg_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by apr_drg_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_bill_type_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_bill_type_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_bill_type_final"], "alias": "_int_normalized_input_bill_type_final", "checksum": {"name": "sha256", "checksum": "613755ac1c13b9565f83331aa2e3e1af630fa08df24f17e13e1eaada2429e0b8"}, "config": {"enabled": true, "alias": "_int_normalized_input_bill_type_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_bill_type_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.407662, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_bill_type_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_bill_type_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_bill_type_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_bill_type_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_bill_type_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_bill_type_voting"], "alias": "_int_normalized_input_bill_type_voting", "checksum": {"name": "sha256", "checksum": "af75763d02b859133b1505b30437e3f303e6e52c4ddcc7217e1593d62735b422"}, "config": {"enabled": true, "alias": "_int_normalized_input_bill_type_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_bill_type_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4116638, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , bill.bill_type_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__bill_type') }} bill\r\n on med.bill_type_code = bill.bill_type_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , bill_type_code\r\n , count(*) as bill_type_occurrence_count\r\n from normalize\r\n where bill_type_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , bill_type_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'bill_type_code' as column_name\r\n , bill_type_code as normalized_code\r\n , bill_type_occurrence_count as occurrence_count\r\n , coalesce(lead(bill_type_occurrence_count) \r\n over (partition by claim_id, data_source order by bill_type_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by bill_type_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , bill.bill_type_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.bill_type bill\n on med.bill_type_code = bill.bill_type_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , bill_type_code\n , count(*) as bill_type_occurrence_count\n from normalize\n where bill_type_code is not null\n group by \n claim_id\n , data_source\n , bill_type_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_name\n , bill_type_code as normalized_code\n , bill_type_occurrence_count as occurrence_count\n , coalesce(lead(bill_type_occurrence_count) \n over (partition by claim_id, data_source order by bill_type_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by bill_type_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_final"], "alias": "_int_normalized_input_diagnosis_code_final", "checksum": {"name": "sha256", "checksum": "833f3dc13b44d2155cc4bfe573841485e4c4b44a1d6cf6ecf9d0b39f91712fcf"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4159226, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'diagnosis_code_1' then normalized_code else null end) as diagnosis_code_1\r\n , max(case when lower(column_name) = 'diagnosis_code_2' then normalized_code else null end) as diagnosis_code_2\r\n , max(case when lower(column_name) = 'diagnosis_code_3' then normalized_code else null end) as diagnosis_code_3\r\n , max(case when lower(column_name) = 'diagnosis_code_4' then normalized_code else null end) as diagnosis_code_4\r\n , max(case when lower(column_name) = 'diagnosis_code_5' then normalized_code else null end) as diagnosis_code_5\r\n , max(case when lower(column_name) = 'diagnosis_code_6' then normalized_code else null end) as diagnosis_code_6\r\n , max(case when lower(column_name) = 'diagnosis_code_7' then normalized_code else null end) as diagnosis_code_7\r\n , max(case when lower(column_name) = 'diagnosis_code_8' then normalized_code else null end) as diagnosis_code_8\r\n , max(case when lower(column_name) = 'diagnosis_code_9' then normalized_code else null end) as diagnosis_code_9\r\n , max(case when lower(column_name) = 'diagnosis_code_10' then normalized_code else null end) as diagnosis_code_10\r\n , max(case when lower(column_name) = 'diagnosis_code_11' then normalized_code else null end) as diagnosis_code_11\r\n , max(case when lower(column_name) = 'diagnosis_code_12' then normalized_code else null end) as diagnosis_code_12\r\n , max(case when lower(column_name) = 'diagnosis_code_13' then normalized_code else null end) as diagnosis_code_13\r\n , max(case when lower(column_name) = 'diagnosis_code_14' then normalized_code else null end) as diagnosis_code_14\r\n , max(case when lower(column_name) = 'diagnosis_code_15' then normalized_code else null end) as diagnosis_code_15\r\n , max(case when lower(column_name) = 'diagnosis_code_16' then normalized_code else null end) as diagnosis_code_16\r\n , max(case when lower(column_name) = 'diagnosis_code_17' then normalized_code else null end) as diagnosis_code_17\r\n , max(case when lower(column_name) = 'diagnosis_code_18' then normalized_code else null end) as diagnosis_code_18\r\n , max(case when lower(column_name) = 'diagnosis_code_19' then normalized_code else null end) as diagnosis_code_19\r\n , max(case when lower(column_name) = 'diagnosis_code_20' then normalized_code else null end) as diagnosis_code_20\r\n , max(case when lower(column_name) = 'diagnosis_code_21' then normalized_code else null end) as diagnosis_code_21\r\n , max(case when lower(column_name) = 'diagnosis_code_22' then normalized_code else null end) as diagnosis_code_22\r\n , max(case when lower(column_name) = 'diagnosis_code_23' then normalized_code else null end) as diagnosis_code_23\r\n , max(case when lower(column_name) = 'diagnosis_code_24' then normalized_code else null end) as diagnosis_code_24\r\n , max(case when lower(column_name) = 'diagnosis_code_25' then normalized_code else null end) as diagnosis_code_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_diagnosis_code_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_diagnosis_code_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'diagnosis_code_1' then normalized_code else null end) as diagnosis_code_1\n , max(case when lower(column_name) = 'diagnosis_code_2' then normalized_code else null end) as diagnosis_code_2\n , max(case when lower(column_name) = 'diagnosis_code_3' then normalized_code else null end) as diagnosis_code_3\n , max(case when lower(column_name) = 'diagnosis_code_4' then normalized_code else null end) as diagnosis_code_4\n , max(case when lower(column_name) = 'diagnosis_code_5' then normalized_code else null end) as diagnosis_code_5\n , max(case when lower(column_name) = 'diagnosis_code_6' then normalized_code else null end) as diagnosis_code_6\n , max(case when lower(column_name) = 'diagnosis_code_7' then normalized_code else null end) as diagnosis_code_7\n , max(case when lower(column_name) = 'diagnosis_code_8' then normalized_code else null end) as diagnosis_code_8\n , max(case when lower(column_name) = 'diagnosis_code_9' then normalized_code else null end) as diagnosis_code_9\n , max(case when lower(column_name) = 'diagnosis_code_10' then normalized_code else null end) as diagnosis_code_10\n , max(case when lower(column_name) = 'diagnosis_code_11' then normalized_code else null end) as diagnosis_code_11\n , max(case when lower(column_name) = 'diagnosis_code_12' then normalized_code else null end) as diagnosis_code_12\n , max(case when lower(column_name) = 'diagnosis_code_13' then normalized_code else null end) as diagnosis_code_13\n , max(case when lower(column_name) = 'diagnosis_code_14' then normalized_code else null end) as diagnosis_code_14\n , max(case when lower(column_name) = 'diagnosis_code_15' then normalized_code else null end) as diagnosis_code_15\n , max(case when lower(column_name) = 'diagnosis_code_16' then normalized_code else null end) as diagnosis_code_16\n , max(case when lower(column_name) = 'diagnosis_code_17' then normalized_code else null end) as diagnosis_code_17\n , max(case when lower(column_name) = 'diagnosis_code_18' then normalized_code else null end) as diagnosis_code_18\n , max(case when lower(column_name) = 'diagnosis_code_19' then normalized_code else null end) as diagnosis_code_19\n , max(case when lower(column_name) = 'diagnosis_code_20' then normalized_code else null end) as diagnosis_code_20\n , max(case when lower(column_name) = 'diagnosis_code_21' then normalized_code else null end) as diagnosis_code_21\n , max(case when lower(column_name) = 'diagnosis_code_22' then normalized_code else null end) as diagnosis_code_22\n , max(case when lower(column_name) = 'diagnosis_code_23' then normalized_code else null end) as diagnosis_code_23\n , max(case when lower(column_name) = 'diagnosis_code_24' then normalized_code else null end) as diagnosis_code_24\n , max(case when lower(column_name) = 'diagnosis_code_25' then normalized_code else null end) as diagnosis_code_25\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_normalize"], "alias": "_int_normalized_input_diagnosis_code_normalize", "checksum": {"name": "sha256", "checksum": "179014e4821ac7e90ccc56a81480f28b3eaa3e970b84d32dc4c046820f42d2c8"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4199293, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_diagnosis as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_1' as diagnosis_column\r\n , diagnosis_code_1 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_2' as diagnosis_column\r\n , diagnosis_code_2 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_3' as diagnosis_column\r\n , diagnosis_code_3 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_4' as diagnosis_column\r\n , diagnosis_code_4 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_5' as diagnosis_column\r\n , diagnosis_code_5 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_6' as diagnosis_column\r\n , diagnosis_code_6 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_7' as diagnosis_column\r\n , diagnosis_code_7 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_8' as diagnosis_column\r\n , diagnosis_code_8 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_9' as diagnosis_column\r\n , diagnosis_code_9 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_10' as diagnosis_column\r\n , diagnosis_code_10 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_11' as diagnosis_column\r\n , diagnosis_code_11 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_12' as diagnosis_column\r\n , diagnosis_code_12 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_13' as diagnosis_column\r\n , diagnosis_code_13 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_14' as diagnosis_column\r\n , diagnosis_code_14 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_15' as diagnosis_column\r\n , diagnosis_code_15 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_16' as diagnosis_column\r\n , diagnosis_code_16 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_17' as diagnosis_column\r\n , diagnosis_code_17 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_18' as diagnosis_column\r\n , diagnosis_code_18 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_19' as diagnosis_column\r\n , diagnosis_code_19 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_20' as diagnosis_column\r\n , diagnosis_code_20 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_21' as diagnosis_column\r\n , diagnosis_code_21 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_22' as diagnosis_column\r\n , diagnosis_code_22 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_23' as diagnosis_column\r\n , diagnosis_code_24 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_24' as diagnosis_column\r\n , diagnosis_code_24 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_25' as diagnosis_column\r\n , diagnosis_code_25 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , diagnosis_code_type\r\n , diagnosis_column\r\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm) as normalized_diagnosis_code\r\n , count(*) as diagnosis_code_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_diagnosis piv\r\nleft join {{ ref('terminology__icd_10_cm') }} icd_10\r\n on replace(piv.diagnosis_code,'.','') = icd_10.icd_10_cm\r\n and piv.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm') }} icd_9\r\n on replace(piv.diagnosis_code,'.','') = icd_9.icd_9_cm\r\n and piv.diagnosis_code_type = 'icd-9-cm'\r\nwhere claim_type <> 'undetermined'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , diagnosis_code_type\r\n , diagnosis_column\r\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm)", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_diagnosis as(\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_1' as diagnosis_column\n , diagnosis_code_1 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_2' as diagnosis_column\n , diagnosis_code_2 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_3' as diagnosis_column\n , diagnosis_code_3 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_4' as diagnosis_column\n , diagnosis_code_4 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_5' as diagnosis_column\n , diagnosis_code_5 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_6' as diagnosis_column\n , diagnosis_code_6 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_7' as diagnosis_column\n , diagnosis_code_7 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_8' as diagnosis_column\n , diagnosis_code_8 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_9' as diagnosis_column\n , diagnosis_code_9 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_10' as diagnosis_column\n , diagnosis_code_10 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_11' as diagnosis_column\n , diagnosis_code_11 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_12' as diagnosis_column\n , diagnosis_code_12 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_13' as diagnosis_column\n , diagnosis_code_13 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_14' as diagnosis_column\n , diagnosis_code_14 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_15' as diagnosis_column\n , diagnosis_code_15 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_16' as diagnosis_column\n , diagnosis_code_16 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_17' as diagnosis_column\n , diagnosis_code_17 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_18' as diagnosis_column\n , diagnosis_code_18 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_19' as diagnosis_column\n , diagnosis_code_19 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_20' as diagnosis_column\n , diagnosis_code_20 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_21' as diagnosis_column\n , diagnosis_code_21 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_22' as diagnosis_column\n , diagnosis_code_22 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_23' as diagnosis_column\n , diagnosis_code_24 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_24' as diagnosis_column\n , diagnosis_code_24 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_25' as diagnosis_column\n , diagnosis_code_25 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , diagnosis_code_type\n , diagnosis_column\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm) as normalized_diagnosis_code\n , count(*) as diagnosis_code_occurrence_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pivot_diagnosis piv\nleft join dev_thuxuan.terminology.icd_10_cm icd_10\n on replace(piv.diagnosis_code,'.','') = icd_10.icd_10_cm\n and piv.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd_9\n on replace(piv.diagnosis_code,'.','') = icd_9.icd_9_cm\n and piv.diagnosis_code_type = 'icd-9-cm'\nwhere claim_type <> 'undetermined'\ngroup by \n claim_id\n , data_source\n , diagnosis_code_type\n , diagnosis_column\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_voting"], "alias": "_int_normalized_input_diagnosis_code_voting", "checksum": {"name": "sha256", "checksum": "d19ae69e58ccaffcf91a85e79d9dde2e838c628acf597b917be7bf34823bd738"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4225109, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_diagnosis_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.diagnosis_column as column_name\r\n , norm.normalized_diagnosis_code as normalized_code\r\n , norm.diagnosis_code_occurrence_count as occurrence_count\r\n , coalesce(lead(diagnosis_code_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_diagnosis_code_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.diagnosis_column = dist.diagnosis_column", "language": "sql", "refs": [{"name": "normalized_input__int_diagnosis_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_diagnosis_code_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , diagnosis_column\n , count(*) as distinct_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize\n group by\n claim_id\n , data_source\n , diagnosis_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.diagnosis_column as column_name\n , norm.normalized_diagnosis_code as normalized_code\n , norm.diagnosis_code_occurrence_count as occurrence_count\n , coalesce(lead(diagnosis_code_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc) as occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.diagnosis_column = dist.diagnosis_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_discharge_disposition_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_discharge_disposition_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_discharge_disposition_final"], "alias": "_int_normalized_input_discharge_disposition_final", "checksum": {"name": "sha256", "checksum": "99855def1a775dd424f7920e48f0eeb5e5023b8b0a4a3f731d604355b070966b"}, "config": {"enabled": true, "alias": "_int_normalized_input_discharge_disposition_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_discharge_disposition_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4255164, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_discharge_disposition_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_discharge_disposition_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_discharge_disposition_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_discharge_disposition_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_discharge_disposition_voting"], "alias": "_int_normalized_input_discharge_disposition_voting", "checksum": {"name": "sha256", "checksum": "9418dbe038eefb1601fb79feb657bf1634b0094cb81a5d2dc48150f8efccc7a2"}, "config": {"enabled": true, "alias": "_int_normalized_input_discharge_disposition_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_discharge_disposition_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.428622, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , disch.discharge_disposition_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__discharge_disposition') }} disch\r\n on med.discharge_disposition_code = disch.discharge_disposition_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , discharge_disposition_code\r\n , count(*) as discharge_disposition_occurrence_count\r\n from normalize\r\n where discharge_disposition_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , discharge_disposition_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'discharge_disposition_code' as column_name\r\n , discharge_disposition_code as normalized_code\r\n , discharge_disposition_occurrence_count as occurrence_count\r\n , coalesce(lead(discharge_disposition_occurrence_count) \r\n over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__discharge_disposition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , disch.discharge_disposition_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.discharge_disposition disch\n on med.discharge_disposition_code = disch.discharge_disposition_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , discharge_disposition_code\n , count(*) as discharge_disposition_occurrence_count\n from normalize\n where discharge_disposition_code is not null\n group by \n claim_id\n , data_source\n , discharge_disposition_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'discharge_disposition_code' as column_name\n , discharge_disposition_code as normalized_code\n , discharge_disposition_occurrence_count as occurrence_count\n , coalesce(lead(discharge_disposition_occurrence_count) \n over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_eligibility_dates_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_eligibility_dates_normalize"], "alias": "_int_normalized_input_eligibility_dates_normalize", "checksum": {"name": "sha256", "checksum": "c92624d552627264d7ebd960e9acca0ac9fe1dd389d1af326f634e9564bdb67a"}, "config": {"enabled": true, "alias": "_int_normalized_input_eligibility_dates_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_eligibility_dates_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4316363, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_eligibility_dates_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n elig.patient_id\r\n , elig.patient_id||coalesce(elig.data_source,'')||coalesce(elig.payer,'')||coalesce(elig.plan,'')||coalesce(cast(elig.enrollment_start_date as {{ dbt.type_string() }}),'')||coalesce(cast(elig.enrollment_end_date as {{ dbt.type_string() }}),'') as patient_id_key\r\n , cal_dob.full_date as normalized_birth_date\r\n , cal_death.full_date as normalized_death_date\r\n , cal_enroll_start.full_date as normalized_enrollment_start_date\r\n , cal_enroll_end.full_date as normalized_enrollment_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_eligibility') }} elig\r\nleft join {{ ref('terminology__calendar') }} cal_dob\r\n on elig.birth_date = cal_dob.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_death\r\n on elig.death_date = cal_death.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_enroll_start\r\n on elig.enrollment_start_date = cal_enroll_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_enroll_end\r\n on elig.enrollment_end_date = cal_enroll_end.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_eligibility", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__stg_eligibility", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)select distinct\n elig.patient_id\n , elig.patient_id||coalesce(elig.data_source,'')||coalesce(elig.payer,'')||coalesce(elig.plan,'')||coalesce(cast(elig.enrollment_start_date as TEXT),'')||coalesce(cast(elig.enrollment_end_date as TEXT),'') as patient_id_key\n , cal_dob.full_date as normalized_birth_date\n , cal_death.full_date as normalized_death_date\n , cal_enroll_start.full_date as normalized_enrollment_start_date\n , cal_enroll_end.full_date as normalized_enrollment_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_eligibility elig\nleft join dev_thuxuan.terminology.calendar cal_dob\n on elig.birth_date = cal_dob.full_date\nleft join dev_thuxuan.terminology.calendar cal_death\n on elig.death_date = cal_death.full_date\nleft join dev_thuxuan.terminology.calendar cal_enroll_start\n on elig.enrollment_start_date = cal_enroll_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_enroll_end\n on elig.enrollment_end_date = cal_enroll_end.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_eligibility", "sql": " __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_claim_date_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_claim_date_normalize"], "alias": "_int_normalized_input_medical_claim_date_normalize", "checksum": {"name": "sha256", "checksum": "292c6f782f96f5a0ced02279e441286ffca95714ad1794062bd147095c29d56a"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_claim_date_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_claim_date_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4340205, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n med.claim_id\r\n , med.claim_line_number\r\n , med.claim_type\r\n , med.data_source\r\n , cal_claim_start.full_date as normalized_claim_start_date\r\n , cal_claim_end.full_date as normalized_claim_end_date\r\n , cal_claim_line_start.full_date as normalized_claim_line_start_date\r\n , cal_claim_line_end.full_date as normalized_claim_line_end_date\r\n , cal_admission.full_date as normalized_admission_date\r\n , cal_discharge.full_date as normalized_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__calendar') }} cal_claim_start\r\n on med.claim_start_date = cal_claim_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_end\r\n on med.claim_end_Date = cal_claim_end.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_line_start\r\n on med.claim_line_start_date = cal_claim_line_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_line_end\r\n on med.claim_line_end_date = cal_claim_line_end.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_admission\r\n on med.admission_date = cal_admission.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_discharge\r\n on med.discharge_date = cal_discharge.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select distinct\n med.claim_id\n , med.claim_line_number\n , med.claim_type\n , med.data_source\n , cal_claim_start.full_date as normalized_claim_start_date\n , cal_claim_end.full_date as normalized_claim_end_date\n , cal_claim_line_start.full_date as normalized_claim_line_start_date\n , cal_claim_line_end.full_date as normalized_claim_line_end_date\n , cal_admission.full_date as normalized_admission_date\n , cal_discharge.full_date as normalized_discharge_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.calendar cal_claim_start\n on med.claim_start_date = cal_claim_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_end\n on med.claim_end_Date = cal_claim_end.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_line_start\n on med.claim_line_start_date = cal_claim_line_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_line_end\n on med.claim_line_end_date = cal_claim_line_end.full_date\nleft join dev_thuxuan.terminology.calendar cal_admission\n on med.admission_date = cal_admission.full_date\nleft join dev_thuxuan.terminology.calendar cal_discharge\n on med.discharge_date = cal_discharge.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_date_aggregation": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_date_aggregation", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_date_aggregation"], "alias": "_int_normalized_input_medical_date_aggregation", "checksum": {"name": "sha256", "checksum": "5596dbf9586a54cac39aaf04d1f8e561dae60f0be82b9e6c0b069182267831f0"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_date_aggregation", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_date_aggregation", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.438026, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_date_aggregation", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , min(normalized_claim_start_date) as minimum_claim_start_date\r\n , max(normalized_claim_end_date) as maximum_claim_end_date\r\n , min(normalized_admission_date) as minimum_admission_date\r\n , max(normalized_discharge_date) as maximum_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_medical_claim_date_normalize') }}\r\nwhere claim_type = 'institutional'\r\ngroup by\r\n claim_id\r\n , data_source\r\n\r\nunion all\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , min(normalized_claim_start_date) as minimum_claim_start_date\r\n , max(normalized_claim_end_date) as maximum_claim_end_date\r\n , null as minimum_admission_date\r\n , null as maximum_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_medical_claim_date_normalize') }}\r\nwhere claim_type = 'professional'\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}, {"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , min(normalized_claim_start_date) as minimum_claim_start_date\n , max(normalized_claim_end_date) as maximum_claim_end_date\n , min(normalized_admission_date) as minimum_admission_date\n , max(normalized_discharge_date) as maximum_discharge_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize\nwhere claim_type = 'institutional'\ngroup by\n claim_id\n , data_source\n\nunion all\n\nselect\n claim_id\n , data_source\n , min(normalized_claim_start_date) as minimum_claim_start_date\n , max(normalized_claim_end_date) as maximum_claim_end_date\n , null as minimum_admission_date\n , null as maximum_discharge_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize\nwhere claim_type = 'professional'\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_npi_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_npi_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_npi_normalize"], "alias": "_int_normalized_input_medical_npi_normalize", "checksum": {"name": "sha256", "checksum": "51301b9b002b2cfa625a083b03b6d10cfc9168091672ef20c7fce2daa7085af3"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_npi_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_npi_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.440028, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_npi_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n med.claim_id\r\n , med.claim_line_number\r\n , med.claim_type\r\n , med.data_source\r\n , rend_prov.npi as normalized_rendering_npi\r\n , bill_prov.npi as normalized_billing_npi\r\n , fac_prov.npi as normalized_facility_npi\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__provider') }} rend_prov\r\n on med.rendering_npi = rend_prov.npi\r\n and rend_prov.entity_type_description = 'Individual'\r\nleft join {{ ref('terminology__provider') }} bill_prov\r\n on med.billing_npi = bill_prov.npi\r\nleft join {{ ref('terminology__provider') }} fac_prov\r\n on med.facility_npi = fac_prov.npi\r\n and fac_prov.entity_type_description = 'Organization'\r\n and med.claim_type = 'institutional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select distinct\n med.claim_id\n , med.claim_line_number\n , med.claim_type\n , med.data_source\n , rend_prov.npi as normalized_rendering_npi\n , bill_prov.npi as normalized_billing_npi\n , fac_prov.npi as normalized_facility_npi\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.provider rend_prov\n on med.rendering_npi = rend_prov.npi\n and rend_prov.entity_type_description = 'Individual'\nleft join dev_thuxuan.terminology.provider bill_prov\n on med.billing_npi = bill_prov.npi\nleft join dev_thuxuan.terminology.provider fac_prov\n on med.facility_npi = fac_prov.npi\n and fac_prov.entity_type_description = 'Organization'\n and med.claim_type = 'institutional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_ms_drg_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_ms_drg_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_ms_drg_final"], "alias": "_int_normalized_input_ms_drg_final", "checksum": {"name": "sha256", "checksum": "61a83f81464eda87788caee16eca359b72d450e0b8ff68b8313fc695b27d1048"}, "config": {"enabled": true, "alias": "_int_normalized_input_ms_drg_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_ms_drg_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4430225, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_ms_drg_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_ms_drg_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_ms_drg_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_ms_drg_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_ms_drg_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_ms_drg_voting"], "alias": "_int_normalized_input_ms_drg_voting", "checksum": {"name": "sha256", "checksum": "5bb09e3b17ef640dac97c8b1ffd92249b7cb2b40df4495cd3a5a2fbdaf72f2d0"}, "config": {"enabled": true, "alias": "_int_normalized_input_ms_drg_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_ms_drg_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4460282, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , ms.ms_drg_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__ms_drg') }} ms\r\n on med.ms_drg_code = ms.ms_drg_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , ms_drg_code\r\n , count(*) as ms_drg_occurrence_count\r\n from normalize\r\n where ms_drg_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , ms_drg_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'ms_drg_code' as column_name\r\n , ms_drg_code as normalized_code\r\n , ms_drg_occurrence_count as occurrence_count\r\n , coalesce(lead(ms_drg_occurrence_count) \r\n over (partition by claim_id, data_source order by ms_drg_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by ms_drg_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , ms.ms_drg_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.ms_drg ms\n on med.ms_drg_code = ms.ms_drg_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , ms_drg_code\n , count(*) as ms_drg_occurrence_count\n from normalize\n where ms_drg_code is not null\n group by \n claim_id\n , data_source\n , ms_drg_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'ms_drg_code' as column_name\n , ms_drg_code as normalized_code\n , ms_drg_occurrence_count as occurrence_count\n , coalesce(lead(ms_drg_occurrence_count) \n over (partition by claim_id, data_source order by ms_drg_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by ms_drg_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_place_of_service_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_place_of_service_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_place_of_service_normalize"], "alias": "_int_normalized_input_place_of_service_normalize", "checksum": {"name": "sha256", "checksum": "512e6ee5ec6f421460061e6639bfa12903c77eaeaa6e4e9617ffbc28ab0287c4"}, "config": {"enabled": true, "alias": "_int_normalized_input_place_of_service_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_place_of_service_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4496274, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_place_of_service_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , pos.place_of_service_code as normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__place_of_service') }} pos\r\n on lpad(med.place_of_service_code, 2, '0') = pos.place_of_service_code\r\nwhere claim_type = 'professional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , data_source\n , pos.place_of_service_code as normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.place_of_service pos\n on lpad(med.place_of_service_code, 2, '0') = pos.place_of_service_code\nwhere claim_type = 'professional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_final"], "alias": "_int_normalized_input_present_on_admit_final", "checksum": {"name": "sha256", "checksum": "ffd6b269b3f66e12d285c19dd8ef53c79e00a531b6bff27fd7dead01dd0852fb"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4517179, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when column_name = 'DIAGNOSIS_POA_1' then normalized_code else null end) as diagnosis_poa_1\r\n , max(case when column_name = 'DIAGNOSIS_POA_2' then normalized_code else null end) as diagnosis_poa_2\r\n , max(case when column_name = 'DIAGNOSIS_POA_3' then normalized_code else null end) as diagnosis_poa_3\r\n , max(case when column_name = 'DIAGNOSIS_POA_4' then normalized_code else null end) as diagnosis_poa_4\r\n , max(case when column_name = 'DIAGNOSIS_POA_5' then normalized_code else null end) as diagnosis_poa_5\r\n , max(case when column_name = 'DIAGNOSIS_POA_6' then normalized_code else null end) as diagnosis_poa_6\r\n , max(case when column_name = 'DIAGNOSIS_POA_7' then normalized_code else null end) as diagnosis_poa_7\r\n , max(case when column_name = 'DIAGNOSIS_POA_8' then normalized_code else null end) as diagnosis_poa_8\r\n , max(case when column_name = 'DIAGNOSIS_POA_9' then normalized_code else null end) as diagnosis_poa_9\r\n , max(case when column_name = 'DIAGNOSIS_POA_10' then normalized_code else null end) as diagnosis_poa_10\r\n , max(case when column_name = 'DIAGNOSIS_POA_11' then normalized_code else null end) as diagnosis_poa_11\r\n , max(case when column_name = 'DIAGNOSIS_POA_12' then normalized_code else null end) as diagnosis_poa_12\r\n , max(case when column_name = 'DIAGNOSIS_POA_13' then normalized_code else null end) as diagnosis_poa_13\r\n , max(case when column_name = 'DIAGNOSIS_POA_14' then normalized_code else null end) as diagnosis_poa_14\r\n , max(case when column_name = 'DIAGNOSIS_POA_15' then normalized_code else null end) as diagnosis_poa_15\r\n , max(case when column_name = 'DIAGNOSIS_POA_16' then normalized_code else null end) as diagnosis_poa_16\r\n , max(case when column_name = 'DIAGNOSIS_POA_17' then normalized_code else null end) as diagnosis_poa_17\r\n , max(case when column_name = 'DIAGNOSIS_POA_18' then normalized_code else null end) as diagnosis_poa_18\r\n , max(case when column_name = 'DIAGNOSIS_POA_19' then normalized_code else null end) as diagnosis_poa_19\r\n , max(case when column_name = 'DIAGNOSIS_POA_20' then normalized_code else null end) as diagnosis_poa_20\r\n , max(case when column_name = 'DIAGNOSIS_POA_21' then normalized_code else null end) as diagnosis_poa_21\r\n , max(case when column_name = 'DIAGNOSIS_POA_22' then normalized_code else null end) as diagnosis_poa_22\r\n , max(case when column_name = 'DIAGNOSIS_POA_23' then normalized_code else null end) as diagnosis_poa_23\r\n , max(case when column_name = 'DIAGNOSIS_POA_24' then normalized_code else null end) as diagnosis_poa_24\r\n , max(case when column_name = 'DIAGNOSIS_POA_25' then normalized_code else null end) as diagnosis_poa_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_present_on_admit_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_present_on_admit_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when column_name = 'DIAGNOSIS_POA_1' then normalized_code else null end) as diagnosis_poa_1\n , max(case when column_name = 'DIAGNOSIS_POA_2' then normalized_code else null end) as diagnosis_poa_2\n , max(case when column_name = 'DIAGNOSIS_POA_3' then normalized_code else null end) as diagnosis_poa_3\n , max(case when column_name = 'DIAGNOSIS_POA_4' then normalized_code else null end) as diagnosis_poa_4\n , max(case when column_name = 'DIAGNOSIS_POA_5' then normalized_code else null end) as diagnosis_poa_5\n , max(case when column_name = 'DIAGNOSIS_POA_6' then normalized_code else null end) as diagnosis_poa_6\n , max(case when column_name = 'DIAGNOSIS_POA_7' then normalized_code else null end) as diagnosis_poa_7\n , max(case when column_name = 'DIAGNOSIS_POA_8' then normalized_code else null end) as diagnosis_poa_8\n , max(case when column_name = 'DIAGNOSIS_POA_9' then normalized_code else null end) as diagnosis_poa_9\n , max(case when column_name = 'DIAGNOSIS_POA_10' then normalized_code else null end) as diagnosis_poa_10\n , max(case when column_name = 'DIAGNOSIS_POA_11' then normalized_code else null end) as diagnosis_poa_11\n , max(case when column_name = 'DIAGNOSIS_POA_12' then normalized_code else null end) as diagnosis_poa_12\n , max(case when column_name = 'DIAGNOSIS_POA_13' then normalized_code else null end) as diagnosis_poa_13\n , max(case when column_name = 'DIAGNOSIS_POA_14' then normalized_code else null end) as diagnosis_poa_14\n , max(case when column_name = 'DIAGNOSIS_POA_15' then normalized_code else null end) as diagnosis_poa_15\n , max(case when column_name = 'DIAGNOSIS_POA_16' then normalized_code else null end) as diagnosis_poa_16\n , max(case when column_name = 'DIAGNOSIS_POA_17' then normalized_code else null end) as diagnosis_poa_17\n , max(case when column_name = 'DIAGNOSIS_POA_18' then normalized_code else null end) as diagnosis_poa_18\n , max(case when column_name = 'DIAGNOSIS_POA_19' then normalized_code else null end) as diagnosis_poa_19\n , max(case when column_name = 'DIAGNOSIS_POA_20' then normalized_code else null end) as diagnosis_poa_20\n , max(case when column_name = 'DIAGNOSIS_POA_21' then normalized_code else null end) as diagnosis_poa_21\n , max(case when column_name = 'DIAGNOSIS_POA_22' then normalized_code else null end) as diagnosis_poa_22\n , max(case when column_name = 'DIAGNOSIS_POA_23' then normalized_code else null end) as diagnosis_poa_23\n , max(case when column_name = 'DIAGNOSIS_POA_24' then normalized_code else null end) as diagnosis_poa_24\n , max(case when column_name = 'DIAGNOSIS_POA_25' then normalized_code else null end) as diagnosis_poa_25\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_normalize"], "alias": "_int_normalized_input_present_on_admit_normalize", "checksum": {"name": "sha256", "checksum": "bddfc433eda6677655f5ce0809136b91f5451863ff74e71b69b55e02f7321643"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4547405, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_poa as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_1' as diagnosis_column\r\n , diagnosis_poa_1 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_2' as diagnosis_column\r\n , diagnosis_poa_2 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_3' as diagnosis_column\r\n , diagnosis_poa_3 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_4' as diagnosis_column\r\n , diagnosis_poa_4 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_5' as diagnosis_column\r\n , diagnosis_poa_5 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_6' as diagnosis_column\r\n , diagnosis_poa_6 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_7' as diagnosis_column\r\n , diagnosis_poa_7 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_8' as diagnosis_column\r\n , diagnosis_poa_8 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_9' as diagnosis_column\r\n , diagnosis_poa_9 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_10' as diagnosis_column\r\n , diagnosis_poa_10 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_11' as diagnosis_column\r\n , diagnosis_poa_11 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_12' as diagnosis_column\r\n , diagnosis_poa_12 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_13' as diagnosis_column\r\n , diagnosis_poa_13 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_14' as diagnosis_column\r\n , diagnosis_poa_14 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_15' as diagnosis_column\r\n , diagnosis_poa_15 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_16' as diagnosis_column\r\n , diagnosis_poa_16 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_17' as diagnosis_column\r\n , diagnosis_poa_17 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_18' as diagnosis_column\r\n , diagnosis_poa_18 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_19' as diagnosis_column\r\n , diagnosis_poa_19 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_20' as diagnosis_column\r\n , diagnosis_poa_20 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_21' as diagnosis_column\r\n , diagnosis_poa_21 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_22' as diagnosis_column\r\n , diagnosis_poa_22 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_23' as diagnosis_column\r\n , diagnosis_poa_24 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_24' as diagnosis_column\r\n , diagnosis_poa_24 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_25' as diagnosis_column\r\n , diagnosis_poa_25 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , poa.present_on_admit_code as normalized_present_on_admit_code\r\n , count(*) as present_on_admit_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_poa piv\r\nleft join {{ ref('terminology__present_on_admission') }} poa\r\n on replace(piv.present_on_admit_code,'.','') = poa.present_on_admit_code\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , poa.present_on_admit_code", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__present_on_admission"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_poa as(\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_1' as diagnosis_column\n , diagnosis_poa_1 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_2' as diagnosis_column\n , diagnosis_poa_2 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_3' as diagnosis_column\n , diagnosis_poa_3 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_4' as diagnosis_column\n , diagnosis_poa_4 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_5' as diagnosis_column\n , diagnosis_poa_5 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_6' as diagnosis_column\n , diagnosis_poa_6 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_7' as diagnosis_column\n , diagnosis_poa_7 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_8' as diagnosis_column\n , diagnosis_poa_8 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_9' as diagnosis_column\n , diagnosis_poa_9 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_10' as diagnosis_column\n , diagnosis_poa_10 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_11' as diagnosis_column\n , diagnosis_poa_11 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_12' as diagnosis_column\n , diagnosis_poa_12 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_13' as diagnosis_column\n , diagnosis_poa_13 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_14' as diagnosis_column\n , diagnosis_poa_14 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_15' as diagnosis_column\n , diagnosis_poa_15 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_16' as diagnosis_column\n , diagnosis_poa_16 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_17' as diagnosis_column\n , diagnosis_poa_17 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_18' as diagnosis_column\n , diagnosis_poa_18 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_19' as diagnosis_column\n , diagnosis_poa_19 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_20' as diagnosis_column\n , diagnosis_poa_20 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_21' as diagnosis_column\n , diagnosis_poa_21 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_22' as diagnosis_column\n , diagnosis_poa_22 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_23' as diagnosis_column\n , diagnosis_poa_24 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_24' as diagnosis_column\n , diagnosis_poa_24 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_25' as diagnosis_column\n , diagnosis_poa_25 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , diagnosis_column\n , poa.present_on_admit_code as normalized_present_on_admit_code\n , count(*) as present_on_admit_occurrence_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pivot_poa piv\nleft join dev_thuxuan.terminology.present_on_admission poa\n on replace(piv.present_on_admit_code,'.','') = poa.present_on_admit_code\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , diagnosis_column\n , poa.present_on_admit_code", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_voting"], "alias": "_int_normalized_input_present_on_admit_voting", "checksum": {"name": "sha256", "checksum": "eb0123290dd8ea0f0222f45ce161e6163f5db9b1bedb124f334a8419b2fa9e9a"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4577577, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_present_on_admit_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.diagnosis_column as column_name\r\n , norm.normalized_present_on_admit_code as normalized_code\r\n , norm.present_on_admit_occurrence_count as occurrence_count\r\n , coalesce(lead(present_on_admit_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_present_on_admit_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.diagnosis_column = dist.diagnosis_column", "language": "sql", "refs": [{"name": "normalized_input__int_present_on_admit_normalize", "package": null, "version": null}, {"name": "normalized_input__int_present_on_admit_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , diagnosis_column\n , count(*) as distinct_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize\n group by\n claim_id\n , data_source\n , diagnosis_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.diagnosis_column as column_name\n , norm.normalized_present_on_admit_code as normalized_code\n , norm.present_on_admit_occurrence_count as occurrence_count\n , coalesce(lead(present_on_admit_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc) as occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.diagnosis_column = dist.diagnosis_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_final"], "alias": "_int_normalized_input_procedure_code_final", "checksum": {"name": "sha256", "checksum": "24f85b787305661b747fa11eddb504b1161fa9f48eb6f4360b8843962308f713"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4607124, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'procedure_code_1' then normalized_code else null end) as procedure_code_1\r\n , max(case when lower(column_name) = 'procedure_code_2' then normalized_code else null end) as procedure_code_2\r\n , max(case when lower(column_name) = 'procedure_code_3' then normalized_code else null end) as procedure_code_3\r\n , max(case when lower(column_name) = 'procedure_code_4' then normalized_code else null end) as procedure_code_4\r\n , max(case when lower(column_name) = 'procedure_code_5' then normalized_code else null end) as procedure_code_5\r\n , max(case when lower(column_name) = 'procedure_code_6' then normalized_code else null end) as procedure_code_6\r\n , max(case when lower(column_name) = 'procedure_code_7' then normalized_code else null end) as procedure_code_7\r\n , max(case when lower(column_name) = 'procedure_code_8' then normalized_code else null end) as procedure_code_8\r\n , max(case when lower(column_name) = 'procedure_code_9' then normalized_code else null end) as procedure_code_9\r\n , max(case when lower(column_name) = 'procedure_code_10' then normalized_code else null end) as procedure_code_10\r\n , max(case when lower(column_name) = 'procedure_code_11' then normalized_code else null end) as procedure_code_11\r\n , max(case when lower(column_name) = 'procedure_code_12' then normalized_code else null end) as procedure_code_12\r\n , max(case when lower(column_name) = 'procedure_code_13' then normalized_code else null end) as procedure_code_13\r\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_14\r\n , max(case when lower(column_name) = 'procedure_code_15' then normalized_code else null end) as procedure_code_15\r\n , max(case when lower(column_name) = 'procedure_code_16' then normalized_code else null end) as procedure_code_16\r\n , max(case when lower(column_name) = 'procedure_code_17' then normalized_code else null end) as procedure_code_17\r\n , max(case when lower(column_name) = 'procedure_code_18' then normalized_code else null end) as procedure_code_18\r\n , max(case when lower(column_name) = 'procedure_code_19' then normalized_code else null end) as procedure_code_19\r\n , max(case when lower(column_name) = 'procedure_code_20' then normalized_code else null end) as procedure_code_20\r\n , max(case when lower(column_name) = 'procedure_code_21' then normalized_code else null end) as procedure_code_21\r\n , max(case when lower(column_name) = 'procedure_code_22' then normalized_code else null end) as procedure_code_22\r\n , max(case when lower(column_name) = 'procedure_code_23' then normalized_code else null end) as procedure_code_23\r\n , max(case when lower(column_name) = 'procedure_code_24' then normalized_code else null end) as procedure_code_24\r\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_code_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'procedure_code_1' then normalized_code else null end) as procedure_code_1\n , max(case when lower(column_name) = 'procedure_code_2' then normalized_code else null end) as procedure_code_2\n , max(case when lower(column_name) = 'procedure_code_3' then normalized_code else null end) as procedure_code_3\n , max(case when lower(column_name) = 'procedure_code_4' then normalized_code else null end) as procedure_code_4\n , max(case when lower(column_name) = 'procedure_code_5' then normalized_code else null end) as procedure_code_5\n , max(case when lower(column_name) = 'procedure_code_6' then normalized_code else null end) as procedure_code_6\n , max(case when lower(column_name) = 'procedure_code_7' then normalized_code else null end) as procedure_code_7\n , max(case when lower(column_name) = 'procedure_code_8' then normalized_code else null end) as procedure_code_8\n , max(case when lower(column_name) = 'procedure_code_9' then normalized_code else null end) as procedure_code_9\n , max(case when lower(column_name) = 'procedure_code_10' then normalized_code else null end) as procedure_code_10\n , max(case when lower(column_name) = 'procedure_code_11' then normalized_code else null end) as procedure_code_11\n , max(case when lower(column_name) = 'procedure_code_12' then normalized_code else null end) as procedure_code_12\n , max(case when lower(column_name) = 'procedure_code_13' then normalized_code else null end) as procedure_code_13\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_14\n , max(case when lower(column_name) = 'procedure_code_15' then normalized_code else null end) as procedure_code_15\n , max(case when lower(column_name) = 'procedure_code_16' then normalized_code else null end) as procedure_code_16\n , max(case when lower(column_name) = 'procedure_code_17' then normalized_code else null end) as procedure_code_17\n , max(case when lower(column_name) = 'procedure_code_18' then normalized_code else null end) as procedure_code_18\n , max(case when lower(column_name) = 'procedure_code_19' then normalized_code else null end) as procedure_code_19\n , max(case when lower(column_name) = 'procedure_code_20' then normalized_code else null end) as procedure_code_20\n , max(case when lower(column_name) = 'procedure_code_21' then normalized_code else null end) as procedure_code_21\n , max(case when lower(column_name) = 'procedure_code_22' then normalized_code else null end) as procedure_code_22\n , max(case when lower(column_name) = 'procedure_code_23' then normalized_code else null end) as procedure_code_23\n , max(case when lower(column_name) = 'procedure_code_24' then normalized_code else null end) as procedure_code_24\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_25\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_normalize"], "alias": "_int_normalized_input_procedure_code_normalize", "checksum": {"name": "sha256", "checksum": "aee921d2a050a6d48f127551e1ab2743965d58caa67f7b67ec1e7fa00731fc27"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4637175, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_procedure as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_1' as procedure_column\r\n , procedure_code_1 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_2' as procedure_column\r\n , procedure_code_2 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_3' as procedure_column\r\n , procedure_code_3 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_4' as procedure_column\r\n , procedure_code_4 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_5' as procedure_column\r\n , procedure_code_5 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_6' as procedure_column\r\n , procedure_code_6 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_7' as procedure_column\r\n , procedure_code_7 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_8' as procedure_column\r\n , procedure_code_8 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_9' as procedure_column\r\n , procedure_code_9 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_10' as procedure_column\r\n , procedure_code_10 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_11' as procedure_column\r\n , procedure_code_11 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_12' as procedure_column\r\n , procedure_code_12 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_13' as procedure_column\r\n , procedure_code_13 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_14' as procedure_column\r\n , procedure_code_14 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_15' as procedure_column\r\n , procedure_code_15 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_16' as procedure_column\r\n , procedure_code_16 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_17' as procedure_column\r\n , procedure_code_17 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_18' as procedure_column\r\n , procedure_code_18 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_19' as procedure_column\r\n , procedure_code_19 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_20' as procedure_column\r\n , procedure_code_20 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_21' as procedure_column\r\n , procedure_code_21 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_22' as procedure_column\r\n , procedure_code_22 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_23' as procedure_column\r\n , procedure_code_24 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_24' as procedure_column\r\n , procedure_code_24 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_25' as procedure_column\r\n , procedure_code_25 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , procedure_code_type\r\n , procedure_column\r\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs) as normalized_procedure_code\r\n , count(*) as procedure_code_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_procedure piv\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd_10\r\n on replace(piv.procedure_code,'.','') = icd_10.icd_10_pcs\r\n and piv.procedure_code_type = 'icd-10-pcs'\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd_9\r\n on replace(piv.procedure_code,'.','') = icd_9.icd_9_pcs\r\n and piv.procedure_code_type = 'icd-9-pcs'\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , procedure_code_type\r\n , procedure_column\r\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs)", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__icd_9_pcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_procedure as(\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_1' as procedure_column\n , procedure_code_1 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_2' as procedure_column\n , procedure_code_2 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_3' as procedure_column\n , procedure_code_3 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_4' as procedure_column\n , procedure_code_4 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_5' as procedure_column\n , procedure_code_5 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_6' as procedure_column\n , procedure_code_6 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_7' as procedure_column\n , procedure_code_7 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_8' as procedure_column\n , procedure_code_8 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_9' as procedure_column\n , procedure_code_9 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_10' as procedure_column\n , procedure_code_10 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_11' as procedure_column\n , procedure_code_11 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_12' as procedure_column\n , procedure_code_12 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_13' as procedure_column\n , procedure_code_13 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_14' as procedure_column\n , procedure_code_14 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_15' as procedure_column\n , procedure_code_15 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_16' as procedure_column\n , procedure_code_16 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_17' as procedure_column\n , procedure_code_17 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_18' as procedure_column\n , procedure_code_18 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_19' as procedure_column\n , procedure_code_19 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_20' as procedure_column\n , procedure_code_20 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_21' as procedure_column\n , procedure_code_21 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_22' as procedure_column\n , procedure_code_22 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_23' as procedure_column\n , procedure_code_24 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_24' as procedure_column\n , procedure_code_24 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_25' as procedure_column\n , procedure_code_25 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , procedure_code_type\n , procedure_column\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs) as normalized_procedure_code\n , count(*) as procedure_code_occurrence_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pivot_procedure piv\nleft join dev_thuxuan.terminology.icd_10_pcs icd_10\n on replace(piv.procedure_code,'.','') = icd_10.icd_10_pcs\n and piv.procedure_code_type = 'icd-10-pcs'\nleft join dev_thuxuan.terminology.icd_9_pcs icd_9\n on replace(piv.procedure_code,'.','') = icd_9.icd_9_pcs\n and piv.procedure_code_type = 'icd-9-pcs'\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , procedure_code_type\n , procedure_column\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_voting"], "alias": "_int_normalized_input_procedure_code_voting", "checksum": {"name": "sha256", "checksum": "bece822a93f1ddeb86cf9da2b160d157ccaae782c9f481d29e2f8725bfff79ef"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.467417, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_procedure_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.procedure_column as column_name\r\n , norm.normalized_procedure_code as normalized_code\r\n , norm.procedure_code_occurrence_count as occurrence_count\r\n , coalesce(lead(procedure_code_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_code_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.procedure_column = dist.procedure_column", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , procedure_column\n , count(*) as distinct_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize\n group by\n claim_id\n , data_source\n , procedure_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.procedure_column as column_name\n , norm.normalized_procedure_code as normalized_code\n , norm.procedure_code_occurrence_count as occurrence_count\n , coalesce(lead(procedure_code_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc) as occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.procedure_column = dist.procedure_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_final"], "alias": "_int_normalized_input_procedure_date_final", "checksum": {"name": "sha256", "checksum": "0dfe233529b22190cd7775a61ec0852d25c2c93a1d296dfccf62c8546800acf1"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4704375, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'procedure_date_1' then normalized_code else null end) as procedure_date_1\r\n , max(case when lower(column_name) = 'procedure_date_2' then normalized_code else null end) as procedure_date_2\r\n , max(case when lower(column_name) = 'procedure_date_3' then normalized_code else null end) as procedure_date_3\r\n , max(case when lower(column_name) = 'procedure_date_4' then normalized_code else null end) as procedure_date_4\r\n , max(case when lower(column_name) = 'procedure_date_5' then normalized_code else null end) as procedure_date_5\r\n , max(case when lower(column_name) = 'procedure_date_6' then normalized_code else null end) as procedure_date_6\r\n , max(case when lower(column_name) = 'procedure_date_7' then normalized_code else null end) as procedure_date_7\r\n , max(case when lower(column_name) = 'procedure_date_8' then normalized_code else null end) as procedure_date_8\r\n , max(case when lower(column_name) = 'procedure_date_9' then normalized_code else null end) as procedure_date_9\r\n , max(case when lower(column_name) = 'procedure_date_10' then normalized_code else null end) as procedure_date_10\r\n , max(case when lower(column_name) = 'procedure_date_11' then normalized_code else null end) as procedure_date_11\r\n , max(case when lower(column_name) = 'procedure_date_12' then normalized_code else null end) as procedure_date_12\r\n , max(case when lower(column_name) = 'procedure_date_13' then normalized_code else null end) as procedure_date_13\r\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_14\r\n , max(case when lower(column_name) = 'procedure_date_15' then normalized_code else null end) as procedure_date_15\r\n , max(case when lower(column_name) = 'procedure_date_16' then normalized_code else null end) as procedure_date_16\r\n , max(case when lower(column_name) = 'procedure_date_17' then normalized_code else null end) as procedure_date_17\r\n , max(case when lower(column_name) = 'procedure_date_18' then normalized_code else null end) as procedure_date_18\r\n , max(case when lower(column_name) = 'procedure_date_19' then normalized_code else null end) as procedure_date_19\r\n , max(case when lower(column_name) = 'procedure_date_20' then normalized_code else null end) as procedure_date_20\r\n , max(case when lower(column_name) = 'procedure_date_21' then normalized_code else null end) as procedure_date_21\r\n , max(case when lower(column_name) = 'procedure_date_22' then normalized_code else null end) as procedure_date_22\r\n , max(case when lower(column_name) = 'procedure_date_23' then normalized_code else null end) as procedure_date_23\r\n , max(case when lower(column_name) = 'procedure_date_24' then normalized_code else null end) as procedure_date_24\r\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_date_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_date_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'procedure_date_1' then normalized_code else null end) as procedure_date_1\n , max(case when lower(column_name) = 'procedure_date_2' then normalized_code else null end) as procedure_date_2\n , max(case when lower(column_name) = 'procedure_date_3' then normalized_code else null end) as procedure_date_3\n , max(case when lower(column_name) = 'procedure_date_4' then normalized_code else null end) as procedure_date_4\n , max(case when lower(column_name) = 'procedure_date_5' then normalized_code else null end) as procedure_date_5\n , max(case when lower(column_name) = 'procedure_date_6' then normalized_code else null end) as procedure_date_6\n , max(case when lower(column_name) = 'procedure_date_7' then normalized_code else null end) as procedure_date_7\n , max(case when lower(column_name) = 'procedure_date_8' then normalized_code else null end) as procedure_date_8\n , max(case when lower(column_name) = 'procedure_date_9' then normalized_code else null end) as procedure_date_9\n , max(case when lower(column_name) = 'procedure_date_10' then normalized_code else null end) as procedure_date_10\n , max(case when lower(column_name) = 'procedure_date_11' then normalized_code else null end) as procedure_date_11\n , max(case when lower(column_name) = 'procedure_date_12' then normalized_code else null end) as procedure_date_12\n , max(case when lower(column_name) = 'procedure_date_13' then normalized_code else null end) as procedure_date_13\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_14\n , max(case when lower(column_name) = 'procedure_date_15' then normalized_code else null end) as procedure_date_15\n , max(case when lower(column_name) = 'procedure_date_16' then normalized_code else null end) as procedure_date_16\n , max(case when lower(column_name) = 'procedure_date_17' then normalized_code else null end) as procedure_date_17\n , max(case when lower(column_name) = 'procedure_date_18' then normalized_code else null end) as procedure_date_18\n , max(case when lower(column_name) = 'procedure_date_19' then normalized_code else null end) as procedure_date_19\n , max(case when lower(column_name) = 'procedure_date_20' then normalized_code else null end) as procedure_date_20\n , max(case when lower(column_name) = 'procedure_date_21' then normalized_code else null end) as procedure_date_21\n , max(case when lower(column_name) = 'procedure_date_22' then normalized_code else null end) as procedure_date_22\n , max(case when lower(column_name) = 'procedure_date_23' then normalized_code else null end) as procedure_date_23\n , max(case when lower(column_name) = 'procedure_date_24' then normalized_code else null end) as procedure_date_24\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_25\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_normalize"], "alias": "_int_normalized_input_procedure_date_normalize", "checksum": {"name": "sha256", "checksum": "dead03b9149aeead8299ce32e628b73efa345724ad584dc73ed5d78861a051d1"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4724483, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_procedure as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_1' as procedure_column\r\n , procedure_date_1 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_2' as procedure_column\r\n , procedure_date_2 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_3' as procedure_column\r\n , procedure_date_3 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_4' as procedure_column\r\n , procedure_date_4 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_5' as procedure_column\r\n , procedure_date_5 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_6' as procedure_column\r\n , procedure_date_6 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_7' as procedure_column\r\n , procedure_date_7 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_8' as procedure_column\r\n , procedure_date_8 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_9' as procedure_column\r\n , procedure_date_9 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_10' as procedure_column\r\n , procedure_date_10 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_11' as procedure_column\r\n , procedure_date_11 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_12' as procedure_column\r\n , procedure_date_12 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_13' as procedure_column\r\n , procedure_date_13 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_14' as procedure_column\r\n , procedure_date_14 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_15' as procedure_column\r\n , procedure_date_15 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_16' as procedure_column\r\n , procedure_date_16 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_17' as procedure_column\r\n , procedure_date_17 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_18' as procedure_column\r\n , procedure_date_18 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_19' as procedure_column\r\n , procedure_date_19 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_20' as procedure_column\r\n , procedure_date_20 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_21' as procedure_column\r\n , procedure_date_21 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_22' as procedure_column\r\n , procedure_date_22 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_23' as procedure_column\r\n , procedure_date_24 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_24' as procedure_column\r\n , procedure_date_24 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_25' as procedure_column\r\n , procedure_date_25 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , cal.full_date as procedure_date\r\n , count(*) as procedure_date_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_procedure piv\r\nleft join {{ ref('terminology__calendar') }} cal\r\n on piv.procedure_date = cal.full_date\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , cal.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_procedure as(\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_1' as procedure_column\n , procedure_date_1 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_2' as procedure_column\n , procedure_date_2 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_3' as procedure_column\n , procedure_date_3 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_4' as procedure_column\n , procedure_date_4 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_5' as procedure_column\n , procedure_date_5 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_6' as procedure_column\n , procedure_date_6 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_7' as procedure_column\n , procedure_date_7 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_8' as procedure_column\n , procedure_date_8 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_9' as procedure_column\n , procedure_date_9 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_10' as procedure_column\n , procedure_date_10 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_11' as procedure_column\n , procedure_date_11 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_12' as procedure_column\n , procedure_date_12 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_13' as procedure_column\n , procedure_date_13 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_14' as procedure_column\n , procedure_date_14 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_15' as procedure_column\n , procedure_date_15 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_16' as procedure_column\n , procedure_date_16 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_17' as procedure_column\n , procedure_date_17 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_18' as procedure_column\n , procedure_date_18 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_19' as procedure_column\n , procedure_date_19 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_20' as procedure_column\n , procedure_date_20 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_21' as procedure_column\n , procedure_date_21 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_22' as procedure_column\n , procedure_date_22 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_23' as procedure_column\n , procedure_date_24 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_24' as procedure_column\n , procedure_date_24 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_25' as procedure_column\n , procedure_date_25 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , procedure_column\n , cal.full_date as procedure_date\n , count(*) as procedure_date_occurrence_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pivot_procedure piv\nleft join dev_thuxuan.terminology.calendar cal\n on piv.procedure_date = cal.full_date\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , procedure_column\n , cal.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_voting"], "alias": "_int_normalized_input_procedure_date_voting", "checksum": {"name": "sha256", "checksum": "9f8af8bbcf17e5d4f8a3fd263c0c407a6cb6e47d6899b36f60fea55e72a94981"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4764197, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_procedure_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.procedure_column as column_name\r\n , norm.procedure_date as normalized_code\r\n , norm.procedure_date_occurrence_count as occurrence_count\r\n , coalesce(lead(procedure_date_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_date_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.procedure_column = dist.procedure_column", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_procedure_date_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , procedure_column\n , count(*) as distinct_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize\n group by\n claim_id\n , data_source\n , procedure_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.procedure_column as column_name\n , norm.procedure_date as normalized_code\n , norm.procedure_date_occurrence_count as occurrence_count\n , coalesce(lead(procedure_date_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc) as occurrence_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.procedure_column = dist.procedure_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_revenue_center_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_revenue_center_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_revenue_center_normalize"], "alias": "_int_normalized_input_revenue_center_normalize", "checksum": {"name": "sha256", "checksum": "39f9ff18d84f98d851dd18fc596f8ac25e72ba314cc8887e2e924814c6b233df"}, "config": {"enabled": true, "alias": "_int_normalized_input_revenue_center_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_revenue_center_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4794521, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_revenue_center_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , rev.revenue_center_code as normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__revenue_center') }} rev\r\n on lpad(med.revenue_center_code, 4, '0') = rev.revenue_center_code\r\nwhere claim_type = 'institutional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , data_source\n , rev.revenue_center_code as normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.revenue_center rev\n on lpad(med.revenue_center_code, 4, '0') = rev.revenue_center_code\nwhere claim_type = 'institutional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_undetermined_claim_type": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_undetermined_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_undetermined_claim_type"], "alias": "_int_normalized_input_undetermined_claim_type", "checksum": {"name": "sha256", "checksum": "57003790094627655a77691bae71f407052d3924b32f664b315c74741faca20e"}, "config": {"enabled": true, "alias": "_int_normalized_input_undetermined_claim_type", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_undetermined_claim_type", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4819353, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_undetermined_claim_type", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }}\r\nwhere claim_type in ('undetermined')", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim\nwhere claim_type in ('undetermined')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_eligibility"], "alias": "normalized_input__stg_eligibility", "checksum": {"name": "sha256", "checksum": "0a02d79203d86d4a579a67c8a4bb171e97b47fcc54c732444406fee521bc99e0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.484113, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n patient_id\r\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as {{ dbt.type_string() }}),'')||coalesce(cast(enrollment_end_date as {{ dbt.type_string() }}),'') as patient_id_key\r\n , member_id\r\n , subscriber_id\r\n , gender\r\n , race\r\n , birth_date\r\n , death_date\r\n , death_flag\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\n , plan\r\n , subscriber_relation\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , first_name\r\n , last_name\r\n , social_security_number\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , phone\r\n , data_source\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [{"name": "eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_medical_claim"], "alias": "normalized_input__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "354dad4e69d61472ae25a9928ccfc486c8766cf980473a677d898256d04fa2db"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4861324, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_pharmacy_claim"], "alias": "normalized_input__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "0919d418145d666b8a15bae1dc34c35e0bcf5cf66e8457da482e8606e6638e24"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.4881885, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , prescribing_provider_npi\r\n , dispensing_provider_npi\r\n , dispensing_date\r\n , ndc_code\r\n , quantity\r\n , days_supply\r\n , refills\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , data_source\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [{"name": "pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_results": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_input_layer_results", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_results"], "alias": "_dq_input_layer_results", "checksum": {"name": "sha256", "checksum": "995a3677da266d7e96e2f758bf689ecf0a2c9fe540b4a3578696e490027d9640"}, "config": {"enabled": true, "alias": "_dq_input_layer_results", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_results", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3429148, "relation_name": "dev_thuxuan.claims_preprocessing._dq_input_layer_results", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n dq_problem\r\n, count(distinct claim_id) as distinct_claims\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__dq_input_layer_tests') }}\r\ngroup by 1", "language": "sql", "refs": [{"name": "service_category__dq_input_layer_tests", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "compiled": true, "compiled_code": "\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_input_layer_tests", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_tests"], "alias": "_dq_input_layer_tests", "checksum": {"name": "sha256", "checksum": "474eb8a7e0921b7201879cd03fc932e87db60dcacf7f3cd8b3971692d6b89ca3"}, "config": {"enabled": true, "alias": "_dq_input_layer_tests", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_tests", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.345911, "relation_name": "dev_thuxuan.claims_preprocessing._dq_input_layer_tests", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct claim_type) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__claim_type') }} b\r\n on a.claim_type = b.claim_type\r\nwhere b.claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__place_of_service') }} b\r\n on a.place_of_service_code = b.place_of_service_code\r\nwhere a.claim_type = 'professional'\r\n and b.place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__bill_type') }} b\r\n on a.bill_type_code = b.bill_type_code\r\nwhere a.claim_type = 'institutional'\r\n and b.bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__revenue_center') }} b\r\n on a.revenue_center_code = b.revenue_center_code\r\nwhere a.claim_type = 'institutional'\r\n and b.revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__hcpcs_level_2') }} b\r\n on a.hcpcs_code = b.hcpcs\r\nwhere a.claim_type = 'professional'\r\n and b.hcpcs is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid ms_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__ms_drg') }} b\r\n on a.ms_drg_code = b.ms_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.ms_drg_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid apr_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__apr_drg') }} b\r\n on a.apr_drg_code = b.apr_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.apr_drg_code is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__claim_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct claim_type) > 1\n\nunion all\n\nselect distinct \n claim_id\n, 'Multiple bill_type_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct bill_type_code) > 1\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing claim_type' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing place_of_service_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing bill_type_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and bill_type_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing revenue_center_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing hcpcs_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and hcpcs_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid claim_type' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.claim_type b\n on a.claim_type = b.claim_type\nwhere b.claim_type is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid place_of_service_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.place_of_service b\n on a.place_of_service_code = b.place_of_service_code\nwhere a.claim_type = 'professional'\n and b.place_of_service_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid bill_type_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.bill_type b\n on a.bill_type_code = b.bill_type_code\nwhere a.claim_type = 'institutional'\n and b.bill_type_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid revenue_center_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.revenue_center b\n on a.revenue_center_code = b.revenue_center_code\nwhere a.claim_type = 'institutional'\n and b.revenue_center_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid hcpcs_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.hcpcs_level_2 b\n on a.hcpcs_code = b.hcpcs\nwhere a.claim_type = 'professional'\n and b.hcpcs is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid ms_drg_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.ms_drg b\n on a.ms_drg_code = b.ms_drg_code\nwhere a.claim_type = 'institutional'\n and b.ms_drg_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid apr_drg_code' as dq_problem\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.apr_drg b\n on a.apr_drg_code = b.apr_drg_code\nwhere a.claim_type = 'institutional'\n and b.apr_drg_code is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_multiple_service_categories_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_institutional"], "alias": "_dq_multiple_service_categories_institutional", "checksum": {"name": "sha256", "checksum": "2f864f8da22fb47284e7c35e20dffe888a8c76bf360fc06733d77bd266a0ec70"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3494518, "relation_name": "dev_thuxuan.claims_preprocessing._dq_multiple_service_categories_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_institutional') }}\r\ngroup by 1\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [{"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_combined_institutional\ngroup by 1\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_multiple_service_categories_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_professional"], "alias": "_dq_multiple_service_categories_professional", "checksum": {"name": "sha256", "checksum": "e444b43251b83d6aa2efc8edf1b495019b285e990c4f4fedbef7d8e32fcb6c66"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3534603, "relation_name": "dev_thuxuan.claims_preprocessing._dq_multiple_service_categories_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, claim_line_number\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_professional') }}\r\ngroup by 1,2\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [{"name": "service_category__combined_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_combined_professional\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__service_category_grouper": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__service_category_grouper", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "unique_id": "model.the_tuva_project.service_category__service_category_grouper", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "final", "service_category__service_category_grouper"], "alias": "service_category_grouper", "checksum": {"name": "sha256", "checksum": "62d8fd7986ddf6530853d40cee54f8509de18f895bd1ef85a165a2e1eeab61a1"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Assigns every claim line into a unique service category.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "service_category_grouper", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.248225, "relation_name": "dev_thuxuan.claims_preprocessing.service_category_grouper", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith service_category_1_mapping as(\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulance' then 'Ancillary'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n where a.claim_type = 'professional'\r\n\r\n union all\r\n\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_institutional') }} b\r\n on a.claim_id = b.claim_id\r\n where a.claim_type = 'institutional'\r\n)\r\n, service_category_2_deduplication as(\r\n select \r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\n , row_number() over (partition by claim_id, claim_line_number order by \r\n case\r\n when service_category_2 = 'Acute Inpatient' then 3\r\n when service_category_2 = 'Ambulance' then 7\r\n when service_category_2 = 'Ambulatory Surgery' then 8\r\n when service_category_2 = 'Dialysis' then 17\r\n when service_category_2 = 'Durable Medical Equipment' then 1\r\n when service_category_2 = 'Emergency Department' then 5\r\n when service_category_2 = 'Home Health' then 9\r\n when service_category_2 = 'Hospice' then 10\r\n when service_category_2 = 'Inpatient Psychiatric' then 11\r\n when service_category_2 = 'Inpatient Rehabilitation' then 12\r\n when service_category_2 = 'Lab' then 13\r\n when service_category_2 = 'Office Visit' then 4\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\r\n when service_category_2 = 'Outpatient Psychiatric' then 15\r\n when service_category_2 = 'Outpatient Rehabilitation' then 16\r\n when service_category_2 = 'Skilled Nursing' then 6\r\n when service_category_2 = 'Urgent Care' then 2\r\n when service_category_2 is null then 18\r\n else 99 end) as duplicate_row_number\r\n from service_category_1_mapping\r\n)\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\nfrom service_category_2_deduplication\r\nwhere duplicate_row_number = 1", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_professional", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),service_category_1_mapping as(\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulance' then 'Ancillary'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join dev_thuxuan.claims_preprocessing._int_combined_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n where a.claim_type = 'professional'\n\n union all\n\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join dev_thuxuan.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\n where a.claim_type = 'institutional'\n)\n, service_category_2_deduplication as(\n select \n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\n , row_number() over (partition by claim_id, claim_line_number order by \n case\n when service_category_2 = 'Acute Inpatient' then 3\n when service_category_2 = 'Ambulance' then 7\n when service_category_2 = 'Ambulatory Surgery' then 8\n when service_category_2 = 'Dialysis' then 17\n when service_category_2 = 'Durable Medical Equipment' then 1\n when service_category_2 = 'Emergency Department' then 5\n when service_category_2 = 'Home Health' then 9\n when service_category_2 = 'Hospice' then 10\n when service_category_2 = 'Inpatient Psychiatric' then 11\n when service_category_2 = 'Inpatient Rehabilitation' then 12\n when service_category_2 = 'Lab' then 13\n when service_category_2 = 'Office Visit' then 4\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\n when service_category_2 = 'Outpatient Psychiatric' then 15\n when service_category_2 = 'Outpatient Rehabilitation' then 16\n when service_category_2 = 'Skilled Nursing' then 6\n when service_category_2 = 'Urgent Care' then 2\n when service_category_2 is null then 18\n else 99 end) as duplicate_row_number\n from service_category_1_mapping\n)\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\nfrom service_category_2_deduplication\nwhere duplicate_row_number = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__acute_inpatient_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_institutional"], "alias": "_int_acute_inpatient_institutional", "checksum": {"name": "sha256", "checksum": "45448b22cdb8a33fda5a064935b99740b7273da6c46768e362b043118cd13bcb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2574868, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith room_and_board_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code in\r\n ('0100','0101',\r\n '0110','0111','0112','0113','0114','0116','0117','0118','0119',\r\n '0120','0121','0122','0123','0124','0126','0127','0128','0129',\r\n '0130','0131','0132','0133','0134','0136','0137','0138','0139',\r\n '0140','0141','0142','0143','0144','0146','0147','0148','0149',\r\n '0150','0151','0152','0153','0154','0156','0157','0158','0159',\r\n '0160','0164','0167','0169',\r\n '0170','0171','0172','0173','0174','0179',\r\n '0190','0191','0192','0193','0194','0199',\r\n '0200','0201','0202','0203','0204','0206','0207','0208','0209',\r\n '0210','0211','0212','0213','0214','0219',\r\n '1000','1001','1002')\r\n)\r\n\r\n, drg_requirement as (\r\nselect distinct \r\n mc.claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }} mc\r\nleft join {{ ref('terminology__ms_drg')}} msdrg\r\n on mc.ms_drg_code = msdrg.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg')}} aprdrg\r\n on mc.apr_drg_code = aprdrg.apr_drg_code\r\nwhere claim_type = 'institutional'\r\n and (msdrg.ms_drg_code is not null or aprdrg.apr_drg_code is not null)\r\n)\r\n\r\n, bill_type_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('11','12') \r\n)\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join room_and_board_requirement b\r\n on a.claim_id = b.claim_id\r\ninner join drg_requirement c\r\n on a.claim_id = c.claim_id\r\ninner join bill_type_requirement d\r\n on a.claim_id = d.claim_id", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),room_and_board_requirement as (\nselect distinct \n claim_id\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code in\n ('0100','0101',\n '0110','0111','0112','0113','0114','0116','0117','0118','0119',\n '0120','0121','0122','0123','0124','0126','0127','0128','0129',\n '0130','0131','0132','0133','0134','0136','0137','0138','0139',\n '0140','0141','0142','0143','0144','0146','0147','0148','0149',\n '0150','0151','0152','0153','0154','0156','0157','0158','0159',\n '0160','0164','0167','0169',\n '0170','0171','0172','0173','0174','0179',\n '0190','0191','0192','0193','0194','0199',\n '0200','0201','0202','0203','0204','0206','0207','0208','0209',\n '0210','0211','0212','0213','0214','0219',\n '1000','1001','1002')\n)\n\n, drg_requirement as (\nselect distinct \n mc.claim_id\nfrom __dbt__cte__service_category__stg_medical_claim mc\nleft join dev_thuxuan.terminology.ms_drg msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg aprdrg\n on mc.apr_drg_code = aprdrg.apr_drg_code\nwhere claim_type = 'institutional'\n and (msdrg.ms_drg_code is not null or aprdrg.apr_drg_code is not null)\n)\n\n, bill_type_requirement as (\nselect distinct \n claim_id\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('11','12') \n)\n\nselect distinct \n a.claim_id\n, 'Acute Inpatient' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join room_and_board_requirement b\n on a.claim_id = b.claim_id\ninner join drg_requirement c\n on a.claim_id = c.claim_id\ninner join bill_type_requirement d\n on a.claim_id = d.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__acute_inpatient_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_professional"], "alias": "_int_acute_inpatient_professional", "checksum": {"name": "sha256", "checksum": "3d6946eec496f4e26d0ff37dce15f9fbd2d521922d2f59c55a1a630c778d8f29"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.260584, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n claim_id\r\n, claim_line_number\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '21'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '21'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__ambulance_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "unique_id": "model.the_tuva_project.service_category__ambulance_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulance_professional"], "alias": "_int_ambulance_professional", "checksum": {"name": "sha256", "checksum": "9a180fa157cc7e6697b4bdff3c8ace56d436a3225005542ad040e6b41fe681ce"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulance_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2635746, "relation_name": "dev_thuxuan.claims_preprocessing._int_ambulance_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Ambulance' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and (hcpcs_code between 'A0425' and 'A0436' or place_of_service_code in ('41','42'))", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and (hcpcs_code between 'A0425' and 'A0436' or place_of_service_code in ('41','42'))", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__ambulatory_surgery_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulatory_surgery_professional"], "alias": "_int_ambulatory_surgery_professional", "checksum": {"name": "sha256", "checksum": "5132c1e9fb0afaf2c9d2cc3e43c79a9f5e4659dc3a26b85f89eaaeee2fe3466b"}, "config": {"enabled": true, "alias": "_int_ambulatory_surgery_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulatory_surgery_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.266168, "relation_name": "dev_thuxuan.claims_preprocessing._int_ambulatory_surgery_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Ambulatory Surgery' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('24')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere a.claim_type = 'professional'\n and a.place_of_service_code in ('24')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__combined_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "unique_id": "model.the_tuva_project.service_category__combined_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_institutional"], "alias": "_int_combined_institutional", "checksum": {"name": "sha256", "checksum": "6b586aac1db9cb5169af1b6a31ee51e56371b33871c5af89752ad32a9ce97df2"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2544868, "relation_name": "dev_thuxuan.claims_preprocessing._int_combined_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith duplicate_bill_types as (\r\nselect distinct\r\n claim_id\r\n, 'Other' as service_category_2\r\nfrom {{ ref('service_category__duplicate_bill_types') }}\r\n)\r\n\r\n, combine as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_institutional') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n, service_category_2\r\nfrom duplicate_bill_types\r\n\r\nunion all\r\n\r\nselect\r\n a.claim_id\r\n, a.service_category_2\r\nfrom combine a\r\nleft join duplicate_bill_types b\r\n on a.claim_id = b.claim_id\r\nwhere b.claim_id is null", "language": "sql", "refs": [{"name": "service_category__duplicate_bill_types", "package": null, "version": null}, {"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}, {"name": "service_category__dialysis_institutional", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__home_health_institutional", "package": null, "version": null}, {"name": "service_category__hospice_institutional", "package": null, "version": null}, {"name": "service_category__lab_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_institutional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "compiled": true, "compiled_code": "\n\nwith duplicate_bill_types as (\nselect distinct\n claim_id\n, 'Other' as service_category_2\nfrom dev_thuxuan.claims_preprocessing._int_duplicate_bill_types\n)\n\n, combine as (\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_dialysis_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_home_health_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_hospice_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_lab_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_skilled_nursing_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_urgent_care_institutional\n)\n\nselect\n claim_id\n, service_category_2\nfrom duplicate_bill_types\n\nunion all\n\nselect\n a.claim_id\n, a.service_category_2\nfrom combine a\nleft join duplicate_bill_types b\n on a.claim_id = b.claim_id\nwhere b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__combined_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "unique_id": "model.the_tuva_project.service_category__combined_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_professional"], "alias": "_int_combined_professional", "checksum": {"name": "sha256", "checksum": "aa2935b0a4b30bf3b309127c4ff3974eebe516c7a7ff0869112c848cc2dc2031"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2505639, "relation_name": "dev_thuxuan.claims_preprocessing._int_combined_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith combined as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__ambulatory_surgery_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__office_visit_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_professional') }}\r\n)\r\n\r\nselect \r\n claim_id\r\n, claim_line_number\r\n, service_category_2\r\n, tuva_last_run\r\nfrom {{ ref('service_category__dme_professional') }}\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom {{ ref('service_category__ambulance_professional') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom combined a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nleft join {{ ref('service_category__ambulance_professional') }} c\r\n on a.claim_id = c.claim_id\r\n and a.claim_line_number = c.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n and (c.claim_id is null and c.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__acute_inpatient_professional", "package": null, "version": null}, {"name": "service_category__ambulatory_surgery_professional", "package": null, "version": null}, {"name": "service_category__dialysis_professional", "package": null, "version": null}, {"name": "service_category__emergency_department_professional", "package": null, "version": null}, {"name": "service_category__home_health_professional", "package": null, "version": null}, {"name": "service_category__hospice_professional", "package": null, "version": null}, {"name": "service_category__inpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__inpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__lab_professional", "package": null, "version": null}, {"name": "service_category__office_visit_professional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_professional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__outpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_professional", "package": null, "version": null}, {"name": "service_category__urgent_care_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "compiled": true, "compiled_code": "\n\nwith combined as (\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_ambulatory_surgery_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_dialysis_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_home_health_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_hospice_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_inpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_inpatient_rehab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_lab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_office_visit_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_rehab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_skilled_nursing_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_urgent_care_professional\n)\n\nselect \n claim_id\n, claim_line_number\n, service_category_2\n, tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_dme_professional\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_ambulance_professional a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom combined a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_ambulance_professional c\n on a.claim_id = c.claim_id\n and a.claim_line_number = c.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n and (c.claim_id is null and c.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dialysis_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_institutional"], "alias": "_int_dialysis_institutional", "checksum": {"name": "sha256", "checksum": "53a54afb920b8af8a86e3dd8b0f7767d1b072a5d8b0b06d36df8891b0e5c6df1"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2692566, "relation_name": "dev_thuxuan.claims_preprocessing._int_dialysis_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('72')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('72')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dialysis_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_professional"], "alias": "_int_dialysis_professional", "checksum": {"name": "sha256", "checksum": "f72ea80a80c59536c72040b42e646d51e9aac2ac3d21fc806bc4c40d2b8bb286"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.272253, "relation_name": "dev_thuxuan.claims_preprocessing._int_dialysis_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('65')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('65')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dme_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dme_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "unique_id": "model.the_tuva_project.service_category__dme_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dme_professional"], "alias": "_int_dme_professional", "checksum": {"name": "sha256", "checksum": "0133c48459f92ce84f6c5d81612864d7f8d635bd350f0010bd14af2b83f3fe17"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dme_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2752807, "relation_name": "dev_thuxuan.claims_preprocessing._int_dme_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Durable Medical Equipment' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code between 'E0100' and 'E8002'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and hcpcs_code between 'E0100' and 'E8002'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__duplicate_bill_types": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__duplicate_bill_types", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__duplicate_bill_types"], "alias": "_int_duplicate_bill_types", "checksum": {"name": "sha256", "checksum": "5bd727d92e88b8c292df5113cda3c5f8598d68a99f1369229daa4880e3e00e07"}, "config": {"enabled": true, "alias": "_int_duplicate_bill_types", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_duplicate_bill_types", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3379111, "relation_name": "dev_thuxuan.claims_preprocessing._int_duplicate_bill_types", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n claim_id\r\n, count(distinct bill_type_code) as cnt\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct\n claim_id\n, count(distinct bill_type_code) as cnt\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct bill_type_code) > 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__emergency_department_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_institutional"], "alias": "_int_emergency_department_institutional", "checksum": {"name": "sha256", "checksum": "d79b109000698551879ece14b396e2a33452e66ee680842d65b5d5163318c615"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2782638, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n med.claim_id\r\n , 'Emergency Department' as service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} med\r\nleft join {{ ref('service_category__acute_inpatient_institutional') }} inpatient\r\n on med.claim_id = inpatient.claim_id\r\nwhere claim_type = 'institutional'\r\nand revenue_center_code in ('0450','0451','0452','0459','0981')\r\nand inpatient.claim_id is null\r\n-- 0456, urgent care, is included in most published definitions\r\n-- that also include a requirement of a bill type code for\r\n-- inpatient or outpatient hospital.", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__acute_inpatient_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n med.claim_id\n , 'Emergency Department' as service_category_2\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim med\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional inpatient\n on med.claim_id = inpatient.claim_id\nwhere claim_type = 'institutional'\nand revenue_center_code in ('0450','0451','0452','0459','0981')\nand inpatient.claim_id is null\n-- 0456, urgent care, is included in most published definitions\n-- that also include a requirement of a bill type code for\n-- inpatient or outpatient hospital.", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__emergency_department_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "unique_id": "model.the_tuva_project.service_category__emergency_department_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_professional"], "alias": "_int_emergency_department_professional", "checksum": {"name": "sha256", "checksum": "b580a63fbab372247bd06ea2f0caa741d0b0bb08f882d1f451f77b67a5211e6a"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2812576, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Emergency Department' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '23'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '23'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__home_health_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_institutional"], "alias": "_int_home_health_institutional", "checksum": {"name": "sha256", "checksum": "ebd81a79d14801ed4c0af878ce7dc23da8cc751f7d283e9beea5973116689559"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2835958, "relation_name": "dev_thuxuan.claims_preprocessing._int_home_health_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('31','32','33')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Home Health' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('31','32','33')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__home_health_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_professional"], "alias": "_int_home_health_professional", "checksum": {"name": "sha256", "checksum": "e3e4cc0fb7ae937d0ecc34b62fabd17150be8e71149e41005e12f8d8bf578f19"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2875671, "relation_name": "dev_thuxuan.claims_preprocessing._int_home_health_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('12')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere a.claim_type = 'professional'\n and a.place_of_service_code in ('12')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__hospice_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_institutional"], "alias": "_int_hospice_institutional", "checksum": {"name": "sha256", "checksum": "198820bc2d29eea3366ecc8a92644499cb01f51d6de7f07ba814eca2b9fb5cbf"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2905734, "relation_name": "dev_thuxuan.claims_preprocessing._int_hospice_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('81','82')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Hospice' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('81','82')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__hospice_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_professional"], "alias": "_int_hospice_professional", "checksum": {"name": "sha256", "checksum": "7865625a277befde407037864c2a6b33ccf5b50c76ecff7345804a08a209023f"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2925832, "relation_name": "dev_thuxuan.claims_preprocessing._int_hospice_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('34')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('34')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__inpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_psychiatric_professional"], "alias": "_int_inpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "d68ac752e0e2399538aa77a0f07dfe7accd03642ef783d6017276d299c081ba4"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2955742, "relation_name": "dev_thuxuan.claims_preprocessing._int_inpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('51','55','56')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('51','55','56')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__inpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_rehab_professional"], "alias": "_int_inpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "62fda1a740ee7c667c1578eb29b029fdb0e37e361e779c4bd593dc5b7b9ab67c"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.2991738, "relation_name": "dev_thuxuan.claims_preprocessing._int_inpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('61')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('61')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__lab_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "unique_id": "model.the_tuva_project.service_category__lab_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_institutional"], "alias": "_int_lab_institutional", "checksum": {"name": "sha256", "checksum": "f8ecb80b0b86a95c0c65ea2a648c129005d4924eac086e5b749ff64b89a8b442"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.302285, "relation_name": "dev_thuxuan.claims_preprocessing._int_lab_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('14')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Lab' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('14')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__lab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "unique_id": "model.the_tuva_project.service_category__lab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_professional"], "alias": "_int_lab_professional", "checksum": {"name": "sha256", "checksum": "312d673baaf32a48761bb3ba8ad9239c7eae2075932053ac5b2dabc3a5ad67f1"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3052714, "relation_name": "dev_thuxuan.claims_preprocessing._int_lab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '81'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '81'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__office_visit_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "unique_id": "model.the_tuva_project.service_category__office_visit_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__office_visit_professional"], "alias": "_int_office_visit_professional", "checksum": {"name": "sha256", "checksum": "d78727437a58eb4a800d23c44f98919922b46bbca26fab212332a3758d4c4626"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_office_visit_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3082705, "relation_name": "dev_thuxuan.claims_preprocessing._int_office_visit_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Office Visit' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('11','02')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('11','02')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_institutional"], "alias": "_int_outpatient_hospital_or_clinic_institutional", "checksum": {"name": "sha256", "checksum": "88a8421850d8e7f1411e236a4b3a32c8568d10bb60db0a49b73de19b2b2da255"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3102677, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nleft join {{ ref('service_category__urgent_care_institutional') }} c\r\n on a.claim_id = c.claim_id\r\nwhere a.claim_type = 'institutional'\r\n and left(a.bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null\r\n and c.claim_id is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_urgent_care_institutional c\n on a.claim_id = c.claim_id\nwhere a.claim_type = 'institutional'\n and left(a.bill_type_code,2) in ('13','71','73')\n and b.claim_id is null\n and c.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_professional"], "alias": "_int_outpatient_hospital_or_clinic_professional", "checksum": {"name": "sha256", "checksum": "ae41a464978d3b87254bb65ba72ee2db48781353647af9c054662d22ad4946a7"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3132706, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('15','17','19','22','49','50','60','71','72')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('15','17','19','22','49','50','60','71','72')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_institutional"], "alias": "_int_outpatient_psychiatric_institutional", "checksum": {"name": "sha256", "checksum": "03de370b5eaf1bc916100d279c3414cdb0ecc561f9f733c7c7a7e996f632049a"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3169763, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('52')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('52')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_professional"], "alias": "_int_outpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "975f15bc122b7093a2adb339025bfa5bb4df63f03ae980bcb2943ad9f78c3a97"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3199718, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('52','53','57','58')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('52','53','57','58')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_rehab_professional"], "alias": "_int_outpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "04d17dc69eacfcf77b47b4dac4e12662543f8d29b876eff10482ea1309136d3a"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.32367, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('62')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('62')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_institutional"], "alias": "_int_skilled_nursing_institutional", "checksum": {"name": "sha256", "checksum": "61078103bec3d91addc18be1dc25b1a4b6057f9027778743555fbd84cdb0ac7d"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3266451, "relation_name": "dev_thuxuan.claims_preprocessing._int_skilled_nursing_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('21','22')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('21','22')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_professional"], "alias": "_int_skilled_nursing_professional", "checksum": {"name": "sha256", "checksum": "a0ed39cf33ed23eb4deb15b642f09928cfa3ee10df31ec1af53a00a11613e27b"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3286486, "relation_name": "dev_thuxuan.claims_preprocessing._int_skilled_nursing_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('31','32')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere claim_type = 'professional'\n and place_of_service_code in ('31','32')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__urgent_care_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_institutional"], "alias": "_int_urgent_care_institutional", "checksum": {"name": "sha256", "checksum": "a285051f080554005f2a4853edc72d229f115a2a6b87ab6391cc2abd13fba901"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3316534, "relation_name": "dev_thuxuan.claims_preprocessing._int_urgent_care_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code = '0456'\r\n and left(bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, 'Urgent Care' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')\n and b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__urgent_care_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "unique_id": "model.the_tuva_project.service_category__urgent_care_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_professional"], "alias": "_int_urgent_care_professional", "checksum": {"name": "sha256", "checksum": "895cc40f7c935fb2e43fd16cf23b912589558fd452317658d7184ebcdbe9053b"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3348193, "relation_name": "dev_thuxuan.claims_preprocessing._int_urgent_care_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('20')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('20')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "service_category__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.service_category__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "staging", "service_category__stg_medical_claim"], "alias": "service_category__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "3ea2fb3af455a48075ea492797a8ed1f3da6997ff73dcaa4b7c60faeb1012aa8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.3399112, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\nAPR_DRG_CODE,\r\nBILL_TYPE_CODE,\r\nCLAIM_ID,\r\nCLAIM_LINE_NUMBER,\r\nCLAIM_TYPE,\r\nHCPCS_CODE,\r\nMS_DRG_CODE,\r\nPLACE_OF_SERVICE_CODE,\r\nREVENUE_CENTER_CODE,\r\n'{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.value_set_member_relevant_fields": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "value_set_member_relevant_fields", "resource_type": "model", "package_name": "the_tuva_project", "path": "clinical_concept_library\\value_set_member_relevant_fields.sql", "original_file_path": "models\\clinical_concept_library\\value_set_member_relevant_fields.sql", "unique_id": "model.the_tuva_project.value_set_member_relevant_fields", "fqn": ["the_tuva_project", "clinical_concept_library", "value_set_member_relevant_fields"], "alias": "value_set_member_relevant_fields", "checksum": {"name": "sha256", "checksum": "320cea5b4108a9b6991e407e58ac5f78c090d5c4c6395b1f098c631301a9cd86"}, "config": {"enabled": true, "alias": "value_set_member_relevant_fields", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "This model creates one record per value set member, but it includes relevant fields for each value set member taken from the clnical_concepts and coding_systems tables.\n", "columns": {"concept_id": {"name": "concept_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "concept_name": {"name": "concept_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "concept_type": {"name": "concept_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "value_set_member_id": {"name": "value_set_member_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coding_system_id": {"name": "coding_system_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "include_descendants": {"name": "include_descendants", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coding_system_name": {"name": "coding_system_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\clinical_concept_library\\clinical_concept_library_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "clinical_concept_library", "alias": "value_set_member_relevant_fields", "tags": ["clinical_concept_library"], "materialized": "table", "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.494769, "relation_name": "dev_thuxuan.clinical_concept_library.value_set_member_relevant_fields", "raw_code": "with value_set_member_relevant_fields as (\r\nselect \r\n aa.concept_id,\r\n aa.concept_name,\r\n aa.concept_type,\r\n \r\n bb.value_set_member_id,\r\n bb.code,\r\n bb.coding_system_id,\r\n bb.include_descendants,\r\n\r\n cc.coding_system_name\r\n \r\nfrom {{ ref('clinical_concepts') }} aa\r\n\r\nleft join {{ ref('value_set_members') }} bb\r\non aa.concept_id = bb.concept_id\r\n\r\nleft join {{ ref('coding_systems') }} cc\r\non bb.coding_system_id = cc.coding_system_id\r\n)\r\n\r\n\r\nselect *\r\nfrom value_set_member_relevant_fields", "language": "sql", "refs": [{"name": "clinical_concepts", "package": null, "version": null}, {"name": "value_set_members", "package": null, "version": null}, {"name": "coding_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.clinical_concepts", "seed.the_tuva_project.value_set_members", "seed.the_tuva_project.coding_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\clinical_concept_library\\value_set_member_relevant_fields.sql", "compiled": true, "compiled_code": "with value_set_member_relevant_fields as (\nselect \n aa.concept_id,\n aa.concept_name,\n aa.concept_type,\n \n bb.value_set_member_id,\n bb.code,\n bb.coding_system_id,\n bb.include_descendants,\n\n cc.coding_system_name\n \nfrom dev_thuxuan.clinical_concept_library.clinical_concepts aa\n\nleft join dev_thuxuan.clinical_concept_library.value_set_members bb\non aa.concept_id = bb.concept_id\n\nleft join dev_thuxuan.clinical_concept_library.coding_systems cc\non bb.coding_system_id = cc.coding_system_id\n)\n\n\nselect *\nfrom value_set_member_relevant_fields", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "original_file_path": "models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_factors"], "alias": "patient_risk_factors", "checksum": {"name": "sha256", "checksum": "1f814b9d282b840bcb1b41cbb8b23dc5f18466bff4aa56ff04b2d3f88aa708c5"}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.500194, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith demographic_factors as (\r\n\r\n select\r\n patient_id\r\n /* concatenate demographic risk factors */\r\n , gender\r\n || ', '\r\n || age_group\r\n || ' Years'\r\n || ', '\r\n || enrollment_status\r\n || ' Enrollee'\r\n || ', '\r\n || case\r\n when medicaid_status = 'Yes' then 'Medicaid'\r\n else 'Non-Medicaid'\r\n end\r\n || ', '\r\n || dual_status\r\n || ' Dual'\r\n || ', '\r\n || orec\r\n || ', '\r\n || case\r\n when institutional_status = 'Yes' then 'Institutional'\r\n else 'Non-Institutional'\r\n end\r\n as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, demographic_defaults as (\r\n\r\n select\r\n patient_id\r\n , model_version\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, disease_factors as (\r\n\r\n select\r\n patient_id\r\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_factors') }}\r\n\r\n)\r\n\r\n, enrollment_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_enrollment_interaction_factors') }}\r\n\r\n)\r\n\r\n, disabled_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disabled_interaction_factors') }}\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_interaction_factors') }}\r\n\r\n)\r\n\r\n, hcc_counts as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_hcc_count_factors') }}\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from demographic_factors\r\n union all\r\n select * from disease_factors\r\n union all\r\n select * from enrollment_interactions\r\n union all\r\n select * from disabled_interactions\r\n union all\r\n select * from disease_interactions\r\n union all\r\n select * from hcc_counts\r\n\r\n)\r\n\r\n, add_defaults as (\r\n\r\n select\r\n unioned.patient_id\r\n , demographic_defaults.enrollment_status_default\r\n , demographic_defaults.medicaid_dual_status_default\r\n , demographic_defaults.orec_default\r\n , demographic_defaults.institutional_status_default\r\n , unioned.description as risk_factor_description\r\n , unioned.coefficient\r\n , unioned.factor_type\r\n , unioned.model_version\r\n , unioned.payment_year\r\n from unioned\r\n left join demographic_defaults\r\n on unioned.patient_id = demographic_defaults.patient_id\r\n and unioned.model_version = demographic_defaults.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(risk_factor_description as {{ dbt.type_string() }}) as risk_factor_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from add_defaults\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , factor_type\r\n , risk_factor_description\r\n , coefficient\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_factors", "package": null, "version": null}, {"name": "cms_hcc__int_enrollment_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disabled_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_count_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "compiled": true, "compiled_code": "\nwith demographic_factors as (\n\n select\n patient_id\n /* concatenate demographic risk factors */\n , gender\n || ', '\n || age_group\n || ' Years'\n || ', '\n || enrollment_status\n || ' Enrollee'\n || ', '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ', '\n || dual_status\n || ' Dual'\n || ', '\n || orec\n || ', '\n || case\n when institutional_status = 'Yes' then 'Institutional'\n else 'Non-Institutional'\n end\n as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, demographic_defaults as (\n\n select\n patient_id\n , model_version\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, disease_factors as (\n\n select\n patient_id\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disease_factors\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_enrollment_interaction_factors\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disabled_interaction_factors\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disease_interaction_factors\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_hcc_count_factors\n\n)\n\n, unioned as (\n\n select * from demographic_factors\n union all\n select * from disease_factors\n union all\n select * from enrollment_interactions\n union all\n select * from disabled_interactions\n union all\n select * from disease_interactions\n union all\n select * from hcc_counts\n\n)\n\n, add_defaults as (\n\n select\n unioned.patient_id\n , demographic_defaults.enrollment_status_default\n , demographic_defaults.medicaid_dual_status_default\n , demographic_defaults.orec_default\n , demographic_defaults.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\n , unioned.factor_type\n , unioned.model_version\n , unioned.payment_year\n from unioned\n left join demographic_defaults\n on unioned.patient_id = demographic_defaults.patient_id\n and unioned.model_version = demographic_defaults.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast(factor_type as TEXT) as factor_type\n , cast(risk_factor_description as TEXT) as risk_factor_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , factor_type\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_scores", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "original_file_path": "models\\cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_scores"], "alias": "patient_risk_scores", "checksum": {"name": "sha256", "checksum": "899fcdcb2df1cc232c5a28c279758bd98f6def70ec107d11e0abfdd7f5757560"}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model calculates the CMS HCC raw risk score, blended risk score, normalized risk score, and payment risk score for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "v24_risk_score": {"name": "v24_risk_score", "description": "The sum of all patient risk factors from model version CMS-HCC-V24. If payment year >= 2024 then the score may be weighted following CMS's transition plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "v28_risk_score": {"name": "v28_risk_score", "description": "The sum of all patient risk factors from model version CMS-HCC-V28. If payment year >= 2024 then the score may be weighted following CMS's transition plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "blended_risk_score": {"name": "blended_risk_score", "description": "The of sum v24_risk_score and v28_risk_score.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The blended risk score divided by the normalization adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_scores", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.504902, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_scores", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith seed_adjustment_rates as (\r\n\r\n select\r\n model_version\r\n , payment_year\r\n , normalization_factor\r\n , ma_coding_pattern_adjustment\r\n from {{ ref('cms_hcc__adjustment_rates') }}\r\n\r\n)\r\n\r\n, risk_factors as (\r\n\r\n select\r\n patient_id\r\n , coefficient\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n)\r\n\r\n, raw_score as (\r\n\r\n select\r\n patient_id\r\n , sum(coefficient) as risk_score\r\n , model_version\r\n , payment_year\r\n from risk_factors\r\n group by\r\n patient_id\r\n , model_version\r\n , payment_year\r\n\r\n)\r\n\r\n/*\r\n CMS Guidance for the transition from v24 to v28:\r\n\r\n PY2024 risk scores will be blended using 67% of the risk score calculated\r\n from v24 and 33% from v28.\r\n\r\n PY2025 risk scores will be blended using 33% of the risk score calculated\r\n from v24 and 67% from v28.\r\n\r\n PY2026 risk scores will be 100% from v28.\r\n\r\n Prior payment years will still be calculated from v24 only.\r\n*/\r\n, transition_scores as (\r\n\r\n select\r\n patient_id\r\n , risk_score\r\n , case\r\n when payment_year <= 2023 and model_version = 'CMS-HCC-V24' then risk_score\r\n when payment_year = 2024 and model_version = 'CMS-HCC-V24' then risk_score * 0.67\r\n when payment_year = 2025 and model_version = 'CMS-HCC-V24' then risk_score * 0.33\r\n when payment_year >= 2026 and model_version = 'CMS-HCC-V24' then 0\r\n end as v24_risk_score\r\n , case\r\n when payment_year <= 2023 and model_version = 'CMS-HCC-V28' then 0\r\n when payment_year = 2024 and model_version = 'CMS-HCC-V28' then risk_score * 0.33\r\n when payment_year = 2025 and model_version = 'CMS-HCC-V28' then risk_score * 0.67\r\n when payment_year >= 2026 and model_version = 'CMS-HCC-V28' then risk_score\r\n end as v28_risk_score\r\n , model_version\r\n , payment_year\r\n from raw_score\r\n\r\n)\r\n\r\n/*\r\n Grouping by patient to create a single row per patient.\r\n*/\r\n, transition_scores_grouped as (\r\n\r\n select\r\n patient_id\r\n , max(v24_risk_score) as v24_risk_score\r\n , max(v28_risk_score) as v28_risk_score\r\n , payment_year\r\n from transition_scores\r\n group by\r\n patient_id\r\n , payment_year\r\n\r\n)\r\n\r\n, blended as (\r\n\r\n select\r\n patient_id\r\n , v24_risk_score\r\n , v28_risk_score\r\n , v24_risk_score + v28_risk_score as blended_risk_score\r\n , payment_year\r\n from transition_scores_grouped\r\n\r\n)\r\n\r\n, normalized as (\r\n\r\n select\r\n blended.patient_id\r\n , blended.v24_risk_score\r\n , blended.v28_risk_score\r\n , blended.blended_risk_score\r\n , blended.blended_risk_score / seed_adjustment_rates.normalization_factor as normalized_risk_score\r\n , blended.payment_year\r\n from blended\r\n left join seed_adjustment_rates\r\n on blended.payment_year = seed_adjustment_rates.payment_year\r\n\r\n)\r\n\r\n, payment as (\r\n\r\n select\r\n normalized.patient_id\r\n , normalized.v24_risk_score\r\n , normalized.v28_risk_score\r\n , normalized.blended_risk_score\r\n , normalized.normalized_risk_score\r\n , normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as payment_risk_score\r\n , normalized.payment_year\r\n from normalized\r\n left join seed_adjustment_rates\r\n on normalized.payment_year = seed_adjustment_rates.payment_year\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , round(cast(v24_risk_score as {{ dbt.type_numeric() }}),3) as v24_risk_score\r\n , round(cast(v28_risk_score as {{ dbt.type_numeric() }}),3) as v28_risk_score\r\n , round(cast(blended_risk_score as {{ dbt.type_numeric() }}),3) as blended_risk_score\r\n , round(cast(normalized_risk_score as {{ dbt.type_numeric() }}),3) as normalized_risk_score\r\n , round(cast(payment_risk_score as {{ dbt.type_numeric() }}),3) as payment_risk_score\r\n , cast(payment_year as integer) as payment_year\r\n from payment\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , v24_risk_score\r\n , v28_risk_score\r\n , blended_risk_score\r\n , normalized_risk_score\r\n , payment_risk_score\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__adjustment_rates", "package": null, "version": null}, {"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["seed.the_tuva_project.cms_hcc__adjustment_rates", "model.the_tuva_project.cms_hcc__patient_risk_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "compiled": true, "compiled_code": "\nwith seed_adjustment_rates as (\n\n select\n model_version\n , payment_year\n , normalization_factor\n , ma_coding_pattern_adjustment\n from dev_thuxuan.cms_hcc._value_set_adjustment_rates\n\n)\n\n, risk_factors as (\n\n select\n patient_id\n , coefficient\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc.patient_risk_factors\n\n)\n\n, raw_score as (\n\n select\n patient_id\n , sum(coefficient) as risk_score\n , model_version\n , payment_year\n from risk_factors\n group by\n patient_id\n , model_version\n , payment_year\n\n)\n\n/*\n CMS Guidance for the transition from v24 to v28:\n\n PY2024 risk scores will be blended using 67% of the risk score calculated\n from v24 and 33% from v28.\n\n PY2025 risk scores will be blended using 33% of the risk score calculated\n from v24 and 67% from v28.\n\n PY2026 risk scores will be 100% from v28.\n\n Prior payment years will still be calculated from v24 only.\n*/\n, transition_scores as (\n\n select\n patient_id\n , risk_score\n , case\n when payment_year <= 2023 and model_version = 'CMS-HCC-V24' then risk_score\n when payment_year = 2024 and model_version = 'CMS-HCC-V24' then risk_score * 0.67\n when payment_year = 2025 and model_version = 'CMS-HCC-V24' then risk_score * 0.33\n when payment_year >= 2026 and model_version = 'CMS-HCC-V24' then 0\n end as v24_risk_score\n , case\n when payment_year <= 2023 and model_version = 'CMS-HCC-V28' then 0\n when payment_year = 2024 and model_version = 'CMS-HCC-V28' then risk_score * 0.33\n when payment_year = 2025 and model_version = 'CMS-HCC-V28' then risk_score * 0.67\n when payment_year >= 2026 and model_version = 'CMS-HCC-V28' then risk_score\n end as v28_risk_score\n , model_version\n , payment_year\n from raw_score\n\n)\n\n/*\n Grouping by patient to create a single row per patient.\n*/\n, transition_scores_grouped as (\n\n select\n patient_id\n , max(v24_risk_score) as v24_risk_score\n , max(v28_risk_score) as v28_risk_score\n , payment_year\n from transition_scores\n group by\n patient_id\n , payment_year\n\n)\n\n, blended as (\n\n select\n patient_id\n , v24_risk_score\n , v28_risk_score\n , v24_risk_score + v28_risk_score as blended_risk_score\n , payment_year\n from transition_scores_grouped\n\n)\n\n, normalized as (\n\n select\n blended.patient_id\n , blended.v24_risk_score\n , blended.v28_risk_score\n , blended.blended_risk_score\n , blended.blended_risk_score / seed_adjustment_rates.normalization_factor as normalized_risk_score\n , blended.payment_year\n from blended\n left join seed_adjustment_rates\n on blended.payment_year = seed_adjustment_rates.payment_year\n\n)\n\n, payment as (\n\n select\n normalized.patient_id\n , normalized.v24_risk_score\n , normalized.v28_risk_score\n , normalized.blended_risk_score\n , normalized.normalized_risk_score\n , normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as payment_risk_score\n , normalized.payment_year\n from normalized\n left join seed_adjustment_rates\n on normalized.payment_year = seed_adjustment_rates.payment_year\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , round(cast(v24_risk_score as numeric(28,6)),3) as v24_risk_score\n , round(cast(v28_risk_score as numeric(28,6)),3) as v28_risk_score\n , round(cast(blended_risk_score as numeric(28,6)),3) as blended_risk_score\n , round(cast(normalized_risk_score as numeric(28,6)),3) as normalized_risk_score\n , round(cast(payment_risk_score as numeric(28,6)),3) as payment_risk_score\n , cast(payment_year as integer) as payment_year\n from payment\n\n)\n\nselect\n patient_id\n , v24_risk_score\n , v28_risk_score\n , blended_risk_score\n , normalized_risk_score\n , payment_risk_score\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_demographic_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_demographic_factors"], "alias": "_int_demographic_factors", "checksum": {"name": "sha256", "checksum": "1995fd5afcd5d0be7b7fd04ea806beecbecee294c92e57a761a2d173b74f5e96"}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_demographic_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5109098, "relation_name": "dev_thuxuan.cms_hcc._int_demographic_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith members as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , payment_year\r\n from {{ ref('cms_hcc__int_members') }}\r\n\r\n)\r\n\r\n, seed_demographic_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , coefficient\r\n from {{ ref('cms_hcc__demographic_factors') }}\r\n where plan_segment is null /* data not available */\r\n\r\n)\r\n\r\n, v24_new_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.orec = seed_demographic_factors.orec\r\n where members.enrollment_status = 'New'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\r\n\r\n)\r\n\r\n, v24_continuining_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.dual_status = seed_demographic_factors.dual_status\r\n and members.orec = seed_demographic_factors.orec\r\n and members.institutional_status = seed_demographic_factors.institutional_status\r\n where members.enrollment_status = 'Continuing'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\r\n\r\n)\r\n\r\n, v28_new_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.orec = seed_demographic_factors.orec\r\n where members.enrollment_status = 'New'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\r\n\r\n)\r\n\r\n, v28_continuining_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.dual_status = seed_demographic_factors.dual_status\r\n and members.orec = seed_demographic_factors.orec\r\n and members.institutional_status = seed_demographic_factors.institutional_status\r\n where members.enrollment_status = 'Continuing'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from v24_new_enrollees\r\n union all\r\n select * from v24_continuining_enrollees\r\n union all\r\n select * from v28_new_enrollees\r\n union all\r\n select * from v28_continuining_enrollees\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}, {"name": "cms_hcc__demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "compiled": true, "compiled_code": "\n\nwith members as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , payment_year\n from dev_thuxuan.cms_hcc._int_members\n\n)\n\n, seed_demographic_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_demographic_factors\n where plan_segment is null /* data not available */\n\n)\n\n, v24_new_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\n\n)\n\n, v24_continuining_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\n\n)\n\n, v28_new_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\n\n)\n\n, v28_continuining_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\n\n)\n\n, unioned as (\n\n select * from v24_new_enrollees\n union all\n select * from v24_continuining_enrollees\n union all\n select * from v28_new_enrollees\n union all\n select * from v28_continuining_enrollees\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disabled_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disabled_interaction_factors"], "alias": "_int_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "bb7334a46c4c24e1b5ec730fea92ae01b26f86829fcd3b9c6f3cb214fcc23f5e"}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disabled_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.515417, "relation_name": "dev_thuxuan.cms_hcc._int_disabled_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code\r\n , coefficient\r\n from {{ ref('cms_hcc__disabled_interaction_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, interactions as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors\r\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\r\n and demographics_with_hccs.model_version = seed_interaction_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\nfrom interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disabled_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disabled_interaction_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, interactions as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\n and demographics_with_hccs.model_version = seed_interaction_factors.model_version\n\n)\n\n, add_data_types as (\n\nselect\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disease_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_factors"], "alias": "_int_disease_factors", "checksum": {"name": "sha256", "checksum": "60cc48c746b9acb0f084556be562643b95bf8c385a39f02666dfd29d103b4d7c"}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5195088, "relation_name": "dev_thuxuan.cms_hcc._int_disease_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_disease_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , hcc_code\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.gender\r\n , demographics.age_group\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, disease_factors as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.hcc_code\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , seed_disease_factors.factor_type\r\n , seed_disease_factors.description\r\n , seed_disease_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_disease_factors\r\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\r\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\r\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\r\n and demographics_with_hccs.orec = seed_disease_factors.orec\r\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\r\n and demographics_with_hccs.model_version = seed_disease_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(description as {{ dbt.type_string() }}) as hcc_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_factors\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disease_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.gender\n , demographics.age_group\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, disease_factors as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.hcc_code\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , seed_disease_factors.factor_type\n , seed_disease_factors.description\n , seed_disease_factors.coefficient\n from demographics_with_hccs\n inner join seed_disease_factors\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\n and demographics_with_hccs.orec = seed_disease_factors.orec\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\n and demographics_with_hccs.model_version = seed_disease_factors.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code as TEXT) as hcc_code\n , cast(description as TEXT) as hcc_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disease_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_interaction_factors"], "alias": "_int_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "77782562a534045d65be9e12788f9a96823f349ae7654c3ff6780ce1e7248062"}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5242357, "relation_name": "dev_thuxuan.cms_hcc._int_disease_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code_1\r\n , hcc_code_2\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_interaction_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, demographics_with_interactions as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , interactions_code_1.factor_type\r\n , interactions_code_1.description\r\n , interactions_code_1.hcc_code_1\r\n , interactions_code_1.hcc_code_2\r\n , interactions_code_1.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors as interactions_code_1\r\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\r\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\r\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\r\n and demographics_with_hccs.orec = interactions_code_1.orec\r\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\r\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\r\n and demographics_with_hccs.model_version = interactions_code_1.model_version\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n demographics_with_interactions.patient_id\r\n , demographics_with_interactions.factor_type\r\n , demographics_with_interactions.hcc_code_1\r\n , demographics_with_interactions.hcc_code_2\r\n , demographics_with_interactions.description\r\n , demographics_with_interactions.coefficient\r\n , demographics_with_interactions.model_version\r\n , demographics_with_interactions.payment_year\r\n from demographics_with_interactions\r\n inner join demographics_with_hccs as interactions_code_2\r\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\r\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\r\n and demographics_with_interactions.model_version = interactions_code_2.model_version\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code_1 as {{ dbt.type_string() }}) as hcc_code_1\r\n , cast(hcc_code_2 as {{ dbt.type_string() }}) as hcc_code_2\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code_1\r\n , hcc_code_2\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , short_name\n , description\n , hcc_code_1\n , hcc_code_2\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disease_interaction_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, demographics_with_interactions as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , interactions_code_1.factor_type\n , interactions_code_1.description\n , interactions_code_1.hcc_code_1\n , interactions_code_1.hcc_code_2\n , interactions_code_1.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors as interactions_code_1\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\n and demographics_with_hccs.orec = interactions_code_1.orec\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\n and demographics_with_hccs.model_version = interactions_code_1.model_version\n\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\n , demographics_with_interactions.factor_type\n , demographics_with_interactions.hcc_code_1\n , demographics_with_interactions.hcc_code_2\n , demographics_with_interactions.description\n , demographics_with_interactions.coefficient\n , demographics_with_interactions.model_version\n , demographics_with_interactions.payment_year\n from demographics_with_interactions\n inner join demographics_with_hccs as interactions_code_2\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\n and demographics_with_interactions.model_version = interactions_code_2.model_version\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code_1 as TEXT) as hcc_code_1\n , cast(hcc_code_2 as TEXT) as hcc_code_2\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_eligible_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_eligible_conditions"], "alias": "_int_eligible_conditions", "checksum": {"name": "sha256", "checksum": "44306b4f6eede93be3d7b6eb2d26d7983a68d54b0c24d303cd9e5086da0badc4"}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_eligible_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5282161, "relation_name": "dev_thuxuan.cms_hcc._int_eligible_conditions", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for staging condition data:\r\n 1) Filter to risk-adjustable claims per claim type for the collection year.\r\n 2) Gather diagnosis codes from condition for the eligible claims.\r\n 3) Map and filter diagnosis codes to HCCs\r\n\r\nClaims filtering logic:\r\n - Professional:\r\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\r\n - Inpatient:\r\n - Bill type code in (11X, 41X)\r\n - Outpatient:\r\n - Bill type code in (12X, 13X, 43X, 71X, 73X, 76X, 77X, 85X)\r\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\r\n\r\nJinja is used to set payment year variable.\r\n - The payment_year var has been set here so it gets compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set payment_year = var('cms_hcc_payment_year') | int() -%}\r\n{% set collection_year = payment_year - 1 -%}\r\n\r\nwith medical_claims as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , bill_type_code\r\n , hcpcs_code\r\n from {{ ref('cms_hcc__stg_core__medical_claim') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n claim_id\r\n , patient_id\r\n , code\r\n from {{ ref('cms_hcc__stg_core__condition') }}\r\n where code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, cpt_hcpcs_list as (\r\n\r\n select\r\n payment_year\r\n , hcpcs_cpt_code\r\n from {{ ref('cms_hcc__cpt_hcpcs') }}\r\n\r\n)\r\n\r\n, professional_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n inner join cpt_hcpcs_list\r\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\r\n where claim_type = 'professional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and cpt_hcpcs_list.payment_year = {{ payment_year }}\r\n\r\n)\r\n\r\n, inpatient_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n where claim_type = 'institutional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and left(bill_type_code,2) in ('11','41')\r\n\r\n)\r\n\r\n, outpatient_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n inner join cpt_hcpcs_list\r\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\r\n where claim_type = 'institutional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and cpt_hcpcs_list.payment_year = {{ payment_year }}\r\n and left(bill_type_code,2) in ('12','13','43','71','73','76','77','85')\r\n\r\n)\r\n\r\n, eligible_claims as (\r\n\r\n select * from professional_claims\r\n union all\r\n select * from inpatient_claims\r\n union all\r\n select * from outpatient_claims\r\n\r\n)\r\n\r\n, eligible_conditions as (\r\n\r\n select distinct\r\n eligible_claims.claim_id\r\n , eligible_claims.patient_id\r\n , conditions.code\r\n from eligible_claims\r\n inner join conditions\r\n on eligible_claims.claim_id = conditions.claim_id\r\n and eligible_claims.patient_id = conditions.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(code as {{ dbt.type_string() }}) as condition_code\r\n , cast('{{ payment_year }}' as integer) as payment_year\r\n from eligible_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__stg_core__medical_claim", "package": null, "version": null}, {"name": "cms_hcc__stg_core__condition", "package": null, "version": null}, {"name": "cms_hcc__cpt_hcpcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "compiled": true, "compiled_code": "\n/*\nSteps for staging condition data:\n 1) Filter to risk-adjustable claims per claim type for the collection year.\n 2) Gather diagnosis codes from condition for the eligible claims.\n 3) Map and filter diagnosis codes to HCCs\n\nClaims filtering logic:\n - Professional:\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n - Inpatient:\n - Bill type code in (11X, 41X)\n - Outpatient:\n - Bill type code in (12X, 13X, 43X, 71X, 73X, 76X, 77X, 85X)\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n\nJinja is used to set payment year variable.\n - The payment_year var has been set here so it gets compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n), __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n),medical_claims as (\n\n select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n from __dbt__cte__cms_hcc__stg_core__medical_claim\n\n)\n\n, conditions as (\n\n select\n claim_id\n , patient_id\n , code\n from __dbt__cte__cms_hcc__stg_core__condition\n where code_type = 'icd-10-cm'\n\n)\n\n, cpt_hcpcs_list as (\n\n select\n payment_year\n , hcpcs_cpt_code\n from dev_thuxuan.cms_hcc._value_set_cpt_hcpcs\n\n)\n\n, professional_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n inner join cpt_hcpcs_list\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\n where claim_type = 'professional'\n and extract(year from claim_end_date) = 2023\n and cpt_hcpcs_list.payment_year = 2024\n\n)\n\n, inpatient_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n where claim_type = 'institutional'\n and extract(year from claim_end_date) = 2023\n and left(bill_type_code,2) in ('11','41')\n\n)\n\n, outpatient_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n inner join cpt_hcpcs_list\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\n where claim_type = 'institutional'\n and extract(year from claim_end_date) = 2023\n and cpt_hcpcs_list.payment_year = 2024\n and left(bill_type_code,2) in ('12','13','43','71','73','76','77','85')\n\n)\n\n, eligible_claims as (\n\n select * from professional_claims\n union all\n select * from inpatient_claims\n union all\n select * from outpatient_claims\n\n)\n\n, eligible_conditions as (\n\n select distinct\n eligible_claims.claim_id\n , eligible_claims.patient_id\n , conditions.code\n from eligible_claims\n inner join conditions\n on eligible_claims.claim_id = conditions.claim_id\n and eligible_claims.patient_id = conditions.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(code as TEXT) as condition_code\n , cast('2024' as integer) as payment_year\n from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "sql": " __dbt__cte__cms_hcc__stg_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__condition", "sql": " __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_enrollment_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_enrollment_interaction_factors"], "alias": "_int_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "1da4291b9f54c5779672c3849bf0113ca14c1b9589d340e7e227ed4022b2ba78"}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_enrollment_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.532802, "relation_name": "dev_thuxuan.cms_hcc._int_enrollment_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , gender\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , institutional_status\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\r\n\r\n)\r\n\r\n/*\r\n Originally disabled interactions for non-institutional members >= 65\r\n*/\r\n, non_institutional_interactions as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.gender = seed_interaction_factors.gender\r\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\r\n and demographics.dual_status = seed_interaction_factors.dual_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics.model_version = seed_interaction_factors.model_version\r\n where demographics.institutional_status = 'No'\r\n and demographics.orec = 'Disabled'\r\n and demographics.age_group in (\r\n '65-69'\r\n , '70-74'\r\n , '75-79'\r\n , '80-84'\r\n , '85-89'\r\n , '90-94'\r\n , '>=95'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Medicaid interactions for institutional members\r\n*/\r\n, institutional_interactions as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics.model_version = seed_interaction_factors.model_version\r\n where demographics.institutional_status = 'Yes'\r\n and demographics.medicaid_status = 'Yes'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from non_institutional_interactions\r\n union all\r\n select * from institutional_interactions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__enrollment_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , institutional_status\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_enrollment_interaction_factors\n\n)\n\n/*\n Originally disabled interactions for non-institutional members >= 65\n*/\n, non_institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.gender = seed_interaction_factors.gender\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\n and demographics.dual_status = seed_interaction_factors.dual_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n and demographics.model_version = seed_interaction_factors.model_version\n where demographics.institutional_status = 'No'\n and demographics.orec = 'Disabled'\n and demographics.age_group in (\n '65-69'\n , '70-74'\n , '75-79'\n , '80-84'\n , '85-89'\n , '90-94'\n , '>=95'\n )\n\n)\n\n/*\n Medicaid interactions for institutional members\n*/\n, institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n and demographics.model_version = seed_interaction_factors.model_version\n where demographics.institutional_status = 'Yes'\n and demographics.medicaid_status = 'Yes'\n\n)\n\n, unioned as (\n\n select * from non_institutional_interactions\n union all\n select * from institutional_interactions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_count_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_count_factors"], "alias": "_int_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "57f02526327cfa6caad5937fc0bdbab5f920ddc66be0eb606788ea916a572a29"}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_count_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.536884, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_count_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, seed_payment_hcc_count_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , payment_hcc_count\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__payment_hcc_count_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, demographics_with_hcc_counts as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , count(hcc_hierarchy.hcc_code) as hcc_count\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n group by\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n\r\n)\r\n\r\n, hcc_counts_normalized as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n , case\r\n when hcc_count >= 10 then '>=10'\r\n else cast(hcc_count as {{ dbt.type_string() }})\r\n end as hcc_count_string\r\n from demographics_with_hcc_counts\r\n\r\n)\r\n\r\n, hcc_counts as (\r\n\r\n select\r\n hcc_counts_normalized.patient_id\r\n , hcc_counts_normalized.model_version\r\n , hcc_counts_normalized.payment_year\r\n , seed_payment_hcc_count_factors.factor_type\r\n , seed_payment_hcc_count_factors.description\r\n , seed_payment_hcc_count_factors.coefficient\r\n from hcc_counts_normalized\r\n inner join seed_payment_hcc_count_factors\r\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\r\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\r\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\r\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\r\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\r\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\r\n and hcc_counts_normalized.model_version = seed_payment_hcc_count_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from hcc_counts\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__payment_hcc_count_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_payment_hcc_count_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, demographics_with_hcc_counts as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , count(hcc_hierarchy.hcc_code) as hcc_count\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n group by\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n\n)\n\n, hcc_counts_normalized as (\n\n select\n patient_id\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n , case\n when hcc_count >= 10 then '>=10'\n else cast(hcc_count as TEXT)\n end as hcc_count_string\n from demographics_with_hcc_counts\n\n)\n\n, hcc_counts as (\n\n select\n hcc_counts_normalized.patient_id\n , hcc_counts_normalized.model_version\n , hcc_counts_normalized.payment_year\n , seed_payment_hcc_count_factors.factor_type\n , seed_payment_hcc_count_factors.description\n , seed_payment_hcc_count_factors.coefficient\n from hcc_counts_normalized\n inner join seed_payment_hcc_count_factors\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\n and hcc_counts_normalized.model_version = seed_payment_hcc_count_factors.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_hierarchy", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_hierarchy"], "alias": "_int_hcc_hierarchy", "checksum": {"name": "sha256", "checksum": "f47263e7e8e60e98764011666f8b61adb8c85f3ce58114b85171c23c599cffc9"}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_hierarchy", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5408947, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_hierarchy", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Staging HCCs that will be used in disease factor calculations.\r\n Final output for each CMS model version includes:\r\n - hccs without a hierarchy\r\n - lower-level hccs with hierarchy where top-level hcc is missing\r\n - top-level hccs from hierarchy\r\n*/\r\n\r\nwith hcc_mapping as (\r\n\r\n select distinct\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_hcc_mapping') }}\r\n\r\n)\r\n\r\n, seed_hcc_hierarchy as (\r\n\r\n select\r\n model_version\r\n , hcc_code\r\n , description\r\n , hccs_to_exclude\r\n from {{ ref('cms_hcc__disease_hierarchy') }}\r\n\r\n)\r\n\r\n/*\r\n selecting hccs that do not have a hierarchy\r\n all codes in this cte are included in final output\r\n*/\r\n, hccs_without_hierarchy as (\r\n\r\n select distinct\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n from hcc_mapping\r\n left join seed_hcc_hierarchy as hcc_top_level\r\n on hcc_mapping.hcc_code = hcc_top_level.hcc_code\r\n and hcc_mapping.model_version = hcc_top_level.model_version\r\n left join seed_hcc_hierarchy as hcc_exclusions\r\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\r\n and hcc_mapping.model_version = hcc_exclusions.model_version\r\n where hcc_top_level.hcc_code is null\r\n and hcc_exclusions.hccs_to_exclude is null\r\n\r\n)\r\n\r\n/*\r\n selecting hccs that have a hierarchy to be evaluated in the next cte\r\n*/\r\n, hccs_with_hierarchy as (\r\n\r\n select\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n , seed_hcc_hierarchy.hcc_code as top_level_hcc\r\n from hcc_mapping\r\n inner join seed_hcc_hierarchy\r\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hccs_to_exclude\r\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n/*\r\n applying hcc hierarchy and grouping by patient and hcc\r\n to account for multiple hcc combinations\r\n minimum HCC is included following CMS's severity logic\r\n*/\r\n, hierarchy_applied as (\r\n\r\n select\r\n hccs_with_hierarchy.patient_id\r\n , hccs_with_hierarchy.model_version\r\n , hccs_with_hierarchy.payment_year\r\n , hccs_with_hierarchy.hcc_code\r\n , min(hcc_mapping.hcc_code) as top_level_hcc\r\n from hccs_with_hierarchy\r\n left join hcc_mapping\r\n on hcc_mapping.patient_id = hccs_with_hierarchy.patient_id\r\n and hcc_mapping.hcc_code = hccs_with_hierarchy.top_level_hcc\r\n and hcc_mapping.model_version = hccs_with_hierarchy.model_version\r\n group by\r\n hccs_with_hierarchy.patient_id\r\n , hccs_with_hierarchy.model_version\r\n , hccs_with_hierarchy.payment_year\r\n , hccs_with_hierarchy.hcc_code\r\n\r\n)\r\n\r\n/*\r\n selecting lower-level hccs in hierarchy\r\n all codes in this cte are included in final output\r\n*/\r\n, lower_level_inclusions as (\r\n\r\n select distinct\r\n patient_id\r\n , model_version\r\n , payment_year\r\n , case\r\n when top_level_hcc is not null then top_level_hcc\r\n else hcc_code\r\n end as hcc_code\r\n from hierarchy_applied\r\n\r\n)\r\n\r\n/*\r\n selecting top-level hccs not in previous steps\r\n all codes in this cte are included in final output\r\n*/\r\n, top_level_inclusions as (\r\n\r\n select distinct\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n from hcc_mapping\r\n inner join seed_hcc_hierarchy\r\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hcc_code\r\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\r\n left join lower_level_inclusions\r\n on hcc_mapping.patient_id = lower_level_inclusions.patient_id\r\n and hcc_mapping.hcc_code = lower_level_inclusions.hcc_code\r\n and hcc_mapping.model_version = lower_level_inclusions.model_version\r\n left join hierarchy_applied\r\n on hcc_mapping.patient_id = hierarchy_applied.patient_id\r\n and hcc_mapping.hcc_code = hierarchy_applied.hcc_code\r\n and hcc_mapping.model_version = hierarchy_applied.model_version\r\n where lower_level_inclusions.hcc_code is null\r\n and hierarchy_applied.top_level_hcc is null\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from hccs_without_hierarchy\r\n union all\r\n select * from lower_level_inclusions\r\n union all\r\n select * from top_level_inclusions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , model_version\r\n , payment_year\r\n , hcc_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_hcc_mapping", "package": null, "version": null}, {"name": "cms_hcc__disease_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "compiled": true, "compiled_code": "\n/*\n Staging HCCs that will be used in disease factor calculations.\n Final output for each CMS model version includes:\n - hccs without a hierarchy\n - lower-level hccs with hierarchy where top-level hcc is missing\n - top-level hccs from hierarchy\n*/\n\nwith hcc_mapping as (\n\n select distinct\n patient_id\n , hcc_code\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_hcc_mapping\n\n)\n\n, seed_hcc_hierarchy as (\n\n select\n model_version\n , hcc_code\n , description\n , hccs_to_exclude\n from dev_thuxuan.cms_hcc._value_set_disease_hierarchy\n\n)\n\n/*\n selecting hccs that do not have a hierarchy\n all codes in this cte are included in final output\n*/\n, hccs_without_hierarchy as (\n\n select distinct\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n from hcc_mapping\n left join seed_hcc_hierarchy as hcc_top_level\n on hcc_mapping.hcc_code = hcc_top_level.hcc_code\n and hcc_mapping.model_version = hcc_top_level.model_version\n left join seed_hcc_hierarchy as hcc_exclusions\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\n and hcc_mapping.model_version = hcc_exclusions.model_version\n where hcc_top_level.hcc_code is null\n and hcc_exclusions.hccs_to_exclude is null\n\n)\n\n/*\n selecting hccs that have a hierarchy to be evaluated in the next cte\n*/\n, hccs_with_hierarchy as (\n\n select\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n , seed_hcc_hierarchy.hcc_code as top_level_hcc\n from hcc_mapping\n inner join seed_hcc_hierarchy\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hccs_to_exclude\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\n\n)\n\n/*\n applying hcc hierarchy and grouping by patient and hcc\n to account for multiple hcc combinations\n minimum HCC is included following CMS's severity logic\n*/\n, hierarchy_applied as (\n\n select\n hccs_with_hierarchy.patient_id\n , hccs_with_hierarchy.model_version\n , hccs_with_hierarchy.payment_year\n , hccs_with_hierarchy.hcc_code\n , min(hcc_mapping.hcc_code) as top_level_hcc\n from hccs_with_hierarchy\n left join hcc_mapping\n on hcc_mapping.patient_id = hccs_with_hierarchy.patient_id\n and hcc_mapping.hcc_code = hccs_with_hierarchy.top_level_hcc\n and hcc_mapping.model_version = hccs_with_hierarchy.model_version\n group by\n hccs_with_hierarchy.patient_id\n , hccs_with_hierarchy.model_version\n , hccs_with_hierarchy.payment_year\n , hccs_with_hierarchy.hcc_code\n\n)\n\n/*\n selecting lower-level hccs in hierarchy\n all codes in this cte are included in final output\n*/\n, lower_level_inclusions as (\n\n select distinct\n patient_id\n , model_version\n , payment_year\n , case\n when top_level_hcc is not null then top_level_hcc\n else hcc_code\n end as hcc_code\n from hierarchy_applied\n\n)\n\n/*\n selecting top-level hccs not in previous steps\n all codes in this cte are included in final output\n*/\n, top_level_inclusions as (\n\n select distinct\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n from hcc_mapping\n inner join seed_hcc_hierarchy\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hcc_code\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\n left join lower_level_inclusions\n on hcc_mapping.patient_id = lower_level_inclusions.patient_id\n and hcc_mapping.hcc_code = lower_level_inclusions.hcc_code\n and hcc_mapping.model_version = lower_level_inclusions.model_version\n left join hierarchy_applied\n on hcc_mapping.patient_id = hierarchy_applied.patient_id\n and hcc_mapping.hcc_code = hierarchy_applied.hcc_code\n and hcc_mapping.model_version = hierarchy_applied.model_version\n where lower_level_inclusions.hcc_code is null\n and hierarchy_applied.top_level_hcc is null\n\n)\n\n, unioned as (\n\n select * from hccs_without_hierarchy\n union all\n select * from lower_level_inclusions\n union all\n select * from top_level_inclusions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast(hcc_code as TEXT) as hcc_code\n from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_mapping", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_mapping"], "alias": "_int_hcc_mapping", "checksum": {"name": "sha256", "checksum": "f4dfeb0c413b50052d2bd251d4a35dde91c85e0004400911b8f36979cf651839"}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_mapping", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5448916, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_mapping", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for staging the medical claim data:\r\n 1) Filter to risk-adjustable claims per claim type for the collection year.\r\n 2) Gather diagnosis codes from Condition for the eligible claims.\r\n 3) Map and filter diagnosis codes to HCCs for each CMS model version\r\n 4) Union results from each CMS model version\r\n (note: some payment years may not have results for v28)\r\n*/\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , condition_code\r\n , payment_year\r\n from {{ ref('cms_hcc__int_eligible_conditions') }}\r\n\r\n)\r\n\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n payment_year\r\n , diagnosis_code\r\n , cms_hcc_v24\r\n , cms_hcc_v24_flag\r\n , cms_hcc_v28\r\n , cms_hcc_v28_flag\r\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\r\n\r\n)\r\n\r\n/* casting hcc_code to avoid formatting changes during union */\r\n, v24_mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.payment_year\r\n , 'CMS-HCC-V24' as model_version\r\n , cast(seed_hcc_mapping.cms_hcc_v24 as {{ dbt.type_string() }}) as hcc_code\r\n from conditions\r\n inner join seed_hcc_mapping\r\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\r\n and conditions.payment_year = seed_hcc_mapping.payment_year\r\n where cms_hcc_v24_flag = 'Yes'\r\n\r\n)\r\n\r\n, v28_mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.payment_year\r\n , 'CMS-HCC-V28' as model_version\r\n , cast(seed_hcc_mapping.cms_hcc_v28 as {{ dbt.type_string() }}) as hcc_code\r\n from conditions\r\n inner join seed_hcc_mapping\r\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\r\n and conditions.payment_year = seed_hcc_mapping.payment_year\r\n where cms_hcc_v28_flag = 'Yes'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from v24_mapped\r\n union all\r\n select * from v28_mapped\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(condition_code as {{ dbt.type_string() }}) as condition_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , hcc_code\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}, {"name": "cms_hcc__icd_10_cm_mappings", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "compiled": true, "compiled_code": "\n/*\nSteps for staging the medical claim data:\n 1) Filter to risk-adjustable claims per claim type for the collection year.\n 2) Gather diagnosis codes from Condition for the eligible claims.\n 3) Map and filter diagnosis codes to HCCs for each CMS model version\n 4) Union results from each CMS model version\n (note: some payment years may not have results for v28)\n*/\n\nwith conditions as (\n\n select\n patient_id\n , condition_code\n , payment_year\n from dev_thuxuan.cms_hcc._int_eligible_conditions\n\n)\n\n, seed_hcc_mapping as (\n\n select\n payment_year\n , diagnosis_code\n , cms_hcc_v24\n , cms_hcc_v24_flag\n , cms_hcc_v28\n , cms_hcc_v28_flag\n from dev_thuxuan.cms_hcc._value_set_icd_10_cm_mappings\n\n)\n\n/* casting hcc_code to avoid formatting changes during union */\n, v24_mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.payment_year\n , 'CMS-HCC-V24' as model_version\n , cast(seed_hcc_mapping.cms_hcc_v24 as TEXT) as hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\n and conditions.payment_year = seed_hcc_mapping.payment_year\n where cms_hcc_v24_flag = 'Yes'\n\n)\n\n, v28_mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.payment_year\n , 'CMS-HCC-V28' as model_version\n , cast(seed_hcc_mapping.cms_hcc_v28 as TEXT) as hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\n and conditions.payment_year = seed_hcc_mapping.payment_year\n where cms_hcc_v28_flag = 'Yes'\n\n)\n\n, unioned as (\n\n select * from v24_mapped\n union all\n select * from v28_mapped\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(condition_code as TEXT) as condition_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_members": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_members", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_members.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_members", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_members"], "alias": "_int_members", "checksum": {"name": "sha256", "checksum": "526c78057690b21365801969cee4f0530d8821cc1b7174ae80fad3039ef54650"}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\". If available, current Medicare Status is used when OREC is missing.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_members", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5515656, "relation_name": "dev_thuxuan.cms_hcc._int_members", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for transforming eligibility data into member demographics:\r\n 1) Determine enrollment status using eligibility from the collection year.\r\n 2) Roll up to latest eligibility record for enrollment statuses.\r\n 3) Add age groups based on the payment year.\r\n 4) Determine other statuses.\r\n\r\nJinja is used to set payment year variable.\r\n - The payment_year var has been set here so it gets compiled.\r\n - CMS guidance: Age is calculated as of Feb 1 of the payment year.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set payment_year = var('cms_hcc_payment_year') | int() -%}\r\n{% set payment_year_age_date = payment_year ~ '-02-01' -%}\r\n{% set collection_year = payment_year - 1 -%}\r\n{% set collection_year_start = collection_year ~ '-01-01' -%}\r\n{% set collection_year_end = collection_year ~ '-12-31' -%}\r\n\r\nwith stg_eligibility as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , row_number() over(\r\n partition by patient_id\r\n order by enrollment_end_date desc\r\n ) as row_num /* used to dedupe eligibility */\r\n from {{ ref('cms_hcc__stg_core__eligibility') }}\r\n where (\r\n /* filter to members with eligibility in collection or payment year */\r\n extract(year from enrollment_start_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n or extract(year from enrollment_end_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n )\r\n\r\n)\r\n\r\n, stg_patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\r\n , death_date\r\n from {{ ref('cms_hcc__stg_core__patient') }}\r\n\r\n)\r\n\r\n/* create proxy enrollment dates if outside of the collection year */\r\n, cap_collection_start_end_dates as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , case\r\n when enrollment_start_date < '{{ collection_year_start }}'\r\n then '{{ collection_year_start }}'\r\n else enrollment_start_date\r\n end as proxy_enrollment_start_date\r\n , case\r\n when enrollment_end_date > '{{ collection_year_end }}'\r\n then '{{ collection_year_end }}'\r\n else enrollment_end_date\r\n end as proxy_enrollment_end_date\r\n from stg_eligibility\r\n where (\r\n /* filter to members with eligibility in collection or payment year */\r\n extract(year from enrollment_start_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n or extract(year from enrollment_end_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n )\r\n\r\n)\r\n\r\n, calculate_prior_coverage as (\r\n\r\n select patient_id\r\n , sum({{ datediff('proxy_enrollment_start_date', 'proxy_enrollment_end_date', 'month') }} + 1) as coverage_months /* include starting month */\r\n from cap_collection_start_end_dates\r\n group by patient_id\r\n\r\n)\r\n\r\n/*\r\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\r\n 12 months of coverage prior to the payment year.\r\n*/\r\n, add_enrollment as (\r\n\r\n select\r\n patient_id\r\n , case\r\n when coverage_months < 12 then 'New'\r\n else 'Continuing'\r\n end as enrollment_status\r\n from calculate_prior_coverage\r\n\r\n)\r\n\r\n, latest_eligibility as (\r\n\r\n select\r\n stg_eligibility.patient_id\r\n , stg_patient.sex as gender\r\n , stg_patient.payment_year_age\r\n , stg_eligibility.original_reason_entitlement_code\r\n , stg_eligibility.dual_status_code\r\n , stg_eligibility.medicare_status_code\r\n /* Defaulting to \"New\" enrollment status when missing */\r\n , case\r\n when add_enrollment.enrollment_status is null then 'New'\r\n else add_enrollment.enrollment_status\r\n end as enrollment_status\r\n , case\r\n when add_enrollment.enrollment_status is null then TRUE\r\n else FALSE\r\n end as enrollment_status_default\r\n from stg_eligibility\r\n left join add_enrollment\r\n on stg_eligibility.patient_id = add_enrollment.patient_id\r\n left join stg_patient\r\n on stg_eligibility.patient_id = stg_patient.patient_id\r\n where stg_eligibility.row_num = 1\r\n\r\n)\r\n\r\n, add_age_group as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , payment_year_age\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , enrollment_status\r\n , enrollment_status_default\r\n , case\r\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\r\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\r\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\r\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\r\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\r\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\r\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\r\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\r\n end as age_group\r\n from latest_eligibility\r\n\r\n)\r\n\r\n, add_status_logic as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , case\r\n when gender = 'female' then 'Female'\r\n when gender = 'male' then 'Male'\r\n else null\r\n end as gender\r\n , age_group\r\n , case\r\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\r\n else 'No'\r\n end as medicaid_status\r\n , case\r\n when dual_status_code in ('02','04','08') then 'Full'\r\n when dual_status_code in ('01','03','05','06') then 'Partial'\r\n else 'Non'\r\n end as dual_status\r\n /*\r\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\r\n we default to 'Aged'. When OREC is missing, latest Medicare status is\r\n used, if available.\r\n */\r\n , case\r\n when original_reason_entitlement_code in ('0','2') then 'Aged'\r\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\r\n end as orec\r\n /* Defaulting everyone to non-institutional until logic is added */\r\n , cast('No' as {{ dbt.type_string() }}) as institutional_status\r\n , enrollment_status_default\r\n , case\r\n when dual_status_code is null then TRUE\r\n else FALSE\r\n end as medicaid_dual_status_default\r\n /* Setting default true when OREC or Medicare Status is ESRD, or null */\r\n , case\r\n when original_reason_entitlement_code in ('2') then TRUE\r\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\r\n else FALSE\r\n end as orec_default\r\n /* Setting default true until institutional logic is added */\r\n , TRUE as institutional_status_default\r\n from add_age_group\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast('{{ payment_year }}' as integer) as payment_year\r\n from add_status_logic\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__stg_core__eligibility", "package": null, "version": null}, {"name": "cms_hcc__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "compiled": true, "compiled_code": "\n/*\nSteps for transforming eligibility data into member demographics:\n 1) Determine enrollment status using eligibility from the collection year.\n 2) Roll up to latest eligibility record for enrollment statuses.\n 3) Add age groups based on the payment year.\n 4) Determine other statuses.\n\nJinja is used to set payment year variable.\n - The payment_year var has been set here so it gets compiled.\n - CMS guidance: Age is calculated as of Feb 1 of the payment year.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n), __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),stg_eligibility as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , row_number() over(\n partition by patient_id\n order by enrollment_end_date desc\n ) as row_num /* used to dedupe eligibility */\n from __dbt__cte__cms_hcc__stg_core__eligibility\n where (\n /* filter to members with eligibility in collection or payment year */\n extract(year from enrollment_start_date)\n between 2023\n and 2024\n or extract(year from enrollment_end_date)\n between 2023\n and 2024\n )\n\n)\n\n, stg_patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n '2024-02-01'\n ) / 8766.0) as payment_year_age\n , death_date\n from __dbt__cte__cms_hcc__stg_core__patient\n\n)\n\n/* create proxy enrollment dates if outside of the collection year */\n, cap_collection_start_end_dates as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '2023-01-01'\n then '2023-01-01'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , case\n when enrollment_end_date > '2023-12-31'\n then '2023-12-31'\n else enrollment_end_date\n end as proxy_enrollment_end_date\n from stg_eligibility\n where (\n /* filter to members with eligibility in collection or payment year */\n extract(year from enrollment_start_date)\n between 2023\n and 2024\n or extract(year from enrollment_end_date)\n between 2023\n and 2024\n )\n\n)\n\n, calculate_prior_coverage as (\n\n select patient_id\n , sum(datediff(\n month,\n proxy_enrollment_start_date,\n proxy_enrollment_end_date\n ) + 1) as coverage_months /* include starting month */\n from cap_collection_start_end_dates\n group by patient_id\n\n)\n\n/*\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\n 12 months of coverage prior to the payment year.\n*/\n, add_enrollment as (\n\n select\n patient_id\n , case\n when coverage_months < 12 then 'New'\n else 'Continuing'\n end as enrollment_status\n from calculate_prior_coverage\n\n)\n\n, latest_eligibility as (\n\n select\n stg_eligibility.patient_id\n , stg_patient.sex as gender\n , stg_patient.payment_year_age\n , stg_eligibility.original_reason_entitlement_code\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\n /* Defaulting to \"New\" enrollment status when missing */\n , case\n when add_enrollment.enrollment_status is null then 'New'\n else add_enrollment.enrollment_status\n end as enrollment_status\n , case\n when add_enrollment.enrollment_status is null then TRUE\n else FALSE\n end as enrollment_status_default\n from stg_eligibility\n left join add_enrollment\n on stg_eligibility.patient_id = add_enrollment.patient_id\n left join stg_patient\n on stg_eligibility.patient_id = stg_patient.patient_id\n where stg_eligibility.row_num = 1\n\n)\n\n, add_age_group as (\n\n select\n patient_id\n , gender\n , payment_year_age\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , enrollment_status\n , enrollment_status_default\n , case\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\n end as age_group\n from latest_eligibility\n\n)\n\n, add_status_logic as (\n\n select\n patient_id\n , enrollment_status\n , case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as gender\n , age_group\n , case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as medicaid_status\n , case\n when dual_status_code in ('02','04','08') then 'Full'\n when dual_status_code in ('01','03','05','06') then 'Partial'\n else 'Non'\n end as dual_status\n /*\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\n we default to 'Aged'. When OREC is missing, latest Medicare status is\n used, if available.\n */\n , case\n when original_reason_entitlement_code in ('0','2') then 'Aged'\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\n end as orec\n /* Defaulting everyone to non-institutional until logic is added */\n , cast('No' as TEXT) as institutional_status\n , enrollment_status_default\n , case\n when dual_status_code is null then TRUE\n else FALSE\n end as medicaid_dual_status_default\n /* Setting default true when OREC or Medicare Status is ESRD, or null */\n , case\n when original_reason_entitlement_code in ('2') then TRUE\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\n else FALSE\n end as orec_default\n /* Setting default true until institutional logic is added */\n , TRUE as institutional_status_default\n from add_age_group\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast('2024' as integer) as payment_year\n from add_status_logic\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , payment_year\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "sql": " __dbt__cte__cms_hcc__stg_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__patient", "sql": " __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__condition", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "8867fe4af76755aeb495d0edd87446e7943e4688de00bd512655636f0716d454"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_condition", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5555685, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , condition_type\r\n , normalized_code_type as code_type\r\n , normalized_code as code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__eligibility": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "0eda573c42880661c0e42e732798c5864d41fd5e5fdab443892b8ec506c1cd4c"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging eligibility from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_eligibility", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5596004, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__medical_claim": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "bb40f56f0581df95a17999713976c2d3a483f87b2b2281af9d42641e3ee00e1c"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging medical claims from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_medical_claim", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.5645697, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , bill_type_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__patient": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__patient", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "98d5b5cf2d9f92d235aeba9103659699493db4a97495612137cfb181f30759e2"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging patient from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_patient", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.567926, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__condition.sql", "original_file_path": "models\\core\\final\\core__condition.sql", "unique_id": "model.the_tuva_project.core__condition", "fqn": ["the_tuva_project", "core", "final", "core__condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "35baf58c3b10092bedbcf43cbfb94fbeae67c38f68654deb5c32014e7d7b93be"}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The core condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "condition", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.5846844, "relation_name": "dev_thuxuan.core.condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_condition') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_condition') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_condition", "package": null, "version": null}, {"name": "core__stg_clinical_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__condition.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_claims_condition\nunion all\nselect * from dev_thuxuan.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__eligibility": {"database": "dev_thuxuan", "schema": "core", "name": "core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__eligibility.sql", "original_file_path": "models\\core\\final\\core__eligibility.sql", "unique_id": "model.the_tuva_project.core__eligibility", "fqn": ["the_tuva_project", "core", "final", "core__eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "40a7e07c415aa12f2c27b6cd23f2eb48368e6cfd79f21df4312e297abdbf0941"}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The eligibility table contains information on patient health plan and supplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_relation": {"name": "subscriber_relation", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "eligibility", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.5916774, "relation_name": "dev_thuxuan.core.eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_eligibility')}}", "language": "sql", "refs": [{"name": "core__stg_claims_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__encounter.sql", "original_file_path": "models\\core\\final\\core__encounter.sql", "unique_id": "model.the_tuva_project.core__encounter", "fqn": ["the_tuva_project", "core", "final", "core__encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "e11ed4704ad201f03c5a51c9dfa1752ace10107d9a0ac8c746590a372d83b00a"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "encounter", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6045034, "relation_name": "dev_thuxuan.core.encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', false) == true and var('claims_enabled', false) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_clinical_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__lab_result": {"database": "dev_thuxuan", "schema": "core", "name": "core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__lab_result.sql", "original_file_path": "models\\core\\final\\core__lab_result.sql", "unique_id": "model.the_tuva_project.core__lab_result", "fqn": ["the_tuva_project", "core", "final", "core__lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "8ddd58966783cd9e494aebac4b994f0ebc01d6b1bdf7c5d7fa1564778845785d"}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "lab_result", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6160939, "relation_name": "dev_thuxuan.core.lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_clinical_lab_result')}}", "language": "sql", "refs": [{"name": "core__stg_clinical_lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__location": {"database": "dev_thuxuan", "schema": "core", "name": "core__location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__location.sql", "original_file_path": "models\\core\\final\\core__location.sql", "unique_id": "model.the_tuva_project.core__location", "fqn": ["the_tuva_project", "core", "final", "core__location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "25c3cd44422b697cd1494783c2e87d160c7aa163ddc1b175e23379583ee15845"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "location", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6221879, "relation_name": "dev_thuxuan.core.location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_location", "package": null, "version": null}, {"name": "core__stg_clinical_location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__location.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_location\nunion all\nselect * from dev_thuxuan.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medical_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medical_claim.sql", "original_file_path": "models\\core\\final\\core__medical_claim.sql", "unique_id": "model.the_tuva_project.core__medical_claim", "fqn": ["the_tuva_project", "core", "final", "core__medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "41428bc0eb9047a2b8a1eec6c3d57d9b04073f32fda2e28989dc59c2f23aebb7"}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medical claim table contains information on services rendered to patients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medical_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6404068, "relation_name": "dev_thuxuan.core.medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_medical_claim')}}", "language": "sql", "refs": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medication": {"database": "dev_thuxuan", "schema": "core", "name": "core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medication.sql", "original_file_path": "models\\core\\final\\core__medication.sql", "unique_id": "model.the_tuva_project.core__medication", "fqn": ["the_tuva_project", "core", "final", "core__medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "20f56083acd15d349daecabf0fa574feeffac778c809363c251ffa09357cc714"}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medication", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6499205, "relation_name": "dev_thuxuan.core.medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_medication')}}", "language": "sql", "refs": [{"name": "core__stg_clinical_medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medication.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__observation": {"database": "dev_thuxuan", "schema": "core", "name": "core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__observation.sql", "original_file_path": "models\\core\\final\\core__observation.sql", "unique_id": "model.the_tuva_project.core__observation", "fqn": ["the_tuva_project", "core", "final", "core__observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "95e03355014d8640f45a21cd9e7365cd98308f6aecfe7517a314ef490bab02c8"}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "observation", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6579206, "relation_name": "dev_thuxuan.core.observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_observation')}}", "language": "sql", "refs": [{"name": "core__stg_clinical_observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__observation.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__patient.sql", "original_file_path": "models\\core\\final\\core__patient.sql", "unique_id": "model.the_tuva_project.core__patient", "fqn": ["the_tuva_project", "core", "final", "core__patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "91ee630a4a580f22cbd30dd748007dbe543ffc36b46d4c4e4b70a3fac167275f"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "social_security_number": {"name": "social_security_number", "description": "The social security number of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "patient", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6654313, "relation_name": "dev_thuxuan.core.patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_patient", "package": null, "version": null}, {"name": "core__stg_clinical_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__patient.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_patient\nunion all\nselect * from dev_thuxuan.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__pharmacy_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__pharmacy_claim.sql", "original_file_path": "models\\core\\final\\core__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.core__pharmacy_claim", "fqn": ["the_tuva_project", "core", "final", "core__pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "78711b940ffc41f4aa9dcdc0eafd9d8d8753cc313dec22d5282e7b10936dce37"}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The pharmacy claim table contains information on prescription drugs that were filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "pharmacy_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6744478, "relation_name": "dev_thuxuan.core.pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_claims_pharmacy_claim')}}", "language": "sql", "refs": [{"name": "core__stg_claims_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__practitioner.sql", "original_file_path": "models\\core\\final\\core__practitioner.sql", "unique_id": "model.the_tuva_project.core__practitioner", "fqn": ["the_tuva_project", "core", "final", "core__practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "402fa1015c25b4347c00bde3d71b875be57fe24318ae1e40bcd349c6bf38f949"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "practitioner", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6794455, "relation_name": "dev_thuxuan.core.practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true-%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_practitioner", "package": null, "version": null}, {"name": "core__stg_clinical_practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_practitioner\nunion all\nselect * from dev_thuxuan.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__procedure.sql", "original_file_path": "models\\core\\final\\core__procedure.sql", "unique_id": "model.the_tuva_project.core__procedure", "fqn": ["the_tuva_project", "core", "final", "core__procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "8ee6b4a59c18de11eb8c0cbeaac3cb5d34555f657ddf507bb990c361bae5516a"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "procedure", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6899595, "relation_name": "dev_thuxuan.core.procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_procedure", "package": null, "version": null}, {"name": "core__stg_clinical_procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_procedure\nunion all\nselect * from dev_thuxuan.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_condition.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_condition.sql", "unique_id": "model.the_tuva_project.core__stg_claims_condition", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_condition"], "alias": "_stg_claims_condition", "checksum": {"name": "sha256", "checksum": "70f4ac6066c92f456f93fc68aabf32857258720e3b07a3a44781910a2697d15f"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims conditions", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_condition", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7034783, "relation_name": "dev_thuxuan.core._stg_claims_condition", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the condition table in core.\r\n-- *************************************************\r\n\r\nwith unpivot_cte as (\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_1 as source_code\r\n , 1 as diagnosis_rank\r\n , diagnosis_poa_1 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere diagnosis_code_1 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n\t , discharge_date\r\n\t , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_2 as source_code\r\n , 2 as diagnosis_rank\r\n , diagnosis_poa_2 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_2 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_3 as source_code\r\n , 3 as diagnosis_rank\r\n , diagnosis_poa_3 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_3 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_4 as source_code\r\n , 4 as diagnosis_rank\r\n , diagnosis_poa_4 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_4 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_5 as source_code\r\n , 5 as diagnosis_rank\r\n , diagnosis_poa_5 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_5 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_6 as source_code\r\n , 6 as diagnosis_rank\r\n , diagnosis_poa_6 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_6 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_7 as source_code\r\n , 7 as diagnosis_rank\r\n , diagnosis_poa_7 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_7 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_8 as source_code\r\n , 8 as diagnosis_rank\r\n , diagnosis_poa_8 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_8 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_9 as source_code\r\n , 9 as diagnosis_rank\r\n , diagnosis_poa_9 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_9 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_10 as source_code\r\n , 10 as diagnosis_rank\r\n , diagnosis_poa_10 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_10 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_11 as source_code\r\n , 11 as diagnosis_rank\r\n , diagnosis_poa_11 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_11 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_12 as source_code\r\n , 12 as diagnosis_rank\r\n , diagnosis_poa_12 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_12 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_13 as source_code\r\n , 13 as diagnosis_rank\r\n , diagnosis_poa_13 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_13 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_14 as source_code\r\n , 14 as diagnosis_rank\r\n , diagnosis_poa_14 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_14 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_15 as source_code\r\n , 15 as diagnosis_rank\r\n , diagnosis_poa_15 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_15 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_16 as source_code\r\n , 16 as diagnosis_rank\r\n , diagnosis_poa_16 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_16 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_17 as source_code\r\n , 17 as diagnosis_rank\r\n , diagnosis_poa_17 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_17 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_18 as source_code\r\n , 18 as diagnosis_rank\r\n , diagnosis_poa_18 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_18 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_19 as source_code\r\n , 19 as diagnosis_rank\r\n , diagnosis_poa_19 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_19 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_20 as source_code\r\n , 20 as diagnosis_rank\r\n , diagnosis_poa_20 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_20 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_21 as source_code\r\n , 21 as diagnosis_rank\r\n , diagnosis_poa_21 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_21 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_22 as source_code\r\n , 22 as diagnosis_rank\r\n , diagnosis_poa_22 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_22 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_23 as source_code\r\n , 23 as diagnosis_rank\r\n , diagnosis_poa_23 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_23 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_24 as source_code\r\n , 24 as diagnosis_rank\r\n , diagnosis_poa_24 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_24 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_25 as source_code\r\n , 25 as diagnosis_rank\r\n , diagnosis_poa_25 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n cast(unpivot_cte.data_source||'_'||unpivot_cte.claim_id||'_'||unpivot_cte.diagnosis_rank||'_'||unpivot_cte.source_code as {{ dbt.type_string() }} ) as condition_id\r\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('unpivot_cte.recorded_date', 'YYYY-MM-DD') }} as recorded_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as onset_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as resolved_date\r\n , cast('active' as {{ dbt.type_string() }} ) as status\r\n , cast(unpivot_cte.condition_type as {{ dbt.type_string() }} ) as condition_type\r\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(\r\n case\r\n when icd.icd_10_cm is not null then 'icd-10-cm'\r\n end as {{ dbt.type_string() }}\r\n ) as normalized_code_type\r\n , cast(icd.icd_10_cm as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(icd.long_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(unpivot_cte.diagnosis_rank as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(unpivot_cte.present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(poa.present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom unpivot_cte\r\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id\r\nleft join {{ ref('terminology__icd_10_cm') }} icd\r\n on unpivot_cte.source_code = icd.icd_10_cm\r\nleft join {{ ref('terminology__present_on_admission') }} as poa\r\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_condition.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the condition table in core.\n-- *************************************************\n\nwith unpivot_cte as (\n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_1 as source_code\n , 1 as diagnosis_rank\n , diagnosis_poa_1 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere diagnosis_code_1 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n\t , discharge_date\n\t , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_2 as source_code\n , 2 as diagnosis_rank\n , diagnosis_poa_2 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_2 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_3 as source_code\n , 3 as diagnosis_rank\n , diagnosis_poa_3 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_3 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_4 as source_code\n , 4 as diagnosis_rank\n , diagnosis_poa_4 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_4 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_5 as source_code\n , 5 as diagnosis_rank\n , diagnosis_poa_5 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_5 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_6 as source_code\n , 6 as diagnosis_rank\n , diagnosis_poa_6 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_6 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_7 as source_code\n , 7 as diagnosis_rank\n , diagnosis_poa_7 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_7 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_8 as source_code\n , 8 as diagnosis_rank\n , diagnosis_poa_8 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_8 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_9 as source_code\n , 9 as diagnosis_rank\n , diagnosis_poa_9 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_9 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_10 as source_code\n , 10 as diagnosis_rank\n , diagnosis_poa_10 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_10 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_11 as source_code\n , 11 as diagnosis_rank\n , diagnosis_poa_11 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_11 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_12 as source_code\n , 12 as diagnosis_rank\n , diagnosis_poa_12 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_12 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_13 as source_code\n , 13 as diagnosis_rank\n , diagnosis_poa_13 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_13 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_14 as source_code\n , 14 as diagnosis_rank\n , diagnosis_poa_14 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_14 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_15 as source_code\n , 15 as diagnosis_rank\n , diagnosis_poa_15 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_15 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_16 as source_code\n , 16 as diagnosis_rank\n , diagnosis_poa_16 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_16 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_17 as source_code\n , 17 as diagnosis_rank\n , diagnosis_poa_17 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_17 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_18 as source_code\n , 18 as diagnosis_rank\n , diagnosis_poa_18 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_18 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_19 as source_code\n , 19 as diagnosis_rank\n , diagnosis_poa_19 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_19 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_20 as source_code\n , 20 as diagnosis_rank\n , diagnosis_poa_20 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_20 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_21 as source_code\n , 21 as diagnosis_rank\n , diagnosis_poa_21 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_21 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_22 as source_code\n , 22 as diagnosis_rank\n , diagnosis_poa_22 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_22 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_23 as source_code\n , 23 as diagnosis_rank\n , diagnosis_poa_23 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_23 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_24 as source_code\n , 24 as diagnosis_rank\n , diagnosis_poa_24 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_24 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_25 as source_code\n , 25 as diagnosis_rank\n , diagnosis_poa_25 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_25 is not null\n\n)\n\nselect distinct\n cast(unpivot_cte.data_source||'_'||unpivot_cte.claim_id||'_'||unpivot_cte.diagnosis_rank||'_'||unpivot_cte.source_code as TEXT ) as condition_id\n , cast(unpivot_cte.patient_id as TEXT ) as patient_id\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id\n , cast(unpivot_cte.claim_id as TEXT ) as claim_id\n , try_cast( unpivot_cte.recorded_date as date ) as recorded_date\n , try_cast( null as date ) as onset_date\n , try_cast( null as date ) as resolved_date\n , cast('active' as TEXT ) as status\n , cast(unpivot_cte.condition_type as TEXT ) as condition_type\n , cast(unpivot_cte.source_code_type as TEXT ) as source_code_type\n , cast(unpivot_cte.source_code as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(\n case\n when icd.icd_10_cm is not null then 'icd-10-cm'\n end as TEXT\n ) as normalized_code_type\n , cast(icd.icd_10_cm as TEXT ) as normalized_code\n , cast(icd.long_description as TEXT ) as normalized_description\n , cast(unpivot_cte.diagnosis_rank as INT ) as condition_rank\n , cast(unpivot_cte.present_on_admit_code as TEXT ) as present_on_admit_code\n , cast(poa.present_on_admit_description as TEXT ) as present_on_admit_description\n , cast(unpivot_cte.data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id\nleft join dev_thuxuan.terminology.icd_10_cm icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join dev_thuxuan.terminology.present_on_admission as poa\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_eligibility": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_eligibility.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_eligibility.sql", "unique_id": "model.the_tuva_project.core__stg_claims_eligibility", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_eligibility"], "alias": "_stg_claims_eligibility", "checksum": {"name": "sha256", "checksum": "cd111eb33395612e56258189c26fa5e5601b6e13eea6ce8f9e0a417d2a40ab0a"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core eligibility", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_eligibility", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.711481, "relation_name": "dev_thuxuan.core._stg_claims_eligibility", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the eligibility table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(subscriber_id as {{ dbt.type_string() }} ) as subscriber_id\r\n , cast(birth_date as date) as birth_date\r\n , cast(death_date as date) as death_date\r\n , cast(enrollment_start_date as date ) as enrollment_start_date\r\n , cast(enrollment_end_date as date ) as enrollment_end_date\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(payer_type as {{ dbt.type_string() }} ) as payer_type\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\r\n , cast(dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\r\n , cast(medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\r\n , cast(subscriber_relation as {{ dbt.type_string() }} ) as subscriber_relation\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_eligibility.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the eligibility table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(subscriber_id as TEXT ) as subscriber_id\n , cast(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(enrollment_start_date as date ) as enrollment_start_date\n , cast(enrollment_end_date as date ) as enrollment_end_date\n , cast(payer as TEXT ) as payer\n , cast(payer_type as TEXT ) as payer_type\n , cast(plan as TEXT ) as plan\n , cast(original_reason_entitlement_code as TEXT ) as original_reason_entitlement_code\n , cast(dual_status_code as TEXT ) as dual_status_code\n , cast(medicare_status_code as TEXT ) as medicare_status_code\n , cast(subscriber_relation as TEXT ) as subscriber_relation\n , cast(data_source as TEXT ) as data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_encounter.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_encounter.sql", "unique_id": "model.the_tuva_project.core__stg_claims_encounter", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_encounter"], "alias": "_stg_claims_encounter", "checksum": {"name": "sha256", "checksum": "7b83e0008207f9e21f32f7bdde39f3b2b6178eb7170d776a3d5536b789f024f7"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_encounter", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6949644, "relation_name": "dev_thuxuan.core._stg_claims_encounter", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the encounter table in core.\r\n-- *************************************************\r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast('acute inpatient' as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('acute_inpatient__summary') }} \r\n\r\nunion all \r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast('emergency department' as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('emergency_department__summary') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "acute_inpatient__summary", "package": null, "version": null}, {"name": "emergency_department__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the encounter table in core.\n-- *************************************************\n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('acute inpatient' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.acute_inpatient_summary \n\nunion all \n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('emergency department' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.emergency_department_summary", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_location": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_location.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_location.sql", "unique_id": "model.the_tuva_project.core__stg_claims_location", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_location"], "alias": "_stg_claims_location", "checksum": {"name": "sha256", "checksum": "a5547fb73ac73c7b03352c605ab3aea4772412a5c9864bd2a57623ffa76a21cc"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims locations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_location", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6979642, "relation_name": "dev_thuxuan.core._stg_claims_location", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'organization'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as location_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_organization_name as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(practice_address_line_1 as {{ dbt.type_string() }} ) as address\r\n , cast(practice_city as {{ dbt.type_string() }} ) as city\r\n , cast(practice_state as {{ dbt.type_string() }} ) as state\r\n , cast(practice_zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast( '{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_location.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom dev_thuxuan.terminology.provider aa\ninner join all_providers_in_claims_dataset bb\non aa.npi = bb.npi\nwhere lower(aa.entity_type_description) = 'organization'\n)\n\n\n\nselect \n cast(npi as TEXT ) as location_id\n , cast(npi as TEXT ) as npi\n , cast(provider_organization_name as TEXT ) as name\n , cast(null as TEXT ) as facility_type\n , cast(parent_organization_name as TEXT ) as parent_organization\n , cast(practice_address_line_1 as TEXT ) as address\n , cast(practice_city as TEXT ) as city\n , cast(practice_state as TEXT ) as state\n , cast(practice_zip_code as TEXT ) as zip_code\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast( '2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_medical_claim.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_medical_claim.sql", "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_medical_claim"], "alias": "_stg_claims_medical_claim", "checksum": {"name": "sha256", "checksum": "b64940f3eaf1b1ed305d3534ef5c81c37ed073b41f2326d94973824919e83c88"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core medical claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_medical_claim", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.6919644, "relation_name": "dev_thuxuan.core._stg_claims_medical_claim", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the medical_claim table\r\n-- in core. It adds these 4 fields to the input layer\r\n-- medical claim table:\r\n-- encounter_id\r\n-- service_category_1\r\n-- service_category_2\r\n-- *************************************************\r\n\r\n\r\nselect\r\n cast(med.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(med.claim_line_number as {{ dbt.type_int() }} ) as claim_line_number\r\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id \r\n , cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\r\n , cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(med.member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(med.payer as {{ dbt.type_string() }} ) as payer\r\n , cast(med.plan as {{ dbt.type_string() }} ) as plan\r\n , {{ try_to_cast_date('med.claim_start_date', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('med.claim_end_date', 'YYYY-MM-DD') }} as claim_end_date\r\n , {{ try_to_cast_date('med.claim_line_start_date', 'YYYY-MM-DD') }} as claim_line_start_date\r\n , {{ try_to_cast_date('med.claim_line_end_date', 'YYYY-MM-DD') }} as claim_line_end_date\r\n , {{ try_to_cast_date('med.admission_date', 'YYYY-MM-DD') }} as admission_date\r\n , {{ try_to_cast_date('med.discharge_date', 'YYYY-MM-DD') }} as discharge_date\r\n , cast(srv_group.service_category_1 as {{ dbt.type_string() }} ) as service_category_1\r\n , cast(srv_group.service_category_2 as {{ dbt.type_string() }} ) as service_category_2\r\n , cast(med.admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(med.admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(med.discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(med.place_of_service_code as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(med.bill_type_code as {{ dbt.type_string() }} ) as bill_type_code\r\n , cast(med.ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(med.apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(med.revenue_center_code as {{ dbt.type_string() }} ) as revenue_center_code\r\n , cast(med.service_unit_quantity as {{ dbt.type_numeric() }} ) as service_unit_quantity\r\n , cast(med.hcpcs_code as {{ dbt.type_string() }} ) as hcpcs_code\r\n , cast(med.hcpcs_modifier_1 as {{ dbt.type_string() }} ) as hcpcs_modifier_1\r\n , cast(med.hcpcs_modifier_2 as {{ dbt.type_string() }} ) as hcpcs_modifier_2\r\n , cast(med.hcpcs_modifier_3 as {{ dbt.type_string() }} ) as hcpcs_modifier_3\r\n , cast(med.hcpcs_modifier_4 as {{ dbt.type_string() }} ) as hcpcs_modifier_4\r\n , cast(med.hcpcs_modifier_5 as {{ dbt.type_string() }} ) as hcpcs_modifier_5\r\n , cast(med.rendering_npi as {{ dbt.type_string() }} ) as rendering_npi\r\n , cast(med.billing_npi as {{ dbt.type_string() }} ) as billing_npi\r\n , cast(med.facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , {{ try_to_cast_date('med.paid_date', 'YYYY-MM-DD') }} as paid_date\r\n , cast(med.paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(med.allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(med.charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(med.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\r\n , cast(med.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }} med\r\nleft join {{ ref('service_category__service_category_grouper') }} srv_group\r\n on med.claim_id = srv_group.claim_id\r\n and med.claim_line_number = srv_group.claim_line_number\r\nleft join {{ ref('acute_inpatient__encounter_id') }} ap\r\n on med.claim_id = ap.claim_id\r\n and med.claim_line_number = ap.claim_line_number\r\nleft join {{ ref('emergency_department__int_encounter_id') }} ed\r\n on med.claim_id = ed.claim_id\r\n and med.claim_line_number = ed.claim_line_number", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the medical_claim table\n-- in core. It adds these 4 fields to the input layer\n-- medical claim table:\n-- encounter_id\n-- service_category_1\n-- service_category_2\n-- *************************************************\n\n\nselect\n cast(med.claim_id as TEXT ) as claim_id\n , cast(med.claim_line_number as INT ) as claim_line_number\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as TEXT ) as encounter_id \n , cast(med.claim_type as TEXT ) as claim_type\n , cast(med.patient_id as TEXT ) as patient_id\n , cast(med.member_id as TEXT ) as member_id\n , cast(med.payer as TEXT ) as payer\n , cast(med.plan as TEXT ) as plan\n , try_cast( med.claim_start_date as date ) as claim_start_date\n , try_cast( med.claim_end_date as date ) as claim_end_date\n , try_cast( med.claim_line_start_date as date ) as claim_line_start_date\n , try_cast( med.claim_line_end_date as date ) as claim_line_end_date\n , try_cast( med.admission_date as date ) as admission_date\n , try_cast( med.discharge_date as date ) as discharge_date\n , cast(srv_group.service_category_1 as TEXT ) as service_category_1\n , cast(srv_group.service_category_2 as TEXT ) as service_category_2\n , cast(med.admit_source_code as TEXT ) as admit_source_code\n , cast(med.admit_type_code as TEXT ) as admit_type_code\n , cast(med.discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(med.place_of_service_code as TEXT ) as place_of_service_code\n , cast(med.bill_type_code as TEXT ) as bill_type_code\n , cast(med.ms_drg_code as TEXT ) as ms_drg_code\n , cast(med.apr_drg_code as TEXT ) as apr_drg_code\n , cast(med.revenue_center_code as TEXT ) as revenue_center_code\n , cast(med.service_unit_quantity as numeric(28,6) ) as service_unit_quantity\n , cast(med.hcpcs_code as TEXT ) as hcpcs_code\n , cast(med.hcpcs_modifier_1 as TEXT ) as hcpcs_modifier_1\n , cast(med.hcpcs_modifier_2 as TEXT ) as hcpcs_modifier_2\n , cast(med.hcpcs_modifier_3 as TEXT ) as hcpcs_modifier_3\n , cast(med.hcpcs_modifier_4 as TEXT ) as hcpcs_modifier_4\n , cast(med.hcpcs_modifier_5 as TEXT ) as hcpcs_modifier_5\n , cast(med.rendering_npi as TEXT ) as rendering_npi\n , cast(med.billing_npi as TEXT ) as billing_npi\n , cast(med.facility_npi as TEXT ) as facility_npi\n , try_cast( med.paid_date as date ) as paid_date\n , cast(med.paid_amount as numeric(28,6) ) as paid_amount\n , cast(med.allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(med.charge_amount as numeric(28,6) ) as charge_amount\n , cast(med.coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(med.copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(med.deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(med.total_cost_amount as numeric(28,6) ) as total_cost_amount\n , cast(med.data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim med\nleft join dev_thuxuan.claims_preprocessing.service_category_grouper srv_group\n on med.claim_id = srv_group.claim_id\n and med.claim_line_number = srv_group.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id ap\n on med.claim_id = ap.claim_id\n and med.claim_line_number = ap.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id ed\n on med.claim_id = ed.claim_id\n and med.claim_line_number = ed.claim_line_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_patient.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_patient.sql", "unique_id": "model.the_tuva_project.core__stg_claims_patient", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_patient"], "alias": "_stg_claims_patient", "checksum": {"name": "sha256", "checksum": "a4953da3f7b896184bcb08acf5ef58479e8afa521febcc36cbfe9f0d034f39ee"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims patients", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_patient", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7004783, "relation_name": "dev_thuxuan.core._stg_claims_patient", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the patient table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith patient_stage as(\r\n select\r\n patient_id\r\n ,first_name\r\n ,last_name\r\n ,gender\r\n ,race\r\n ,birth_date\r\n ,death_date\r\n ,death_flag\r\n ,social_security_number\r\n ,address\r\n ,city\r\n ,state\r\n ,zip_code\r\n ,phone\r\n ,data_source\r\n ,row_number() over (\r\n\t partition by patient_id\r\n\t order by case when enrollment_end_date is null\r\n then cast ('2050-01-01' as date)\r\n else enrollment_end_date end DESC)\r\n as row_sequence\r\n from {{ ref('normalized_input__eligibility')}}\r\n)\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(first_name as {{ dbt.type_string() }}) as first_name\r\n , cast(last_name as {{ dbt.type_string() }}) as last_name\r\n , cast(gender as {{ dbt.type_string() }}) as sex\r\n , cast(race as {{ dbt.type_string() }}) as race\r\n , cast(birth_date as date) as birth_date\r\n , cast(death_date as date) as death_date\r\n , cast(death_flag as int) as death_flag\r\n , cast(social_security_number as {{ dbt.type_string() }}) as social_security_number\r\n , cast(address as {{ dbt.type_string() }}) as address\r\n , cast(city as {{ dbt.type_string() }}) as city\r\n , cast(state as {{ dbt.type_string() }}) as state\r\n , cast(zip_code as {{ dbt.type_string() }}) as zip_code\r\n , cast(null as {{ dbt.type_string() }}) as county\r\n , cast(null as {{ dbt.type_float() }}) as latitude \r\n , cast(null as {{ dbt.type_float() }}) as longitude\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }}) as tuva_last_run\r\nfrom patient_stage\r\nwhere row_sequence = 1", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_patient.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the patient table in core.\n-- *************************************************\n\n\n\n\nwith patient_stage as(\n select\n patient_id\n ,first_name\n ,last_name\n ,gender\n ,race\n ,birth_date\n ,death_date\n ,death_flag\n ,social_security_number\n ,address\n ,city\n ,state\n ,zip_code\n ,phone\n ,data_source\n ,row_number() over (\n\t partition by patient_id\n\t order by case when enrollment_end_date is null\n then cast ('2050-01-01' as date)\n else enrollment_end_date end DESC)\n as row_sequence\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n)\n\nselect\n cast(patient_id as TEXT) as patient_id\n , cast(first_name as TEXT) as first_name\n , cast(last_name as TEXT) as last_name\n , cast(gender as TEXT) as sex\n , cast(race as TEXT) as race\n , cast(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(death_flag as int) as death_flag\n , cast(social_security_number as TEXT) as social_security_number\n , cast(address as TEXT) as address\n , cast(city as TEXT) as city\n , cast(state as TEXT) as state\n , cast(zip_code as TEXT) as zip_code\n , cast(null as TEXT) as county\n , cast(null as FLOAT) as latitude \n , cast(null as FLOAT) as longitude\n , cast(data_source as TEXT) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_pharmacy_claim.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_pharmacy_claim"], "alias": "_stg_claims_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "741c5e32a6ba38c670980458923fae8e7cd988b11271a782e5cdc51c2a7c0b12"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core pharmacy claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_pharmacy_claim", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7094805, "relation_name": "dev_thuxuan.core._stg_claims_pharmacy_claim", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the pharmacy_claim\r\n-- table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(claim_line_number as integer ) as claim_line_number\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\r\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\r\n , cast(dispensing_date as date ) as dispensing_date\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(quantity as integer ) as quantity\r\n , cast(days_supply as integer ) as days_supply\r\n , cast(refills as integer ) as refills\r\n , cast(paid_date as date ) as paid_date\r\n , cast(paid_amount as {{ dbt.type_numeric() }}) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the pharmacy_claim\n-- table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(claim_id as TEXT ) as claim_id\n , cast(claim_line_number as integer ) as claim_line_number\n , cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(payer as TEXT ) as payer\n , cast(plan as TEXT ) as plan\n , cast(prescribing_provider_npi as TEXT ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as TEXT ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(quantity as integer ) as quantity\n , cast(days_supply as integer ) as days_supply\n , cast(refills as integer ) as refills\n , cast(paid_date as date ) as paid_date\n , cast(paid_amount as numeric(28,6)) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(data_source as TEXT ) as data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_practitioner.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_practitioner.sql", "unique_id": "model.the_tuva_project.core__stg_claims_practitioner", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_practitioner"], "alias": "_stg_claims_practitioner", "checksum": {"name": "sha256", "checksum": "d9cc7c9b9e9808fc47eb6dc6db67fc14f179549c25d5f4242fb24fdb149eb289"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core providers in the claims dataset", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_practitioner", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7149887, "relation_name": "dev_thuxuan.core._stg_claims_practitioner", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the provider table \r\n-- in core. It includes data about all providers\r\n-- present in the raw claims dataset.\r\n-- *************************************************\r\n\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'individual'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_first_name as {{ dbt.type_string() }} ) as provider_first_name\r\n , cast(provider_last_name as {{ dbt.type_string() }} ) as provider_last_name\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(primary_specialty_description as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_practitioner.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the provider table \n-- in core. It includes data about all providers\n-- present in the raw claims dataset.\n-- *************************************************\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom dev_thuxuan.terminology.provider aa\ninner join all_providers_in_claims_dataset bb\non aa.npi = bb.npi\nwhere lower(aa.entity_type_description) = 'individual'\n)\n\n\n\nselect \n cast(npi as TEXT ) as practitioner_id\n , cast(npi as TEXT ) as npi\n , cast(provider_first_name as TEXT ) as provider_first_name\n , cast(provider_last_name as TEXT ) as provider_last_name\n , cast(parent_organization_name as TEXT ) as practice_affiliation\n , cast(primary_specialty_description as TEXT ) as specialty\n , cast(null as TEXT ) as sub_specialty\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_procedure.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_procedure.sql", "unique_id": "model.the_tuva_project.core__stg_claims_procedure", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_procedure"], "alias": "_stg_claims_procedure", "checksum": {"name": "sha256", "checksum": "d1cdc470c1141e6469ba535e67699e6482e2bb5f4bd6154469cf973485bb7ba2"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims procedures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_procedure", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7064824, "relation_name": "dev_thuxuan.core._stg_claims_procedure", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the procedure table in core.\r\n-- *************************************************\r\n\r\nwith unpivot_cte as (\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as procedure_date\r\n , 'hcpcs' as source_code_type\r\n , hcpcs_code as source_code\r\n , rendering_npi as practitioner_npi\r\n , hcpcs_modifier_1 as modifier_1\r\n , hcpcs_modifier_2 as modifier_2\r\n , hcpcs_modifier_3 as modifier_3\r\n , hcpcs_modifier_4 as modifier_4\r\n , hcpcs_modifier_5 as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere hcpcs_code is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_1 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_1 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_1 is not null\r\n \r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_2 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_2 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_2 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_3 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_3 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_3 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_4 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_4 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_4 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_5 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_5 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_5 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_6 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_6 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_6 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_7 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_7 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_7 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_8 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_8 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_8 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_9 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_9 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_9 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_10 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_10 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_10 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_11 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_11 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_11 is not null\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_12 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_12 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_12 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_13 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_13 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_13 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_14 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_14 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_14 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_15 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_15 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_15 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_16 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_16 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_16 is not null\r\n \r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_17 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_17 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_17 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_18 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_18 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_18 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_19 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_19 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_19 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_20 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_20 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_20 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_21 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_21 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_21 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_22 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_22 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_22 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_23 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_23 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_23 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_24 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_24 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_24 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_25 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_25 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n cast(\r\n unpivot_cte.data_source\r\n ||'_'\r\n ||unpivot_cte.claim_id\r\n ||'_'\r\n ||unpivot_cte.source_code\r\n ||case when unpivot_cte.modifier_1 is not null then '_'||unpivot_cte.modifier_1 else '' end\r\n ||case when unpivot_cte.modifier_2 is not null then '_'||unpivot_cte.modifier_2 else '' end\r\n ||case when unpivot_cte.modifier_3 is not null then '_'||unpivot_cte.modifier_3 else '' end\r\n ||case when unpivot_cte.modifier_4 is not null then '_'||unpivot_cte.modifier_4 else '' end\r\n ||case when unpivot_cte.modifier_5 is not null then '_'||unpivot_cte.modifier_5 else '' end\r\n ||case when unpivot_cte.practitioner_npi is not null then '_'||unpivot_cte.practitioner_npi else '' end\r\n as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('unpivot_cte.procedure_date', 'YYYY-MM-DD') }} as procedure_date\r\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(\r\n case\r\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n end\r\n as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast (\r\n coalesce (\r\n icd.icd_10_pcs\r\n , hcpcs.hcpcs\r\n )\r\n as {{ dbt.type_string() }} ) as normalized_code\r\n , cast (\r\n coalesce (\r\n icd.description\r\n , hcpcs.short_description\r\n )\r\n as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(unpivot_cte.modifier_1 as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(unpivot_cte.modifier_2 as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(unpivot_cte.modifier_3 as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(unpivot_cte.modifier_4 as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(unpivot_cte.modifier_5 as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(unpivot_cte.practitioner_npi as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom unpivot_cte\r\nleft join {{ ref('terminology__icd_10_pcs') }} as icd\r\n on unpivot_cte.source_code = icd.icd_10_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} as hcpcs\r\n on unpivot_cte.source_code = hcpcs.hcpcs\r\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the procedure table in core.\n-- *************************************************\n\nwith unpivot_cte as (\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as procedure_date\n , 'hcpcs' as source_code_type\n , hcpcs_code as source_code\n , rendering_npi as practitioner_npi\n , hcpcs_modifier_1 as modifier_1\n , hcpcs_modifier_2 as modifier_2\n , hcpcs_modifier_3 as modifier_3\n , hcpcs_modifier_4 as modifier_4\n , hcpcs_modifier_5 as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere hcpcs_code is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_1 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_1 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_1 is not null\n \nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_2 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_2 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_2 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_3 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_3 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_3 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_4 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_4 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_4 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_5 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_5 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_5 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_6 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_6 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_6 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_7 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_7 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_7 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_8 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_8 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_8 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_9 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_9 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_9 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_10 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_10 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_10 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_11 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_11 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_11 is not null\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_12 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_12 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_12 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_13 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_13 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_13 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_14 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_14 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_14 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_15 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_15 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_15 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_16 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_16 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_16 is not null\n \nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_17 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_17 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_17 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_18 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_18 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_18 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_19 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_19 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_19 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_20 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_20 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_20 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_21 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_21 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_21 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_22 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_22 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_22 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_23 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_23 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_23 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_24 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_24 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_24 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_25 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_25 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_25 is not null\n\n)\n\nselect distinct\n cast(\n unpivot_cte.data_source\n ||'_'\n ||unpivot_cte.claim_id\n ||'_'\n ||unpivot_cte.source_code\n ||case when unpivot_cte.modifier_1 is not null then '_'||unpivot_cte.modifier_1 else '' end\n ||case when unpivot_cte.modifier_2 is not null then '_'||unpivot_cte.modifier_2 else '' end\n ||case when unpivot_cte.modifier_3 is not null then '_'||unpivot_cte.modifier_3 else '' end\n ||case when unpivot_cte.modifier_4 is not null then '_'||unpivot_cte.modifier_4 else '' end\n ||case when unpivot_cte.modifier_5 is not null then '_'||unpivot_cte.modifier_5 else '' end\n ||case when unpivot_cte.practitioner_npi is not null then '_'||unpivot_cte.practitioner_npi else '' end\n as TEXT ) as procedure_id\n , cast(unpivot_cte.patient_id as TEXT ) as patient_id\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id\n , cast(unpivot_cte.claim_id as TEXT ) as claim_id\n , try_cast( unpivot_cte.procedure_date as date ) as procedure_date\n , cast(unpivot_cte.source_code_type as TEXT ) as source_code_type\n , cast(unpivot_cte.source_code as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(\n case\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\n when hcpcs.hcpcs is not null then 'hcpcs'\n end\n as TEXT ) as normalized_code_type\n , cast (\n coalesce (\n icd.icd_10_pcs\n , hcpcs.hcpcs\n )\n as TEXT ) as normalized_code\n , cast (\n coalesce (\n icd.description\n , hcpcs.short_description\n )\n as TEXT ) as normalized_description\n , cast(unpivot_cte.modifier_1 as TEXT ) as modifier_1\n , cast(unpivot_cte.modifier_2 as TEXT ) as modifier_2\n , cast(unpivot_cte.modifier_3 as TEXT ) as modifier_3\n , cast(unpivot_cte.modifier_4 as TEXT ) as modifier_4\n , cast(unpivot_cte.modifier_5 as TEXT ) as modifier_5\n , cast(unpivot_cte.practitioner_npi as TEXT ) as practitioner_id\n , cast(unpivot_cte.data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join dev_thuxuan.terminology.icd_10_pcs as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\nleft join dev_thuxuan.terminology.hcpcs_level_2 as hcpcs\n on unpivot_cte.source_code = hcpcs.hcpcs\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_condition.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_condition.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_condition", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_condition"], "alias": "_stg_clinical_condition", "checksum": {"name": "sha256", "checksum": "bcfab95997b76ac5e9983168cc557658be494638cce4f4ec9e172f2f9cc138bf"}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical conditions", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_condition", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7169979, "relation_name": "dev_thuxuan.core._stg_clinical_condition", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(condition_id as {{ dbt.type_string() }} ) as condition_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('recorded_date', 'YYYY-MM-DD') }} as recorded_date\r\n , {{ try_to_cast_date('onset_date', 'YYYY-MM-DD') }} as onset_date\r\n , {{ try_to_cast_date('resolved_date', 'YYYY-MM-DD') }} as resolved_date\r\n , cast(status as {{ dbt.type_string() }} ) as status\r\n , cast(condition_type as {{ dbt.type_string() }} ) as condition_type\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(condition_rank as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('condition') }}", "language": "sql", "refs": [{"name": "condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_condition.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(condition_id as TEXT ) as condition_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( recorded_date as date ) as recorded_date\n , try_cast( onset_date as date ) as onset_date\n , try_cast( resolved_date as date ) as resolved_date\n , cast(status as TEXT ) as status\n , cast(condition_type as TEXT ) as condition_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(condition_rank as INT ) as condition_rank\n , cast(present_on_admit_code as TEXT ) as present_on_admit_code\n , cast(present_on_admit_description as TEXT ) as present_on_admit_description\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_encounter.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_encounter.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_encounter", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_encounter"], "alias": "_stg_clinical_encounter", "checksum": {"name": "sha256", "checksum": "6b8d7f89d9852e86deca237de3fb71eecf2154b14ea7d0c1852be2de2b286867"}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_encounter", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.719998, "relation_name": "dev_thuxuan.core._stg_clinical_encounter", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_type as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(attending_provider_id as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description \r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('encounter') }}", "language": "sql", "refs": [{"name": "encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_encounter.sql", "compiled": true, "compiled_code": "\n\nselect \n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_type as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(attending_provider_id as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description \n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(paid_amount as numeric(28,6) ) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_lab_result.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_lab_result.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_lab_result"], "alias": "_stg_clinical_lab_result", "checksum": {"name": "sha256", "checksum": "5ba7c6ccdd692123791b12400b25b104a6f6be130f6af3146ef454f89451e481"}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical lab results", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_lab_result", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.722503, "relation_name": "dev_thuxuan.core._stg_clinical_lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(lab_result_id as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(accession_number as {{ dbt.type_string() }} ) as accession_number\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(source_component as {{ dbt.type_string() }} ) as source_component\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(normalized_component as {{ dbt.type_string() }} ) as normalized_component\r\n , cast(status as {{ dbt.type_string() }} ) as status\r\n , cast(result as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('result_date', 'YYYY-MM-DD') }} as result_date\r\n , {{ try_to_cast_date('collection_date', 'YYYY-MM-DD') }} as collection_date\r\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\r\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(source_abnormal_flag as {{ dbt.type_string() }} ) as source_abnormal_flag\r\n , cast(normalized_abnormal_flag as {{ dbt.type_string() }} ) as normalized_abnormal_flag\r\n , cast(specimen as {{ dbt.type_string() }} ) as specimen\r\n , cast(ordering_practitioner_id as {{ dbt.type_string() }} ) as ordering_practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('lab_result') }}", "language": "sql", "refs": [{"name": "lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(lab_result_id as TEXT ) as lab_result_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(accession_number as TEXT ) as accession_number\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(source_component as TEXT ) as source_component\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(normalized_component as TEXT ) as normalized_component\n , cast(status as TEXT ) as status\n , cast(result as TEXT ) as result\n , try_cast( result_date as date ) as result_date\n , try_cast( collection_date as date ) as collection_date\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(source_abnormal_flag as TEXT ) as source_abnormal_flag\n , cast(normalized_abnormal_flag as TEXT ) as normalized_abnormal_flag\n , cast(specimen as TEXT ) as specimen\n , cast(ordering_practitioner_id as TEXT ) as ordering_practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_location": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_location.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_location.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_location", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_location"], "alias": "_stg_clinical_location", "checksum": {"name": "sha256", "checksum": "6a259b80d51e583fc2fbedac359791c1461e2f34e9b72802d2b4e40d81d027f4"}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical locations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_location", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7255092, "relation_name": "dev_thuxuan.core._stg_clinical_location", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n cast(location_id as {{ dbt.type_string() }} ) as location_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(name as {{ dbt.type_string() }} ) as name\r\n , cast(facility_type as {{ dbt.type_string() }} ) as facility_type\r\n , cast(parent_organization as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(address as {{ dbt.type_string() }} ) as address\r\n , cast(city as {{ dbt.type_string() }} ) as city\r\n , cast(state as {{ dbt.type_string() }} ) as state\r\n , cast(zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(latitude as {{ dbt.type_float() }} ) as latitude\r\n , cast(longitude as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "refs": [{"name": "location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_location.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(location_id as TEXT ) as location_id\n , cast(npi as TEXT ) as npi\n , cast(name as TEXT ) as name\n , cast(facility_type as TEXT ) as facility_type\n , cast(parent_organization as TEXT ) as parent_organization\n , cast(address as TEXT ) as address\n , cast(city as TEXT ) as city\n , cast(state as TEXT ) as state\n , cast(zip_code as TEXT ) as zip_code\n , cast(latitude as FLOAT ) as latitude\n , cast(longitude as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.location", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_medication.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_medication.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_medication", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_medication"], "alias": "_stg_clinical_medication", "checksum": {"name": "sha256", "checksum": "d0117d9ac0a0b90934eaf6fc6534275c94d3f6588782dba17b751d803473d39b"}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical medications", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_medication", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7285092, "relation_name": "dev_thuxuan.core._stg_clinical_medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(medication_id as {{ dbt.type_string() }} ) as medication_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('dispensing_date', 'YYYY-MM-DD') }} as dispensing_date\r\n , {{ try_to_cast_date('prescribing_date', 'YYYY-MM-DD') }} as prescribing_date\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(ndc_description as {{ dbt.type_string() }} ) as ndc_description\r\n , cast(rxnorm_code as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(rxnorm_description as {{ dbt.type_string() }} ) as rxnorm_description \r\n , cast(atc_code as {{ dbt.type_string() }} ) as atc_code\r\n , cast(atc_description as {{ dbt.type_string() }} ) as atc_description\r\n , cast(route as {{ dbt.type_string() }} ) as route\r\n , cast(strength as {{ dbt.type_string() }} ) as strength\r\n , cast(quantity as {{ dbt.type_int() }} ) as quantity\r\n , cast(quantity_unit as {{ dbt.type_string() }} ) as quantity_unit\r\n , cast(days_supply as {{ dbt.type_int() }} ) as days_supply\r\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('medication') }}", "language": "sql", "refs": [{"name": "medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_medication.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(medication_id as TEXT ) as medication_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , try_cast( dispensing_date as date ) as dispensing_date\n , try_cast( prescribing_date as date ) as prescribing_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(ndc_description as TEXT ) as ndc_description\n , cast(rxnorm_code as TEXT ) as rxnorm_code\n , cast(rxnorm_description as TEXT ) as rxnorm_description \n , cast(atc_code as TEXT ) as atc_code\n , cast(atc_description as TEXT ) as atc_description\n , cast(route as TEXT ) as route\n , cast(strength as TEXT ) as strength\n , cast(quantity as INT ) as quantity\n , cast(quantity_unit as TEXT ) as quantity_unit\n , cast(days_supply as INT ) as days_supply\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_observation.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_observation.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_observation", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_observation"], "alias": "_stg_clinical_observation", "checksum": {"name": "sha256", "checksum": "ad5f9b17ef794de5c2f85baa048133d4228140714b206b10dcd3cd21c171a48f"}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical observations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_observation", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.731509, "relation_name": "dev_thuxuan.core._stg_clinical_observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(observation_id as {{ dbt.type_string() }} ) as observation_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(panel_id as {{ dbt.type_string() }} ) as panel_id\r\n , {{ try_to_cast_date('observation_date', 'YYYY-MM-DD') }} as observation_date\r\n , cast(observation_type as {{ dbt.type_string() }} ) as observation_type\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(result as {{ dbt.type_string() }} ) as result\r\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\r\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('observation') }}", "language": "sql", "refs": [{"name": "observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_observation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n cast(observation_id as TEXT ) as observation_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(panel_id as TEXT ) as panel_id\n , try_cast( observation_date as date ) as observation_date\n , cast(observation_type as TEXT ) as observation_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(result as TEXT ) as result\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_patient.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_patient.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_patient", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_patient"], "alias": "_stg_clinical_patient", "checksum": {"name": "sha256", "checksum": "faf00cae48886707f974022002d0b496035ef32fdf3ea6d873d9feda9b890887"}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical patients", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_patient", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7340233, "relation_name": "dev_thuxuan.core._stg_clinical_patient", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(sex as {{ dbt.type_string() }} ) as sex\r\n , cast(race as {{ dbt.type_string() }} ) as race\r\n , {{ try_to_cast_date('birth_date', 'YYYY-MM-DD') }} as birth_date\r\n , {{ try_to_cast_date('death_date', 'YYYY-MM-DD') }} as death_date\r\n , cast(death_flag as {{ dbt.type_int() }} ) as death_flag\r\n , cast(social_security_number as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(address as {{ dbt.type_string() }} ) as address\r\n , cast(city as {{ dbt.type_string() }} ) as city\r\n , cast(state as {{ dbt.type_string() }} ) as state\r\n , cast(zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(county as {{ dbt.type_string() }} ) as county\r\n , cast(latitude as {{ dbt.type_float() }} ) as latitude\r\n , cast(longitude as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\n\r\nfrom {{ ref('patient') }}", "language": "sql", "refs": [{"name": "patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(patient_id as TEXT ) as patient_id\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(sex as TEXT ) as sex\n , cast(race as TEXT ) as race\n , try_cast( birth_date as date ) as birth_date\n , try_cast( death_date as date ) as death_date\n , cast(death_flag as INT ) as death_flag\n , cast(social_security_number as TEXT ) as social_security_number\n , cast(address as TEXT ) as address\n , cast(city as TEXT ) as city\n , cast(state as TEXT ) as state\n , cast(zip_code as TEXT ) as zip_code\n , cast(county as TEXT ) as county\n , cast(latitude as FLOAT ) as latitude\n , cast(longitude as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\n\nfrom tuva.input_layer.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_practitioner.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_practitioner.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_practitioner"], "alias": "_stg_clinical_practitioner", "checksum": {"name": "sha256", "checksum": "b64d46371c768da23f692131b68d66bef2a8492afaa5f68e5bd94aa70f5557cb"}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical providers", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_practitioner", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7370236, "relation_name": "dev_thuxuan.core._stg_clinical_practitioner", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(practice_affiliation as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(specialty as {{ dbt.type_string() }} ) as specialty\r\n , cast(sub_specialty as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('practitioner') }}", "language": "sql", "refs": [{"name": "practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_practitioner.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(practitioner_id as TEXT ) as practitioner_id\n , cast(npi as TEXT ) as npi\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(practice_affiliation as TEXT ) as practice_affiliation\n , cast(specialty as TEXT ) as specialty\n , cast(sub_specialty as TEXT ) as sub_specialty\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.practitioner", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_procedure.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_procedure.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_procedure", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_procedure"], "alias": "_stg_clinical_procedure", "checksum": {"name": "sha256", "checksum": "4c9bb4f3ddd1136ac2ea875328b04be6603eb75b8ef44410761ce36054d29471"}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical procedures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_procedure", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715349085.7390234, "relation_name": "dev_thuxuan.core._stg_clinical_procedure", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(procedure_id as {{ dbt.type_string() }} ) as procedure_id \r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('procedure_date', 'YYYY-MM-DD') }} as procedure_date\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(modifier_1 as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(modifier_2 as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(modifier_3 as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(modifier_4 as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(modifier_5 as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('procedure') }}", "language": "sql", "refs": [{"name": "procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(procedure_id as TEXT ) as procedure_id \n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( procedure_date as date ) as procedure_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(modifier_1 as TEXT ) as modifier_1\n , cast(modifier_2 as TEXT ) as modifier_2\n , cast(modifier_3 as TEXT ) as modifier_3\n , cast(modifier_4 as TEXT ) as modifier_4\n , cast(modifier_5 as TEXT ) as modifier_5\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-10 13:57:27.457245+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_summary": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_summary"], "alias": "claims_preprocessing_summary", "checksum": {"name": "sha256", "checksum": "49f684cbbe83a011297254e89ae0ad026e290c4ae7da164c5503c000c857bd2a"}, "config": {"enabled": true, "alias": "claims_preprocessing_summary", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_summary", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7480233, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_failure_summary as (\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(count(distinct foreign_key||data_source) as int) as counts\r\n from {{ ref('data_quality__claims_preprocessing_test_detail' )}}\r\n group by\r\n source_table\r\n ,grain\r\n ,test_category\r\n)\r\n\r\n, summary_union as(\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n from test_failure_summary\r\n\r\n /******* The tables below populate the test when no failures are present ******/\r\n union all\r\n\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('claim_type' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts \r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_claim_type_mapping_failures' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_claim_type_unmapped' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('header' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_institutional_header_fail_details' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_professional_header_fail_details' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values' )}} )\r\n\r\n /**** eligibility ****/\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_eligibility' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_missing_values' )}} )\r\n\r\n /**** pharmacy_claim ****/\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_pharmacy_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_pharmacy_claim_missing_values' )}} )\r\n)\r\n\r\nselect \r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(case \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'good'\r\n then '7_good' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\r\n then '4_plausibility' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'good'\r\n then '5_good'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility' \r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'good'\r\n then '4_good'\r\n else test_category \r\n end as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom summary_union", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_unmapped", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_institutional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_professional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "compiled": true, "compiled_code": "\n\nwith test_failure_summary as (\n select\n cast(source_table as TEXT ) as source_table\n , cast(grain as TEXT ) as grain\n , cast(test_category as TEXT ) as test_category\n , cast(count(distinct foreign_key||data_source) as int) as counts\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n group by\n source_table\n ,grain\n ,test_category\n)\n\n, summary_union as(\n select\n cast(source_table as TEXT ) as source_table\n , cast(grain as TEXT ) as grain\n , cast(test_category as TEXT ) as test_category\n , cast(counts as int) as counts\n from test_failure_summary\n\n /******* The tables below populate the test when no failures are present ******/\n union all\n\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('duplicate_claims' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('claim_type' as TEXT ) as test_category\n , cast(0 as int) as counts \n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values where test_category = 'claim_type')\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values where test_category = 'claim_type')\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('header' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('invalid_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values )\n\n /**** eligibility ****/\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('duplicate_eligibility' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('invalid_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values )\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values )\n\n /**** pharmacy_claim ****/\n union all\n select * from (\n select\n cast('normalized_input__pharmacy_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('duplicate_claims' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__pharmacy_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values )\n)\n\nselect \n cast(source_table as TEXT ) as source_table\n , cast(case \n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'normalized_input__medical_claim' and test_category = 'good'\n then '7_good' \n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\n then '4_plausibility' \n when source_table = 'normalized_input__eligibility' and test_category = 'good'\n then '5_good'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility' \n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'good'\n then '4_good'\n else test_category \n end as TEXT ) as test_category\n , cast(counts as int) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_test_detail"], "alias": "claims_preprocessing_test_detail", "checksum": {"name": "sha256", "checksum": "99d7406f5445c1c5271c13c90162b53409592179b39befea2a9c0ae9d350100f"}, "config": {"enabled": true, "alias": "claims_preprocessing_test_detail", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_test": {"name": "pipeline_test", "description": "Flag to indicate a pipeline stopping test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_test_detail", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7536705, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_test_detail", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_detail_union as(\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_medical_claim') }}\r\nunion all\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_eligibility') }}\r\nunion all\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim') }}\r\n\r\n\r\n)\r\n\r\nselect \r\n source_table\r\n , case \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\r\n then '4_plausibility'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility'\r\n else test_category \r\n end as test_category\r\n , test_name \r\n , grain\r\n , claim_type\r\n , pipeline_test\r\n , foreign_key\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom test_detail_union", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail_stage_medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail_stage_eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "compiled": true, "compiled_code": "\n\nwith test_detail_union as(\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_medical_claim\nunion all\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_eligibility\nunion all\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_pharmacy_claim\n\n\n)\n\nselect \n source_table\n , case \n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\n then '4_plausibility'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility'\n else test_category \n end as test_category\n , test_name \n , grain\n , claim_type\n , pipeline_test\n , foreign_key\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_test_result"], "alias": "claims_preprocessing_test_result", "checksum": {"name": "sha256", "checksum": "9be47daf9dfecf8dda1b228df662326e4fa3ae88112c33461759ade2203f35d4"}, "config": {"enabled": true, "alias": "claims_preprocessing_test_result", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_test": {"name": "pipeline_test", "description": "Flag to indicate a pipeline stopping test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_test_result", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7597494, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_test_result", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_eligibility') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_pharmacy_claim') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result_stage_medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_result_stage_eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_medical_claim\n\nunion all\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_eligibility\n\nunion all\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_use_case": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_use_case", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_use_case"], "alias": "claims_preprocessing_use_case", "checksum": {"name": "sha256", "checksum": "60facc24a665f75ff21f4a368b5431c0e5e7f0b445119e5433338e1fb27181b9"}, "config": {"enabled": true, "alias": "claims_preprocessing_use_case", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_use_case", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7646925, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_use_case", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith use_case_stage as(\r\n select\r\n 'encounters' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all\r\n\r\n select \r\n 'service_grouper' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'hcpcs_code missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'pmpm' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'dispensing_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'paid_amount missing'\r\n )\r\n and source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'member_months' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct patient_id||data_source) from {{ ref('normalized_input__eligibility') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'enrollment_start_date missing'\r\n ,'enrollment_end_date invalid'\r\n ,'payer missing'\r\n ,'payer missing'\r\n ,'payer_type invalid'\r\n )\r\n and source_table = 'normalized_input__eligibility'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'claim_start_date missing'\r\n ,'claim_start_date invalid'\r\n ,'patient_id missing'\r\n ,'patient_id invalid'\r\n ,'diagnosis_code_type missing'\r\n ,'diagnosis_code_type invalid'\r\n ,'procedure_code_1 missing'\r\n ,'procedure_code_1 invalid'\r\n ,'procedure_code_type invalid'\r\n ,'procedure_code_type missing'\r\n /** encounter fields **/\r\n ,'diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('ndc_code missing'\r\n ,'patient_id missing'\r\n ,'paid_date missing'\r\n )\r\n and source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from use_case_stage", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "compiled": true, "compiled_code": "\nwith use_case_stage as(\n select\n 'encounters' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all\n\n select \n 'service_grouper' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'hcpcs_code missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'readmissions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'pmpm' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'claim_start_date missing'\n ,'claim_type invalid'\n ,'claim_type missing'\n\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'readmissions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'dispensing_date missing'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'paid_amount missing'\n )\n and source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'member_months' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct patient_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_eligibility ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'enrollment_start_date missing'\n ,'enrollment_end_date invalid'\n ,'payer missing'\n ,'payer missing'\n ,'payer_type invalid'\n )\n and source_table = 'normalized_input__eligibility'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'chronic_conditions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'claim_start_date missing'\n ,'claim_start_date invalid'\n ,'patient_id missing'\n ,'patient_id invalid'\n ,'diagnosis_code_type missing'\n ,'diagnosis_code_type invalid'\n ,'procedure_code_1 missing'\n ,'procedure_code_1 invalid'\n ,'procedure_code_type invalid'\n ,'procedure_code_type missing'\n /** encounter fields **/\n ,'diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'chronic_conditions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('ndc_code missing'\n ,'patient_id missing'\n ,'paid_date missing'\n )\n and source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , test_name\n)\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_claim_type_mapping_failures"], "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "checksum": {"name": "sha256", "checksum": "9dd1e802f1053b6ef9dd084a94ce6129397a3396e3e877af4b63d57a0fd7f97b"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.81465, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith claim_type_mapping as (\r\n\r\n select \r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , claim_type as source_claim_type\r\n , case\r\n when bill_type_code is not null or revenue_center_code is not null \r\n then 'institutional'\r\n when place_of_service_code is not null\r\n then 'professional'\r\n else null\r\n end as data_profiling_claim_type\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_type_mapping.claim_id\r\n , claim_type_mapping.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_type_mapping\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type mapping incorrect'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\nwhere claim_type_mapping.source_claim_type <> claim_type_mapping.data_profiling_claim_type\r\ngroup by\r\n claim_type_mapping.claim_id\r\n , claim_type_mapping.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "compiled": true, "compiled_code": "\n\nwith claim_type_mapping as (\n\n select \n claim_id\n , claim_line_number\n , data_source\n , claim_type as source_claim_type\n , case\n when bill_type_code is not null or revenue_center_code is not null \n then 'institutional'\n when place_of_service_code is not null\n then 'professional'\n else null\n end as data_profiling_claim_type\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_type_mapping.claim_id\n , claim_type_mapping.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom claim_type_mapping\n left join test_catalog\n on test_catalog.test_name = 'claim_type mapping incorrect'\n and test_catalog.source_table = 'normalized_input__medical_claim'\nwhere claim_type_mapping.source_claim_type <> claim_type_mapping.data_profiling_claim_type\ngroup by\n claim_type_mapping.claim_id\n , claim_type_mapping.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_claim_type_unmapped", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_claim_type_unmapped"], "alias": "_int_claims_preprocessing_claim_type_unmapped", "checksum": {"name": "sha256", "checksum": "d66e328804ba900623e0c3a087abb76f3221526f47a77b93e933121613552367"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_claim_type_unmapped", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_claim_type_unmapped", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7874277, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_type\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\nwhere medical_claim.claim_type is null\r\ngroup by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select\n claim_id\n , data_source\n , claim_type\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom medical_claim\n left join test_catalog\n on test_catalog.test_name = 'claim_type missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\nwhere medical_claim.claim_type is null\ngroup by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_denominators"], "alias": "_int_claims_preprocessing_eligibility_denominators", "checksum": {"name": "sha256", "checksum": "03e9cc2613a0a3a628678c708cc92d4609312b53e21de546d2f6bcbe48c73e86"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_denominators", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_denominators", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7792706, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Denominator logic for invalid value tests is dependent on whether that\r\n specific field is populated or not. We created a macro to automatically\r\n generate the CTE. All invalid value tests must have a\r\n test_category = 'invalid_values' in the catalog seed.\r\n*/\r\nwith all_denominator as (\r\n\r\n select\r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct patient_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, invalid_value_denominators as (\r\n\r\n {{ eligibility_denominator_invalid_values(builtins.ref('normalized_input__eligibility')) }}\r\n\r\n)\r\n\r\nselect * from all_denominator\r\nunion all\r\nselect * from invalid_value_denominators", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.eligibility_denominator_invalid_values"], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "compiled": true, "compiled_code": "\n/*\n Denominator logic for invalid value tests is dependent on whether that\n specific field is populated or not. We created a macro to automatically\n generate the CTE. All invalid value tests must have a\n test_category = 'invalid_values' in the catalog seed.\n*/\nwith all_denominator as (\n\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, invalid_value_denominators as (\n\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'dual_status_code'\n where rel.dual_status_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'gender'\n where rel.gender is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'medicare_status_code'\n where rel.medicare_status_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'original_reason_entitlement_code'\n where rel.original_reason_entitlement_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'payer_type'\n where rel.payer_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'race'\n where rel.race is not null\n group by cat.test_name\n \n\n)\n\nselect * from all_denominator\nunion all\nselect * from invalid_value_denominators", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_duplicates"], "alias": "_int_claims_preprocessing_eligibility_duplicates", "checksum": {"name": "sha256", "checksum": "ee3dfd309f727c2ebeb0f9f2c64ae839110fad0bfd553243b3656e94e33a2247"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7672703, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligibility as (\r\n\r\n select\r\n patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , data_source\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate eligibility'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\ngroup by\r\n eligibility.patient_id\r\n , eligibility.member_id\r\n , eligibility.payer\r\n , eligibility.plan\r\n , eligibility.enrollment_start_date\r\n , eligibility.enrollment_end_date\r\n , eligibility.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith eligibility as (\n\n select\n patient_id\n , member_id\n , payer\n , plan\n , enrollment_start_date\n , enrollment_end_date\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom eligibility\n left join test_catalog\n on test_catalog.test_name = 'duplicate eligibility'\n and test_catalog.source_table = 'normalized_input__eligibility'\ngroup by\n eligibility.patient_id\n , eligibility.member_id\n , eligibility.payer\n , eligibility.plan\n , eligibility.enrollment_start_date\n , eligibility.enrollment_end_date\n , eligibility.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_invalid_values"], "alias": "_int_claims_preprocessing_eligibility_invalid_values", "checksum": {"name": "sha256", "checksum": "7c71ea7373e62942ad0206bbe4367c6a34dfb5c139df0ab7a1752c5f341be773"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_invalid_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_invalid_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7702708, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligiblity as (\r\n\r\n select *\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_gender as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.gender\r\n , count(eligiblity.gender) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__gender') }} gender\r\n on eligiblity.gender = gender.gender\r\n left join test_catalog\r\n on test_catalog.test_name = 'gender invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where gender.gender is null\r\n and eligiblity.gender is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.gender\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_race as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.race\r\n , count(eligiblity.race) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__race') }} race\r\n on eligiblity.race = race.description\r\n left join test_catalog\r\n on test_catalog.test_name = 'race invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where race.description is null\r\n and eligiblity.race is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.race\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_payer_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.payer_type\r\n , count(eligiblity.payer_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__payer_type') }} payer\r\n on eligiblity.payer_type = payer.payer_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'payer_type invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where payer.payer_type is null\r\n and eligiblity.payer_type is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.payer_type\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_orec as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.original_reason_entitlement_code\r\n , count(eligiblity.original_reason_entitlement_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_orec') }} orec\r\n on eligiblity.original_reason_entitlement_code = orec.original_reason_entitlement_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'original_reason_entitlement_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where orec.original_reason_entitlement_code is null\r\n and eligiblity.original_reason_entitlement_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.original_reason_entitlement_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_dual_status_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.dual_status_code\r\n , count(eligiblity.dual_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_dual_eligibility') }} dual\r\n on eligiblity.dual_status_code = dual.dual_status_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'dual_status_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where dual.dual_status_code is null\r\n and eligiblity.dual_status_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.dual_status_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_medicare_status_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.medicare_status_code\r\n , count(eligiblity.medicare_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_status') }} status\r\n on eligiblity.medicare_status_code = status.medicare_status_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'medicare_status_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where status.medicare_status_code is null\r\n and eligiblity.medicare_status_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.medicare_status_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_gender\r\nunion all\r\nselect * from valid_race\r\nunion all\r\nselect * from valid_payer_type\r\nunion all\r\nselect * from valid_orec\r\nunion all\r\nselect * from valid_dual_status_code\r\nunion all\r\nselect * from valid_medicare_status_code", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__gender", "package": null, "version": null}, {"name": "terminology__race", "package": null, "version": null}, {"name": "terminology__payer_type", "package": null, "version": null}, {"name": "terminology__medicare_orec", "package": null, "version": null}, {"name": "terminology__medicare_dual_eligibility", "package": null, "version": null}, {"name": "terminology__medicare_status", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__race", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_status"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith eligiblity as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_gender as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.gender\n , count(eligiblity.gender) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.gender gender\n on eligiblity.gender = gender.gender\n left join test_catalog\n on test_catalog.test_name = 'gender invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where gender.gender is null\n and eligiblity.gender is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.gender\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_race as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.race\n , count(eligiblity.race) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.race race\n on eligiblity.race = race.description\n left join test_catalog\n on test_catalog.test_name = 'race invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where race.description is null\n and eligiblity.race is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.race\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_payer_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.payer_type\n , count(eligiblity.payer_type) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.payer_type payer\n on eligiblity.payer_type = payer.payer_type\n left join test_catalog\n on test_catalog.test_name = 'payer_type invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where payer.payer_type is null\n and eligiblity.payer_type is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.payer_type\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_orec as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.original_reason_entitlement_code\n , count(eligiblity.original_reason_entitlement_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_orec orec\n on eligiblity.original_reason_entitlement_code = orec.original_reason_entitlement_code\n left join test_catalog\n on test_catalog.test_name = 'original_reason_entitlement_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where orec.original_reason_entitlement_code is null\n and eligiblity.original_reason_entitlement_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.original_reason_entitlement_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_dual_status_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.dual_status_code\n , count(eligiblity.dual_status_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_dual_eligibility dual\n on eligiblity.dual_status_code = dual.dual_status_code\n left join test_catalog\n on test_catalog.test_name = 'dual_status_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where dual.dual_status_code is null\n and eligiblity.dual_status_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.dual_status_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_medicare_status_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.medicare_status_code\n , count(eligiblity.medicare_status_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_status status\n on eligiblity.medicare_status_code = status.medicare_status_code\n left join test_catalog\n on test_catalog.test_name = 'medicare_status_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where status.medicare_status_code is null\n and eligiblity.medicare_status_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.medicare_status_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_gender\nunion all\nselect * from valid_race\nunion all\nselect * from valid_payer_type\nunion all\nselect * from valid_orec\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_missing_values"], "alias": "_int_claims_preprocessing_eligibility_missing_values", "checksum": {"name": "sha256", "checksum": "6b795bc5cbe1311ebfc8c7aab36517f89622b834060bf48e51bfd1da853a9f07"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7732701, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set eligibility_missing_column_list = [\r\n 'patient_id'\r\n , 'member_id'\r\n , 'gender'\r\n , 'race'\r\n , 'birth_date'\r\n , 'death_date'\r\n , 'death_flag'\r\n , 'enrollment_start_date'\r\n , 'enrollment_end_date'\r\n , 'payer'\r\n , 'payer_type'\r\n , 'dual_status_code'\r\n , 'medicare_status_code'\r\n , 'first_name'\r\n , 'last_name'\r\n , 'address'\r\n , 'city'\r\n , 'state'\r\n , 'zip_code'\r\n , 'phone'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith eligibility_missing as (\r\n\r\n {{ eligibility_missing_column_check(builtins.ref('normalized_input__eligibility'), eligibility_missing_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , eligibility_missing.patient_id\r\n , eligibility_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\n left join test_catalog\r\n on test_catalog.test_name = eligibility_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\ngroup by\r\n eligibility_missing.patient_id\r\n , eligibility_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as (\n\n \n select\n patient_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where patient_id is null\n union all\n select\n patient_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where member_id is null\n union all\n select\n patient_id\n , data_source\n , 'gender' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where gender is null\n union all\n select\n patient_id\n , data_source\n , 'race' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where race is null\n union all\n select\n patient_id\n , data_source\n , 'birth_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where birth_date is null\n union all\n select\n patient_id\n , data_source\n , 'death_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where death_date is null\n union all\n select\n patient_id\n , data_source\n , 'death_flag' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where death_flag is null\n union all\n select\n patient_id\n , data_source\n , 'enrollment_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where enrollment_start_date is null\n union all\n select\n patient_id\n , data_source\n , 'enrollment_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where enrollment_end_date is null\n union all\n select\n patient_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where payer is null\n union all\n select\n patient_id\n , data_source\n , 'payer_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where payer_type is null\n union all\n select\n patient_id\n , data_source\n , 'dual_status_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where dual_status_code is null\n union all\n select\n patient_id\n , data_source\n , 'medicare_status_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where medicare_status_code is null\n union all\n select\n patient_id\n , data_source\n , 'first_name' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where first_name is null\n union all\n select\n patient_id\n , data_source\n , 'last_name' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where last_name is null\n union all\n select\n patient_id\n , data_source\n , 'address' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where address is null\n union all\n select\n patient_id\n , data_source\n , 'city' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where city is null\n union all\n select\n patient_id\n , data_source\n , 'state' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where state is null\n union all\n select\n patient_id\n , data_source\n , 'zip_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where zip_code is null\n union all\n select\n patient_id\n , data_source\n , 'phone' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where phone is null\n union all\n select\n patient_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where data_source is null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , eligibility_missing.patient_id\n , eligibility_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom eligibility_missing\n left join test_catalog\n on test_catalog.test_name = eligibility_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__eligibility'\ngroup by\n eligibility_missing.patient_id\n , eligibility_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_plausibility"], "alias": "_int_claims_preprocessing_eligibility_plausibility", "checksum": {"name": "sha256", "checksum": "f0abd1cbfb4ba0f705f6e13ef468549372c8b30f1c730de4814b4ec299921f0a"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_plausibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_plausibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.78127, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligiblity as (\r\n\r\n select *\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, multiple_genders_test as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple genders'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.gender) > 1\r\n\r\n)\r\n\r\n, multiple_races_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple races'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.race) > 1\r\n\r\n)\r\n\r\n, multiple_birth_dates_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple birth dates'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.birth_date) > 1\r\n\r\n)\r\n\r\n, multiple_death_dates_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple death dates'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.death_date) > 1\r\n\r\n)\r\n\r\n, birth_date_after_death_date as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'birth date after death date'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where eligiblity.birth_date > eligiblity.death_date\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from multiple_genders_test\r\nunion all\r\nselect * from multiple_races_test\r\nunion all\r\nselect * from multiple_birth_dates_test\r\nunion all\r\nselect * from multiple_death_dates_test\r\nunion all\r\nselect * from birth_date_after_death_date", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith eligiblity as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, multiple_genders_test as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple genders'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.gender) > 1\n\n)\n\n, multiple_races_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple races'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.race) > 1\n\n)\n\n, multiple_birth_dates_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple birth dates'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.birth_date) > 1\n\n)\n\n, multiple_death_dates_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple death dates'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.death_date) > 1\n\n)\n\n, birth_date_after_death_date as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'birth date after death date'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where eligiblity.birth_date > eligiblity.death_date\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from multiple_genders_test\nunion all\nselect * from multiple_races_test\nunion all\nselect * from multiple_birth_dates_test\nunion all\nselect * from multiple_death_dates_test\nunion all\nselect * from birth_date_after_death_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_institutional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_institutional_header_fail_details"], "alias": "_int_claims_preprocessing_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "812963ea27bec2d240008e7830bbdb4a32388cb6a1add219889237ff777a0a61"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_institutional_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_institutional_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.790428, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set institutional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'admission_date'\r\n , 'discharge_date'\r\n , 'admit_source_code'\r\n , 'admit_type_code'\r\n , 'discharge_disposition_code'\r\n , 'bill_type_code'\r\n , 'ms_drg_code'\r\n , 'facility_npi'\r\n , 'billing_npi'\r\n , 'rendering_npi'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'diagnosis_poa_1'\r\n , 'diagnosis_poa_2'\r\n , 'diagnosis_poa_3'\r\n , 'diagnosis_poa_4'\r\n , 'diagnosis_poa_5'\r\n , 'diagnosis_poa_6'\r\n , 'diagnosis_poa_7'\r\n , 'diagnosis_poa_8'\r\n , 'diagnosis_poa_9'\r\n , 'diagnosis_poa_10'\r\n , 'diagnosis_poa_11'\r\n , 'diagnosis_poa_12'\r\n , 'diagnosis_poa_13'\r\n , 'diagnosis_poa_14'\r\n , 'diagnosis_poa_15'\r\n , 'diagnosis_poa_16'\r\n , 'diagnosis_poa_17'\r\n , 'diagnosis_poa_18'\r\n , 'diagnosis_poa_19'\r\n , 'diagnosis_poa_20'\r\n , 'diagnosis_poa_21'\r\n , 'diagnosis_poa_22'\r\n , 'diagnosis_poa_23'\r\n , 'diagnosis_poa_24'\r\n , 'diagnosis_poa_25'\r\n , 'procedure_code_type'\r\n , 'procedure_code_1'\r\n , 'procedure_code_2'\r\n , 'procedure_code_3'\r\n , 'procedure_code_4'\r\n , 'procedure_code_5'\r\n , 'procedure_code_6'\r\n , 'procedure_code_7'\r\n , 'procedure_code_8'\r\n , 'procedure_code_9'\r\n , 'procedure_code_10'\r\n , 'procedure_code_11'\r\n , 'procedure_code_12'\r\n , 'procedure_code_13'\r\n , 'procedure_code_14'\r\n , 'procedure_code_15'\r\n , 'procedure_code_16'\r\n , 'procedure_code_17'\r\n , 'procedure_code_18'\r\n , 'procedure_code_19'\r\n , 'procedure_code_20'\r\n , 'procedure_code_21'\r\n , 'procedure_code_22'\r\n , 'procedure_code_23'\r\n , 'procedure_code_24'\r\n , 'procedure_code_25'\r\n , 'procedure_date_1'\r\n , 'procedure_date_2'\r\n , 'procedure_date_3'\r\n , 'procedure_date_4'\r\n , 'procedure_date_5'\r\n , 'procedure_date_6'\r\n , 'procedure_date_7'\r\n , 'procedure_date_8'\r\n , 'procedure_date_9'\r\n , 'procedure_date_10'\r\n , 'procedure_date_11'\r\n , 'procedure_date_12'\r\n , 'procedure_date_13'\r\n , 'procedure_date_14'\r\n , 'procedure_date_15'\r\n , 'procedure_date_16'\r\n , 'procedure_date_17'\r\n , 'procedure_date_18'\r\n , 'procedure_date_19'\r\n , 'procedure_date_20'\r\n , 'procedure_date_21'\r\n , 'procedure_date_22'\r\n , 'procedure_date_23'\r\n , 'procedure_date_24'\r\n , 'procedure_date_25'\r\n , 'data_source'\r\n] -%}\r\n\r\n\r\nwith institutional_header_duplicates as (\r\n\r\n {{ medical_claim_header_duplicate_check(builtins.ref('normalized_input__medical_claim'), institutional_header_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , institutional_header_duplicates.claim_id\r\n , institutional_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = institutional_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n and test_catalog.claim_type = 'institutional'\r\ngroup by \r\n institutional_header_duplicates.claim_id\r\n , institutional_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith institutional_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'admission_date' as column_checked\n , count(distinct admission_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admission_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'discharge_date' as column_checked\n , count(distinct discharge_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct discharge_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'admit_source_code' as column_checked\n , count(distinct admit_source_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admit_source_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'admit_type_code' as column_checked\n , count(distinct admit_type_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admit_type_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'discharge_disposition_code' as column_checked\n , count(distinct discharge_disposition_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct discharge_disposition_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_checked\n , count(distinct bill_type_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct bill_type_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'ms_drg_code' as column_checked\n , count(distinct ms_drg_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct ms_drg_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'facility_npi' as column_checked\n , count(distinct facility_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct facility_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n , count(distinct rendering_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct rendering_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_1' as column_checked\n , count(distinct diagnosis_poa_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_2' as column_checked\n , count(distinct diagnosis_poa_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_3' as column_checked\n , count(distinct diagnosis_poa_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_4' as column_checked\n , count(distinct diagnosis_poa_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_5' as column_checked\n , count(distinct diagnosis_poa_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_6' as column_checked\n , count(distinct diagnosis_poa_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_7' as column_checked\n , count(distinct diagnosis_poa_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_8' as column_checked\n , count(distinct diagnosis_poa_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_9' as column_checked\n , count(distinct diagnosis_poa_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_10' as column_checked\n , count(distinct diagnosis_poa_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_11' as column_checked\n , count(distinct diagnosis_poa_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_12' as column_checked\n , count(distinct diagnosis_poa_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_13' as column_checked\n , count(distinct diagnosis_poa_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_14' as column_checked\n , count(distinct diagnosis_poa_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_15' as column_checked\n , count(distinct diagnosis_poa_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_16' as column_checked\n , count(distinct diagnosis_poa_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_17' as column_checked\n , count(distinct diagnosis_poa_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_18' as column_checked\n , count(distinct diagnosis_poa_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_19' as column_checked\n , count(distinct diagnosis_poa_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_20' as column_checked\n , count(distinct diagnosis_poa_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_21' as column_checked\n , count(distinct diagnosis_poa_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_22' as column_checked\n , count(distinct diagnosis_poa_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_23' as column_checked\n , count(distinct diagnosis_poa_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_24' as column_checked\n , count(distinct diagnosis_poa_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_25' as column_checked\n , count(distinct diagnosis_poa_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_type' as column_checked\n , count(distinct procedure_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_1' as column_checked\n , count(distinct procedure_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_2' as column_checked\n , count(distinct procedure_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_3' as column_checked\n , count(distinct procedure_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_4' as column_checked\n , count(distinct procedure_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_5' as column_checked\n , count(distinct procedure_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_6' as column_checked\n , count(distinct procedure_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_7' as column_checked\n , count(distinct procedure_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_8' as column_checked\n , count(distinct procedure_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_9' as column_checked\n , count(distinct procedure_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_10' as column_checked\n , count(distinct procedure_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_11' as column_checked\n , count(distinct procedure_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_12' as column_checked\n , count(distinct procedure_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_13' as column_checked\n , count(distinct procedure_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_14' as column_checked\n , count(distinct procedure_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_15' as column_checked\n , count(distinct procedure_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_16' as column_checked\n , count(distinct procedure_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_17' as column_checked\n , count(distinct procedure_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_18' as column_checked\n , count(distinct procedure_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_19' as column_checked\n , count(distinct procedure_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_20' as column_checked\n , count(distinct procedure_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_21' as column_checked\n , count(distinct procedure_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_22' as column_checked\n , count(distinct procedure_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_23' as column_checked\n , count(distinct procedure_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_24' as column_checked\n , count(distinct procedure_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_25' as column_checked\n , count(distinct procedure_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_1' as column_checked\n , count(distinct procedure_date_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_2' as column_checked\n , count(distinct procedure_date_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_3' as column_checked\n , count(distinct procedure_date_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_4' as column_checked\n , count(distinct procedure_date_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_5' as column_checked\n , count(distinct procedure_date_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_6' as column_checked\n , count(distinct procedure_date_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_7' as column_checked\n , count(distinct procedure_date_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_8' as column_checked\n , count(distinct procedure_date_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_9' as column_checked\n , count(distinct procedure_date_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_10' as column_checked\n , count(distinct procedure_date_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_11' as column_checked\n , count(distinct procedure_date_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_12' as column_checked\n , count(distinct procedure_date_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_13' as column_checked\n , count(distinct procedure_date_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_14' as column_checked\n , count(distinct procedure_date_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_15' as column_checked\n , count(distinct procedure_date_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_16' as column_checked\n , count(distinct procedure_date_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_17' as column_checked\n , count(distinct procedure_date_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_18' as column_checked\n , count(distinct procedure_date_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_19' as column_checked\n , count(distinct procedure_date_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_20' as column_checked\n , count(distinct procedure_date_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_21' as column_checked\n , count(distinct procedure_date_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_22' as column_checked\n , count(distinct procedure_date_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_23' as column_checked\n , count(distinct procedure_date_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_24' as column_checked\n , count(distinct procedure_date_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_25' as column_checked\n , count(distinct procedure_date_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , institutional_header_duplicates.claim_id\n , institutional_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom institutional_header_duplicates\n left join test_catalog\n on test_catalog.test_name = institutional_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n and test_catalog.claim_type = 'institutional'\ngroup by \n institutional_header_duplicates.claim_id\n , institutional_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_dates"], "alias": "_int_claims_preprocessing_medical_claim_dates", "checksum": {"name": "sha256", "checksum": "4d7d5e4488b27473dd0ecfafbd76343301b8aa659f6b8a11654c9e289ee91075"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_dates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_dates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8281646, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set claim_date_column_list = [\r\n 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'claim_line_start_date'\r\n , 'claim_line_end_date'\r\n , 'paid_date'\r\n , 'procedure_date_1'\r\n , 'procedure_date_2'\r\n , 'procedure_date_3'\r\n , 'procedure_date_4'\r\n , 'procedure_date_5'\r\n , 'procedure_date_6'\r\n , 'procedure_date_7'\r\n , 'procedure_date_8'\r\n , 'procedure_date_9'\r\n , 'procedure_date_10'\r\n , 'procedure_date_11'\r\n , 'procedure_date_12'\r\n , 'procedure_date_13'\r\n , 'procedure_date_14'\r\n , 'procedure_date_15'\r\n , 'procedure_date_16'\r\n , 'procedure_date_17'\r\n , 'procedure_date_18'\r\n , 'procedure_date_19'\r\n , 'procedure_date_20'\r\n , 'procedure_date_21'\r\n , 'procedure_date_22'\r\n , 'procedure_date_23'\r\n , 'procedure_date_24'\r\n , 'procedure_date_25'\r\n] -%}\r\n\r\nwith claim_dates as (\r\n\r\n {{ medical_claim_date_check(builtins.ref('normalized_input__medical_claim'), claim_date_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_dates\r\n left join test_catalog\r\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_date_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith claim_dates as (\n\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_start_date = cal.full_date\n where cal.full_date is null\n and rel.claim_start_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_end_date = cal.full_date\n where cal.full_date is null\n and rel.claim_end_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_line_start_date = cal.full_date\n where cal.full_date is null\n and rel.claim_line_start_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_line_end_date = cal.full_date\n where cal.full_date is null\n and rel.claim_line_end_date is not null\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.paid_date = cal.full_date\n where cal.full_date is null\n and rel.paid_date is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_1 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_1 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_2' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_2 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_2 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_3' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_3 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_3 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_4' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_4 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_4 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_5' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_5 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_5 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_6' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_6 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_6 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_7' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_7 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_7 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_8' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_8 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_8 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_9' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_9 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_9 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_10' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_10 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_10 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_11' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_11 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_11 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_12' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_12 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_12 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_13' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_13 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_13 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_14' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_14 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_14 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_15' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_15 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_15 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_16' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_16 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_16 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_17' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_17 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_17 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_18' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_18 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_18 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_19' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_19 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_19 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_20' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_20 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_20 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_21' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_21 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_21 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_22' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_22 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_22 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_23' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_23 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_23 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_24' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_24 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_24 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_25' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_25 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_25 is not null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom claim_dates\n left join test_catalog\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_dates_inst", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_dates_inst"], "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "checksum": {"name": "sha256", "checksum": "309aeeb63444b99834cfa914285903e7ff1feb578fc7d2834bf2c90e110c72f2"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8338637, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates_inst", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set claim_date_column_list = [\r\n 'admission_date'\r\n , 'discharge_date'\r\n] -%}\r\n\r\nwith claim_dates as (\r\n\r\n {{ medical_claim_date_check(builtins.ref('normalized_input__medical_claim'), claim_date_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_dates\r\n left join test_catalog\r\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_date_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "compiled": true, "compiled_code": "\n\nwith claim_dates as (\n\n select\n claim_id\n , data_source\n , 'admission_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.admission_date = cal.full_date\n where cal.full_date is null\n and rel.admission_date is not null\n and rel.claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'discharge_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.discharge_date = cal.full_date\n where cal.full_date is null\n and rel.discharge_date is not null\n and rel.claim_type = 'institutional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom claim_dates\n left join test_catalog\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_denominators"], "alias": "_int_claims_preprocessing_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "5229da26627ac72855e20350b2d27afe882366e3665a4b743067a401bf8a5c60"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_denominators", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_denominators", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8231592, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Denominator logic for invalid value tests is dependent on whether that\r\n specific field is populated or not. We created a macro to automatically\r\n generate the CTE. All invalid value tests must have a\r\n test_category = 'invalid_values' in the catalog seed.\r\n*/\r\nwith professional_denominator as (\r\n\r\n select\r\n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , cast(count(distinct claim_id||data_source) as int) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type = 'professional'\r\n\r\n)\r\n\r\n, institutional_denominator as (\r\n\r\n select\r\n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id||data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type = 'institutional'\r\n\r\n)\r\n\r\n, all_claim_denominator as (\r\n\r\n select\r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id||data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type is not null\r\n\r\n)\r\n\r\n, invalid_value_denominators as (\r\n\r\n {{ medical_claim_denominator_invalid_values(builtins.ref('normalized_input__medical_claim')) }}\r\n\r\n)\r\n\r\nselect * from institutional_denominator\r\nunion all \r\nselect * from professional_denominator\r\nunion all\r\nselect * from all_claim_denominator\r\nunion all\r\nselect * from invalid_value_denominators", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.medical_claim_denominator_invalid_values"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "compiled": true, "compiled_code": "\n/*\n Denominator logic for invalid value tests is dependent on whether that\n specific field is populated or not. We created a macro to automatically\n generate the CTE. All invalid value tests must have a\n test_category = 'invalid_values' in the catalog seed.\n*/\nwith professional_denominator as (\n\n select\n cast('professional' as TEXT ) as test_denominator_name\n , cast(count(distinct claim_id||data_source) as int) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n\n)\n\n, institutional_denominator as (\n\n select\n cast('institutional' as TEXT ) as test_denominator_name\n , count(distinct claim_id||data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n\n)\n\n, all_claim_denominator as (\n\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct claim_id||data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type is not null\n\n)\n\n, invalid_value_denominators as (\n\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'admit_source_code'\n where rel.admit_source_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'admit_type_code'\n where rel.admit_type_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'apr_drg_code'\n where rel.apr_drg_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'bill_type_code'\n where rel.bill_type_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'billing_npi'\n where rel.billing_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'claim_type'\n where rel.claim_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_code_1'\n where rel.diagnosis_code_1 is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_code_type'\n where rel.diagnosis_code_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_poa_1'\n where rel.diagnosis_poa_1 is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'discharge_disposition_code'\n where rel.discharge_disposition_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'facility_npi'\n where rel.facility_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'ms_drg_code'\n where rel.ms_drg_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'place_of_service_code'\n where rel.place_of_service_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'procedure_code_type'\n where rel.procedure_code_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'rendering_npi'\n where rel.rendering_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'revenue_center_code'\n where rel.revenue_center_code is not null\n group by cat.test_name\n \n\n)\n\nselect * from institutional_denominator\nunion all \nselect * from professional_denominator\nunion all\nselect * from all_claim_denominator\nunion all\nselect * from invalid_value_denominators", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_duplicates"], "alias": "_int_claims_preprocessing_medical_claim_duplicates", "checksum": {"name": "sha256", "checksum": "b0dfebfd62030737d7bf585961d468544ced4137eefe9aeee7b8411e4d32f8ff"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8176558, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate medical claims'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.data_quality__test_catalog", "model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n left join test_catalog\n on test_catalog.test_name = 'duplicate medical claims'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_id\n , claim_line_number\n , data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_inst_missing_values"], "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "checksum": {"name": "sha256", "checksum": "c6827faa41e7316f5c965981dd2fb294ecee5e38606fe236f0d9b92b7d460b92"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8059878, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set institutional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'bill_type_code'\r\n , 'revenue_center_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'facility_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith institutional_missing as (\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('normalized_input__medical_claim'), institutional_missing_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , institutional_missing.claim_id\r\n , institutional_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_missing\r\n left join test_catalog\r\n on test_catalog.test_name = institutional_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n institutional_missing.claim_id\r\n , institutional_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith institutional_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_line_number is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where patient_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where member_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where payer is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where plan is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_start_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_end_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where bill_type_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'revenue_center_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where revenue_center_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'hcpcs_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where hcpcs_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where rendering_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where billing_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'facility_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where facility_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_amount is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_type is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_1 is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where data_source is null\n and claim_type = 'institutional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , institutional_missing.claim_id\n , institutional_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom institutional_missing\n left join test_catalog\n on test_catalog.test_name = institutional_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n institutional_missing.claim_id\n , institutional_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_invalid_npi", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_invalid_npi"], "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "checksum": {"name": "sha256", "checksum": "a936358a09a6066d89d4f5e970a9cb51a6bef309ab3bd40e6637b34529377b49"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8089879, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_npi", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_billing_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.billing_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.billing_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'billing_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.billing_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_facility_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.facility_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.facility_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'facility_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.facility_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_rendering_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.rendering_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.rendering_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'rendering_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.rendering_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_billing_npi\r\nunion all\r\nselect * from valid_facility_npi\r\nunion all\r\nselect * from valid_rendering_npi", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_billing_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.billing_npi) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.billing_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'billing_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.billing_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_facility_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.facility_npi) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.facility_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'facility_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.facility_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_rendering_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.rendering_npi) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.rendering_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'rendering_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.rendering_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_billing_npi\nunion all\nselect * from valid_facility_npi\nunion all\nselect * from valid_rendering_npi", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_invalid_values"], "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "checksum": {"name": "sha256", "checksum": "babd7d2de39c87ccfb57489b9f92ff8f5fdb945017bcfbd670f14f32e2ef1565"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7999897, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_bill_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.bill_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__bill_type')}} tob\r\n on medical_claim.bill_type_code = tob.bill_type_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'bill_type_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and tob.bill_type_code is null\r\n and medical_claim.bill_type_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_revenue_center as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.revenue_center_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__revenue_center') }} rev\r\n on medical_claim.revenue_center_code = rev.revenue_center_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'revenue_center_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and rev.revenue_center_code is null\r\n and medical_claim.revenue_center_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_discharge_disposition as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.discharge_disposition_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__discharge_disposition') }} discharge\r\n on medical_claim.discharge_disposition_code = discharge.discharge_disposition_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'discharge_disposition_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and discharge.discharge_disposition_code is null\r\n and medical_claim.discharge_disposition_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_admit_source as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.admit_source_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__admit_source') }} adsource\r\n on medical_claim.admit_source_code = adsource.admit_source_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'admit_source_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and adsource.admit_source_code is null\r\n and medical_claim.admit_source_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_admit_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.admit_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__admit_type') }} adtype\r\n on medical_claim.admit_type_code = adtype.admit_type_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'admit_type_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and adtype.admit_type_code is null\r\n and medical_claim.admit_type_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_ms_drg as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.ms_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__ms_drg') }} msdrg\r\n on medical_claim.ms_drg_code = msdrg.ms_drg_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'ms_drg_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and msdrg.ms_drg_code is null\r\n and medical_claim.ms_drg_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_apr_drg as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.apr_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__apr_drg') }} aprdrg\r\n on medical_claim.apr_drg_code = aprdrg.apr_drg_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'apr_drg_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and aprdrg.apr_drg_code is null\r\n and medical_claim.apr_drg_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_present_on_admission as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_poa_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__present_on_admission') }} poa\r\n on medical_claim.diagnosis_poa_1 = poa.present_on_admit_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_poa_1 invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and poa.present_on_admit_code is null\r\n and medical_claim.diagnosis_poa_1 is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_procedure_code_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.procedure_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on medical_claim.procedure_code_type = codetype.code_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'procedure_code_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claim_type = 'institutional'\r\n and codetype.code_type is null\r\n and medical_claim.procedure_code_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_place_of_service as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.place_of_service_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__place_of_service') }} pos\r\n on medical_claim.place_of_service_code = pos.place_of_service_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'place_of_service_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claim_type = 'professional'\r\n and pos.place_of_service_code is null\r\n and medical_claim.place_of_service_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_diagnosis_code_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on medical_claim.diagnosis_code_type = codetype.code_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_code_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where codetype.code_type is null\r\n and medical_claim.diagnosis_code_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_diagnosis_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_code_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__icd_10_cm') }} icd\r\n on medical_claim.diagnosis_code_1 = icd.icd_10_cm\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_code_1 invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where diagnosis_code_type = 'icd-10-cm'\r\n and icd.icd_10_cm is null\r\n and medical_claim.diagnosis_code_1 is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_claim_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.claim_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__claim_type') }} claimtype\r\n on medical_claim.claim_type = claimtype.claim_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claimtype.claim_type is null\r\n and medical_claim.claim_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_bill_type\r\nunion all \r\nselect * from valid_revenue_center\r\nunion all \r\nselect * from valid_discharge_disposition\r\nunion all \r\nselect * from valid_admit_source\r\nunion all \r\nselect * from valid_admit_type\r\nunion all \r\nselect * from valid_ms_drg\r\nunion all \r\nselect * from valid_apr_drg\r\nunion all \r\nselect * from valid_present_on_admission\r\nunion all \r\nselect * from valid_diagnosis_code_type\r\nunion all \r\nselect * from valid_procedure_code_type\r\nunion all \r\nselect * from valid_diagnosis_code\r\nunion all \r\nselect * from valid_claim_type\r\nunion all \r\nselect * from valid_place_of_service", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__revenue_center", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__present_on_admission", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_bill_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.bill_type_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.bill_type tob\n on medical_claim.bill_type_code = tob.bill_type_code\n left join test_catalog\n on test_catalog.test_name = 'bill_type_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and tob.bill_type_code is null\n and medical_claim.bill_type_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_revenue_center as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.revenue_center_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.revenue_center rev\n on medical_claim.revenue_center_code = rev.revenue_center_code\n left join test_catalog\n on test_catalog.test_name = 'revenue_center_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and rev.revenue_center_code is null\n and medical_claim.revenue_center_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_discharge_disposition as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.discharge_disposition_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.discharge_disposition discharge\n on medical_claim.discharge_disposition_code = discharge.discharge_disposition_code\n left join test_catalog\n on test_catalog.test_name = 'discharge_disposition_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and discharge.discharge_disposition_code is null\n and medical_claim.discharge_disposition_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_admit_source as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.admit_source_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.admit_source adsource\n on medical_claim.admit_source_code = adsource.admit_source_code\n left join test_catalog\n on test_catalog.test_name = 'admit_source_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and adsource.admit_source_code is null\n and medical_claim.admit_source_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_admit_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.admit_type_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.admit_type adtype\n on medical_claim.admit_type_code = adtype.admit_type_code\n left join test_catalog\n on test_catalog.test_name = 'admit_type_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and adtype.admit_type_code is null\n and medical_claim.admit_type_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_ms_drg as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.ms_drg_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.ms_drg msdrg\n on medical_claim.ms_drg_code = msdrg.ms_drg_code\n left join test_catalog\n on test_catalog.test_name = 'ms_drg_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and msdrg.ms_drg_code is null\n and medical_claim.ms_drg_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_apr_drg as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.apr_drg_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.apr_drg aprdrg\n on medical_claim.apr_drg_code = aprdrg.apr_drg_code\n left join test_catalog\n on test_catalog.test_name = 'apr_drg_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and aprdrg.apr_drg_code is null\n and medical_claim.apr_drg_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_present_on_admission as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_poa_1) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.present_on_admission poa\n on medical_claim.diagnosis_poa_1 = poa.present_on_admit_code\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_poa_1 invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and poa.present_on_admit_code is null\n and medical_claim.diagnosis_poa_1 is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_procedure_code_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.procedure_code_type) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.code_type codetype\n on medical_claim.procedure_code_type = codetype.code_type\n left join test_catalog\n on test_catalog.test_name = 'procedure_code_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claim_type = 'institutional'\n and codetype.code_type is null\n and medical_claim.procedure_code_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_place_of_service as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.place_of_service_code) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.place_of_service pos\n on medical_claim.place_of_service_code = pos.place_of_service_code\n left join test_catalog\n on test_catalog.test_name = 'place_of_service_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claim_type = 'professional'\n and pos.place_of_service_code is null\n and medical_claim.place_of_service_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_diagnosis_code_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_code_type) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.code_type codetype\n on medical_claim.diagnosis_code_type = codetype.code_type\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_code_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where codetype.code_type is null\n and medical_claim.diagnosis_code_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_diagnosis_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_code_1) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.icd_10_cm icd\n on medical_claim.diagnosis_code_1 = icd.icd_10_cm\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_code_1 invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where diagnosis_code_type = 'icd-10-cm'\n and icd.icd_10_cm is null\n and medical_claim.diagnosis_code_1 is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_claim_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.claim_type) as filled_row_count\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.claim_type claimtype\n on medical_claim.claim_type = claimtype.claim_type\n left join test_catalog\n on test_catalog.test_name = 'claim_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claimtype.claim_type is null\n and medical_claim.claim_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_bill_type\nunion all \nselect * from valid_revenue_center\nunion all \nselect * from valid_discharge_disposition\nunion all \nselect * from valid_admit_source\nunion all \nselect * from valid_admit_type\nunion all \nselect * from valid_ms_drg\nunion all \nselect * from valid_apr_drg\nunion all \nselect * from valid_present_on_admission\nunion all \nselect * from valid_diagnosis_code_type\nunion all \nselect * from valid_procedure_code_type\nunion all \nselect * from valid_diagnosis_code\nunion all \nselect * from valid_claim_type\nunion all \nselect * from valid_place_of_service", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_line_numbers", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_line_numbers"], "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "checksum": {"name": "sha256", "checksum": "15a7483f89ea4930dac5e70f6a93a2ebec28be9caacbf3018fdf4e45091fa294"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8029883, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_line_numbers", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, add_row_num as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_line_number\r\n , row_number() over (\r\n partition by claim_id, data_source\r\n order by claim_line_number\r\n ) as expected_line_number\r\n from medical_claim\r\n\r\n)\r\n\r\n, line_num_check as (\r\n\r\n select\r\n add_row_num.claim_id\r\n , add_row_num.data_source\r\n , add_row_num.claim_line_number\r\n , add_row_num.expected_line_number\r\n from add_row_num\r\n left join medical_claim\r\n on add_row_num.claim_id = medical_claim.claim_id\r\n and add_row_num.data_source = medical_claim.data_source\r\n and add_row_num.expected_line_number = medical_claim.claim_line_number\r\n where medical_claim.claim_line_number is null\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom line_num_check\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_line_number non-sequential'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select\n claim_id\n , claim_line_number\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, add_row_num as (\n\n select\n claim_id\n , data_source\n , claim_line_number\n , row_number() over (\n partition by claim_id, data_source\n order by claim_line_number\n ) as expected_line_number\n from medical_claim\n\n)\n\n, line_num_check as (\n\n select\n add_row_num.claim_id\n , add_row_num.data_source\n , add_row_num.claim_line_number\n , add_row_num.expected_line_number\n from add_row_num\n left join medical_claim\n on add_row_num.claim_id = medical_claim.claim_id\n and add_row_num.data_source = medical_claim.data_source\n and add_row_num.expected_line_number = medical_claim.claim_line_number\n where medical_claim.claim_line_number is null\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom line_num_check\n left join test_catalog\n on test_catalog.test_name = 'claim_line_number non-sequential'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_plausibility"], "alias": "_int_claims_preprocessing_medical_claim_plausibility", "checksum": {"name": "sha256", "checksum": "62567cc9718593c742b583de73c9c9e071444e0da023033ebec248d2ad2229bd"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_plausibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_plausibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8261645, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, claim_start_date_after_claim_end_date as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_start_date after claim_end_date'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_start_date > medical_claim.claim_end_date\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, admission_date_after_discharge_date as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'admission_date after discharge_date'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and medical_claim.admission_date > medical_claim.discharge_date\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, admission_date_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'admission_date incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.admission_date is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, discharge_date_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'discharge_date incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.discharge_date is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, revenue_center_code_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'revenue_center_code incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.revenue_center_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, institutional_header_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'institutional header-level fields incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and (\r\n medical_claim.admit_type_code is not null\r\n or medical_claim.admit_type_code is not null\r\n or medical_claim.admit_source_code is not null\r\n or medical_claim.discharge_disposition_code is not null\r\n or medical_claim.bill_type_code is not null\r\n or medical_claim.ms_drg_code is not null\r\n or medical_claim.apr_drg_code is not null\r\n )\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, place_of_service_code_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'place_of_service_code incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and medical_claim.place_of_service_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from claim_start_date_after_claim_end_date\r\nunion all\r\nselect * from admission_date_after_discharge_date\r\nunion all\r\nselect * from admission_date_incorrect\r\nunion all\r\nselect * from discharge_date_incorrect\r\nunion all\r\nselect * from revenue_center_code_incorrect\r\nunion all\r\nselect * from institutional_header_incorrect\r\nunion all\r\nselect * from place_of_service_code_incorrect", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, claim_start_date_after_claim_end_date as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'claim_start_date after claim_end_date'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_start_date > medical_claim.claim_end_date\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, admission_date_after_discharge_date as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'admission_date after discharge_date'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and medical_claim.admission_date > medical_claim.discharge_date\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, admission_date_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'admission_date incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.admission_date is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, discharge_date_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'discharge_date incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.discharge_date is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, revenue_center_code_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'revenue_center_code incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.revenue_center_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, institutional_header_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'institutional header-level fields incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and (\n medical_claim.admit_type_code is not null\n or medical_claim.admit_type_code is not null\n or medical_claim.admit_source_code is not null\n or medical_claim.discharge_disposition_code is not null\n or medical_claim.bill_type_code is not null\n or medical_claim.ms_drg_code is not null\n or medical_claim.apr_drg_code is not null\n )\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, place_of_service_code_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'place_of_service_code incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and medical_claim.place_of_service_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from claim_start_date_after_claim_end_date\nunion all\nselect * from admission_date_after_discharge_date\nunion all\nselect * from admission_date_incorrect\nunion all\nselect * from discharge_date_incorrect\nunion all\nselect * from revenue_center_code_incorrect\nunion all\nselect * from institutional_header_incorrect\nunion all\nselect * from place_of_service_code_incorrect", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_prof_missing_values"], "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "checksum": {"name": "sha256", "checksum": "0f2c7824ad332a3071b7dba6354c26a3e43c2e97e590aa5a2d4ff4f37700c1aa"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.811988, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set professional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_missing as (\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('normalized_input__medical_claim'), professional_missing_column_list, 'professional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , professional_missing.claim_id\r\n , professional_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_missing\r\n left join test_catalog\r\n on test_catalog.test_name = professional_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n professional_missing.claim_id\r\n , professional_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith professional_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_line_number is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where patient_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where member_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where payer is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where plan is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_start_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_end_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'place_of_service_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where place_of_service_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'hcpcs_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where hcpcs_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where rendering_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where billing_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_amount is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_type is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_1 is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where data_source is null\n and claim_type = 'professional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , professional_missing.claim_id\n , professional_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom professional_missing\n left join test_catalog\n on test_catalog.test_name = professional_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n professional_missing.claim_id\n , professional_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_duplicates"], "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "checksum": {"name": "sha256", "checksum": "fcc927d8b88262450bf7b2062615a843d09a2f8286c1b889b7c5ddc20b564651"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.83984, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__pharmacy_claim') }}\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate pharmacy claims'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.data_quality__test_catalog", "model.the_tuva_project.normalized_input__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n left join test_catalog\n on test_catalog.test_name = 'duplicate pharmacy claims'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n claim_id\n , claim_line_number\n , data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_line_numbers"], "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "checksum": {"name": "sha256", "checksum": "79d6c3baed4bc5fb9e34a47fe8a5525e3ed8f91ca091fe7e75aa3eab9811fbe7"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8428526, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_line_numbers", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith pharmacy_claim as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n from {{ ref('normalized_input__pharmacy_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, add_row_num as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_line_number\r\n , row_number() over (\r\n partition by claim_id, data_source\r\n order by claim_line_number\r\n ) as expected_line_number\r\n from pharmacy_claim\r\n\r\n)\r\n\r\n, line_num_check as (\r\n\r\n select\r\n add_row_num.claim_id\r\n , add_row_num.data_source\r\n , add_row_num.claim_line_number\r\n , add_row_num.expected_line_number\r\n from add_row_num\r\n left join pharmacy_claim\r\n on add_row_num.claim_id = pharmacy_claim.claim_id\r\n and add_row_num.data_source = pharmacy_claim.data_source\r\n and add_row_num.expected_line_number = pharmacy_claim.claim_line_number\r\n where pharmacy_claim.claim_line_number is null\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom line_num_check\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_line_number non-sequential'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim as (\n\n select\n claim_id\n , claim_line_number\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, add_row_num as (\n\n select\n claim_id\n , data_source\n , claim_line_number\n , row_number() over (\n partition by claim_id, data_source\n order by claim_line_number\n ) as expected_line_number\n from pharmacy_claim\n\n)\n\n, line_num_check as (\n\n select\n add_row_num.claim_id\n , add_row_num.data_source\n , add_row_num.claim_line_number\n , add_row_num.expected_line_number\n from add_row_num\n left join pharmacy_claim\n on add_row_num.claim_id = pharmacy_claim.claim_id\n and add_row_num.data_source = pharmacy_claim.data_source\n and add_row_num.expected_line_number = pharmacy_claim.claim_line_number\n where pharmacy_claim.claim_line_number is null\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom line_num_check\n left join test_catalog\n on test_catalog.test_name = 'claim_line_number non-sequential'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_missing_values"], "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "checksum": {"name": "sha256", "checksum": "ebf0687fbcf78edbaa015af921b8558b13a8704f2d0c1278dd88845d2438b9a1"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.84576, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set pharmacy_claim_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'prescribing_provider_npi'\r\n , 'dispensing_provider_npi'\r\n , 'dispensing_date'\r\n , 'ndc_code'\r\n , 'quantity'\r\n , 'days_supply'\r\n , 'refills'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'allowed_amount'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith pharmacy_claim_missing as (\r\n\r\n {{ pharmacy_claim_missing_column_check(builtins.ref('normalized_input__pharmacy_claim'), pharmacy_claim_missing_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , pharmacy_claim_missing.claim_id\r\n , pharmacy_claim_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pharmacy_claim_missing\r\n left join test_catalog\r\n on test_catalog.test_name = pharmacy_claim_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n pharmacy_claim_missing.claim_id\r\n , pharmacy_claim_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where claim_id is null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where claim_line_number is null\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where patient_id is null\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where member_id is null\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where payer is null\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where plan is null\n union all\n select\n claim_id\n , data_source\n , 'prescribing_provider_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where prescribing_provider_npi is null\n union all\n select\n claim_id\n , data_source\n , 'dispensing_provider_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where dispensing_provider_npi is null\n union all\n select\n claim_id\n , data_source\n , 'dispensing_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where dispensing_date is null\n union all\n select\n claim_id\n , data_source\n , 'ndc_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where ndc_code is null\n union all\n select\n claim_id\n , data_source\n , 'quantity' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where quantity is null\n union all\n select\n claim_id\n , data_source\n , 'days_supply' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where days_supply is null\n union all\n select\n claim_id\n , data_source\n , 'refills' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where refills is null\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where paid_date is null\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where paid_amount is null\n union all\n select\n claim_id\n , data_source\n , 'allowed_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where allowed_amount is null\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where data_source is null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , pharmacy_claim_missing.claim_id\n , pharmacy_claim_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pharmacy_claim_missing\n left join test_catalog\n on test_catalog.test_name = pharmacy_claim_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n pharmacy_claim_missing.claim_id\n , pharmacy_claim_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_header_fail_details"], "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "checksum": {"name": "sha256", "checksum": "ac9d78a05fb7b5ba771f1f42d4951d0f5874713f370cd02ef8ad424e395a930e"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7964272, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set pharmacy_header_column_list = [\r\n 'claim_id'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith pharmacy_header_duplicates as (\r\n\r\n {{ pharmacy_claim_header_duplicate_check(builtins.ref('normalized_input__pharmacy_claim'), pharmacy_header_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , pharmacy_header_duplicates.claim_id\r\n , pharmacy_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pharmacy_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = pharmacy_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by \r\n pharmacy_header_duplicates.claim_id\r\n , pharmacy_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , pharmacy_header_duplicates.claim_id\n , pharmacy_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom pharmacy_header_duplicates\n left join test_catalog\n on test_catalog.test_name = pharmacy_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by \n pharmacy_header_duplicates.claim_id\n , pharmacy_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_professional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_professional_header_fail_details"], "alias": "_int_claims_preprocessing_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "1a782a236c32b224aa1efb3edef580eedee0c530c54e2563e961e0c0c25e3779"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_professional_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_professional_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7934272, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set professional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_header_duplicates as (\r\n\r\n {{ medical_claim_header_duplicate_check(builtins.ref('normalized_input__medical_claim'), professional_header_column_list, 'professional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , professional_header_duplicates.claim_id\r\n , professional_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = professional_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n and test_catalog.claim_type = 'professional'\r\ngroup by \r\n professional_header_duplicates.claim_id\r\n , professional_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith professional_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'place_of_service_code' as column_checked\n , count(distinct place_of_service_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct place_of_service_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n , count(distinct paid_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct paid_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , professional_header_duplicates.claim_id\n , professional_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom professional_header_duplicates\n left join test_catalog\n on test_catalog.test_name = professional_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n and test_catalog.claim_type = 'professional'\ngroup by \n professional_header_duplicates.claim_id\n , professional_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_eligibility"], "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "checksum": {"name": "sha256", "checksum": "d7e30d81f98b23e5eb3a81d5fd94ebf3dcaec7e6128ec30303205f35d530b04d"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.7854297, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_invalid_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_plausibility') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_eligibility_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_plausibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_plausibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "d1ed13a49eb5766e4b1bed9e44befe89d0ce4bd8c645a21e84a71518f06c5d26"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8378675, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n \r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_institutional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_professional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_claim_type_unmapped') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_claim_type_mapping_failures') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_plausibility') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_dates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_dates_inst') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_line_numbers') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_npi') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_institutional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_professional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_unmapped", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_plausibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_dates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_dates_inst", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_line_numbers", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_npi", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n \nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_plausibility\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates_inst\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_line_numbers\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_npi", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "6646b4baef24d7c537c96f0d03b8da68193bf5758cc37ebd69814a631d810f69"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8525422, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_line_numbers') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_line_numbers", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_eligibility"], "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "ee709476894a6a2db7502fa17fae9ad0a4105eabaa1ba2f8ae0e041aba58a69f"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.77627, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Tests with the category 'invalid_values' are joined to the denominator model\r\n on test_name since that denominator logic is dependent on whether that\r\n specific field is populated or not.\r\n\r\n All other tests are joined to the denominator model on claim_type.\r\n*/\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_eligibility_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__eligibility'\r\nand test_category <> 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_eligibility_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__eligibility'\r\nand test_category = 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_denominators", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_denominators", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "compiled": true, "compiled_code": "\n/*\n Tests with the category 'invalid_values' are joined to the denominator model\n on test_name since that denominator logic is dependent on whether that\n specific field is populated or not.\n\n All other tests are joined to the denominator model on claim_type.\n*/\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'normalized_input__eligibility'\nand test_category <> 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'normalized_input__eligibility'\nand test_category = 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_medical_claim"], "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "4e0dda9ef2c4378f49f25306f0028cc4944a775d31df6fa73b0e314195eb6030"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8206556, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Tests with the category 'invalid_values' are joined to the denominator model\r\n on test_name since that denominator logic is dependent on whether that\r\n specific field is populated or not.\r\n\r\n All other tests are joined to the denominator model on claim_type.\r\n*/\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_medical_claim_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__medical_claim'\r\nand test_category <> 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_medical_claim_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__medical_claim'\r\nand test_category = 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_denominators", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_denominators", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n/*\n Tests with the category 'invalid_values' are joined to the denominator model\n on test_name since that denominator logic is dependent on whether that\n specific field is populated or not.\n\n All other tests are joined to the denominator model on claim_type.\n*/\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'normalized_input__medical_claim'\nand test_category <> 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'normalized_input__medical_claim'\nand test_category = 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"], "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "3423b4d2cabdecc7038372f51d19d4c4a9762b4281b249494635376eb1f3c2e9"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8494322, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith pharmacy_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as claim_type\r\n , cast(count(distinct claim_id||data_source) as int) as count\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\n from {{ ref('normalized_input__pharmacy_claim') }}\r\n)\r\n\r\n, distinct_patient_per_category as(\r\n select\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n from {{ ref('data_quality__claims_preprocessing_test_detail') }}\r\n where source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n )\r\n\r\n select\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , pipeline_test\r\n , claim.failures\r\n , denom.count as denominator\r\n , tuva_last_run\r\n from distinct_patient_per_category claim\r\n left join pharmacy_claim_denominator denom\r\n on claim.claim_type = denom.claim_type\r\n group by\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , pipeline_test\r\n , claim.failures\r\n , denom.count\r\n , tuva_last_run", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim_denominator as(\n select \n cast('all' as TEXT ) as claim_type\n , cast(count(distinct claim_id||data_source) as int) as count\n , cast('2024-05-10 13:57:27.457245+00:00' as TEXT ) as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n)\n\n, distinct_patient_per_category as(\n select\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n )\n\n select\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , pipeline_test\n , claim.failures\n , denom.count as denominator\n , tuva_last_run\n from distinct_patient_per_category claim\n left join pharmacy_claim_denominator denom\n on claim.claim_type = denom.claim_type\n group by\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , pipeline_test\n , claim.failures\n , denom.count\n , tuva_last_run", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__summary": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\final\\ed_classification__summary.sql", "original_file_path": "models\\ed_classification\\final\\ed_classification__summary.sql", "unique_id": "model.the_tuva_project.ed_classification__summary", "fqn": ["the_tuva_project", "ed_classification", "final", "ed_classification__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "9290d8250597c0341bfa2c94b64a7660c3a7a069a6bf30ef425bcf24bf41d14b"}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED Classification as a cube that can be summarized\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ed_classification_description": {"name": "ed_classification_description", "description": "ED classification category.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/ed_classification/ed_classification__categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ed_classification_order": {"name": "ed_classification_order", "description": "The order of the classification.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/ed_classification/ed_classification__categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Year and month of the encounter end date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_name": {"name": "facility_name", "description": "The name of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_state": {"name": "facility_state", "description": "The state of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_city": {"name": "facility_city", "description": "The city of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_zip_code": {"name": "facility_zip_code", "description": "The zip code of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_sex": {"name": "patient_sex", "description": "The sex of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The age of the patient at the time of the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_zip_code": {"name": "patient_zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_latitude": {"name": "patient_latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_longitude": {"name": "patient_longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "summary", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8801477, "relation_name": "dev_thuxuan.ed_classification.summary", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n class.encounter_id\r\n , cat.classification_name as ed_classification_description\r\n , cat.classification_order as ed_classification_order\r\n , class.patient_id\r\n , class.encounter_end_date\r\n , cast({{ date_part(\"year\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}) \r\n || right('0'||cast({{ date_part(\"month\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}),2) \r\n as year_month\r\n , class.primary_diagnosis_code\r\n , class.primary_diagnosis_description\r\n , class.paid_amount\r\n , class.allowed_amount\r\n , class.charge_amount\r\n , class.facility_npi\r\n , fac_prov.provider_organization_name as facility_name\r\n , practice_state as facility_state\r\n , practice_city as facility_city\r\n , practice_zip_code as facility_zip_code\r\n-- , null as facility_latitude\r\n-- , null as facility_longitude\r\n , pat.sex as patient_sex\r\n , floor({{ datediff('pat.birth_date', 'class.encounter_end_date', 'hour') }} / 8766.0) as patient_age\r\n , zip_code as patient_zip_code\r\n , latitude as patient_latitude\r\n , longitude as patient_longitude\r\n , race as patient_race\r\nfrom {{ ref('ed_classification__int_filter_encounter_with_classification') }} class\r\ninner join {{ ref('ed_classification__categories') }} cat\r\n using(classification)\r\nleft join {{ ref('terminology__provider') }} fac_prov \r\n on class.facility_npi = fac_prov.npi\r\nleft join {{ ref('ed_classification__stg_patient') }} pat\r\n on class.patient_id = pat.patient_id", "language": "sql", "refs": [{"name": "ed_classification__int_filter_encounter_with_classification", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__stg_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\final\\ed_classification__summary.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient\n)select\n class.encounter_id\n , cat.classification_name as ed_classification_description\n , cat.classification_order as ed_classification_order\n , class.patient_id\n , class.encounter_end_date\n , cast(date_part('year', class.encounter_end_date) as TEXT) \n || right('0'||cast(date_part('month', class.encounter_end_date) as TEXT),2) \n as year_month\n , class.primary_diagnosis_code\n , class.primary_diagnosis_description\n , class.paid_amount\n , class.allowed_amount\n , class.charge_amount\n , class.facility_npi\n , fac_prov.provider_organization_name as facility_name\n , practice_state as facility_state\n , practice_city as facility_city\n , practice_zip_code as facility_zip_code\n-- , null as facility_latitude\n-- , null as facility_longitude\n , pat.sex as patient_sex\n , floor(datediff(\n hour,\n pat.birth_date,\n class.encounter_end_date\n ) / 8766.0) as patient_age\n , zip_code as patient_zip_code\n , latitude as patient_latitude\n , longitude as patient_longitude\n , race as patient_race\nfrom dev_thuxuan.ed_classification._int_filter_encounter_with_classification class\ninner join dev_thuxuan.ed_classification._value_set_categories cat\n using(classification)\nleft join dev_thuxuan.terminology.provider fac_prov \n on class.facility_npi = fac_prov.npi\nleft join __dbt__cte__ed_classification__stg_patient pat\n on class.patient_id = pat.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__int_filter_encounter_with_classification", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_filter_encounter_with_classification"], "alias": "_int_filter_encounter_with_classification", "checksum": {"name": "sha256", "checksum": "957e5c16209eec1ea32bacfe72782ba0e54835625b1bd7cbfde214edc2466b6f"}, "config": {"enabled": true, "alias": "_int_filter_encounter_with_classification", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filter out ED visits that were not classified", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_filter_encounter_with_classification", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8838508, "relation_name": "dev_thuxuan.ed_classification._int_filter_encounter_with_classification", "raw_code": "/*\r\nFilter conditions to those that were classified and pick the classification\r\nwith the greatest probability (that's the greatest logic). This logic removes\r\nany rows that were not classified.\r\n*/\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n a.*\r\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\r\n when edcnnpa then 'edcnnpa'\r\n when edcnpa then 'edcnpa'\r\n when epct then 'epct'\r\n when noner then 'noner'\r\n when injury then 'injury'\r\n when psych then 'psych'\r\n when alcohol then 'alcohol'\r\n when drug then 'drug'\r\n else 'unclassified'\r\n end as classification\r\nfrom {{ ref('ed_classification__int_map_primary_dx') }} a\r\nwhere ed_classification_capture = 1", "language": "sql", "refs": [{"name": "ed_classification__int_map_primary_dx", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_map_primary_dx"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "compiled": true, "compiled_code": "/*\nFilter conditions to those that were classified and pick the classification\nwith the greatest probability (that's the greatest logic). This logic removes\nany rows that were not classified.\n*/\n\n\nselect\n a.*\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom dev_thuxuan.ed_classification._int_by_provider_parent_organization a\nwhere ed_classification_capture = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__int_map_primary_dx", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_map_primary_dx"], "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "0877b4a072661d4cfb43b0be26e3085401e870f4d2df058815f590467c8fcbe7"}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Map ED encounter primary dx to classification", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_parent_organization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.886858, "relation_name": "dev_thuxuan.ed_classification._int_by_provider_parent_organization", "raw_code": "/*\r\nAll condition discharge diagnosis left join with probabilistic\r\nindicators of ED classification terminology\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\r\n\r\nwith condition as (\r\n select * \r\n from {{ ref('ed_classification__stg_encounter') }}\r\n where encounter_type = 'emergency department'\r\n)\r\n, icd9 as (\r\n select\r\n icd9 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd9') }}\r\n)\r\n, icd10 as (\r\n select\r\n icd10 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd10') }}\r\n)\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd10.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\r\nfrom condition a\r\nleft join icd10\r\n on a.primary_diagnosis_code = icd10.code \r\n and a.primary_diagnosis_code_type = 'icd-10-cm'\r\n\r\nunion all\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd9.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\r\nfrom condition a\r\ninner join icd9\r\n on a.primary_diagnosis_code = icd9.code \r\n and a.primary_diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "ed_classification__stg_encounter", "package": null, "version": null}, {"name": "ed_classification__johnston_icd9", "package": null, "version": null}, {"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "compiled": true, "compiled_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n\n\n\nwith __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter\n),condition as (\n select * \n from __dbt__cte__ed_classification__stg_encounter\n where encounter_type = 'emergency department'\n)\n, icd9 as (\n select\n icd9 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from dev_thuxuan.ed_classification._value_set_johnston_icd9\n)\n, icd10 as (\n select\n icd10 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from dev_thuxuan.ed_classification._value_set_johnston_icd10\n)\n\nselect\n a.*\n \n , icd10.edcnnpa\n \n , icd10.edcnpa\n \n , icd10.epct\n \n , icd10.noner\n \n , icd10.injury\n \n , icd10.psych\n \n , icd10.alcohol\n \n , icd10.drug\n \n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\n on a.primary_diagnosis_code = icd10.code \n and a.primary_diagnosis_code_type = 'icd-10-cm'\n\nunion all\n\nselect\n a.*\n \n , icd9.edcnnpa\n \n , icd9.edcnpa\n \n , icd9.epct\n \n , icd9.noner\n \n , icd9.injury\n \n , icd9.psych\n \n , icd9.alcohol\n \n , icd9.drug\n \n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\n on a.primary_diagnosis_code = icd9.code \n and a.primary_diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_encounter", "sql": " __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_encounter": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__stg_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_encounter.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_encounter", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_encounter"], "alias": "ed_classification__stg_encounter", "checksum": {"name": "sha256", "checksum": "a0586bb4e020076c0b4c14d272cd0808734200f74277e8aca9f34ddb47ac8edf"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8888564, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , encounter_type\r\n , patient_id\r\n , encounter_end_date\r\n , facility_npi\r\n , primary_diagnosis_code_type\r\n , primary_diagnosis_code\r\n , primary_diagnosis_description\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_patient": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__stg_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_patient.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_patient", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_patient"], "alias": "ed_classification__stg_patient", "checksum": {"name": "sha256", "checksum": "93bf9eadd001ac5f3e55956ede7e67da0b6f74958c993f297531954824a8e919"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8918815, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\n , zip_code\r\n , latitude\r\n , longitude\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__member_months", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__member_months.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "unique_id": "model.the_tuva_project.financial_pmpm__member_months", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__member_months"], "alias": "member_months", "checksum": {"name": "sha256", "checksum": "7c54724495bd17f114ae67af6d82308aaeb770e0cf6ab58ef5f39de02f22d95a"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "member_months", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.8958614, "relation_name": "dev_thuxuan.financial_pmpm.member_months", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith month_start_and_end_dates as (\r\nselect \r\n concat(cast(year as {{ dbt.type_string() }} ),lpad(cast(month as {{ dbt.type_string() }}),2,'0')) as year_month\r\n, min(full_date) as month_start_date\r\n, max(full_date) as month_end_date\r\nfrom {{ ref('terminology__calendar')}}\r\ngroup by 1\r\n)\r\n\r\nselect distinct\r\n a.patient_id\r\n, year_month\r\n, a.payer\r\n, a.plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('financial_pmpm__stg_eligibility') }} a\r\ninner join month_start_and_end_dates b\r\n on a.enrollment_start_date <= b.month_end_date\r\n and a.enrollment_end_date >= b.month_start_date", "language": "sql", "refs": [{"name": "terminology__calendar", "package": null, "version": null}, {"name": "financial_pmpm__stg_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n),month_start_and_end_dates as (\nselect \n concat(cast(year as TEXT ),lpad(cast(month as TEXT),2,'0')) as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom dev_thuxuan.terminology.calendar\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, a.plan\n, data_source\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__financial_pmpm__stg_eligibility a\ninner join month_start_and_end_dates b\n on a.enrollment_start_date <= b.month_end_date\n and a.enrollment_end_date >= b.month_start_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "sql": " __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_payer": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_payer", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_payer"], "alias": "pmpm_payer", "checksum": {"name": "sha256", "checksum": "1ace13ef8132f31f22a0d1a1ebba3407b8e182ce5ad2772acff20e1c11799dd5"}, "config": {"enabled": true, "alias": "pmpm_payer", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep. This version of the table computes at the payer grain.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_payer", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9441934, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_payer", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n)}}\r\n\r\nSELECT \r\n year_month,\r\n payer,\r\n data_source,\r\n count(1) as member_months,\r\n SUM(total_paid) / COUNT(1) AS total_paid,\r\n SUM(medical_paid) / COUNT(1) AS medical_paid,\r\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\r\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\r\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\r\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\r\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\r\n SUM(other_paid) / COUNT(1) AS other_paid,\r\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\r\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\r\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\r\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\r\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\r\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\r\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\r\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\r\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\r\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\r\n SUM(lab_paid) / COUNT(1) AS lab_paid,\r\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\r\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\r\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\r\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\r\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\r\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\r\n SUM(total_allowed) / COUNT(1) AS total_allowed,\r\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\r\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\r\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\r\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\r\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\r\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\r\n SUM(other_allowed) / COUNT(1) AS other_allowed,\r\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\r\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\r\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\r\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\r\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\r\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\r\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\r\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\r\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\r\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\r\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\r\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\r\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\r\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\r\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\r\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\r\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\r\nGROUP BY 1,2,3", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\n payer,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nFROM dev_thuxuan.financial_pmpm.pmpm_prep a\nGROUP BY 1,2,3", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_payer_plan", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_payer_plan"], "alias": "pmpm_payer_plan", "checksum": {"name": "sha256", "checksum": "b404c6f8663ba7c5e552f01aba10d930fb19227711c5deb1ad67c9526ed9f95a"}, "config": {"enabled": true, "alias": "pmpm_payer_plan", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep. This version of the table computes at the payer and plan grain.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_payer_plan", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9295094, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_payer_plan", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n)}}\r\n\r\nSELECT \r\n year_month,\r\n payer,\r\n plan,\r\n data_source,\r\n count(1) as member_months,\r\n SUM(total_paid) / COUNT(1) AS total_paid,\r\n SUM(medical_paid) / COUNT(1) AS medical_paid,\r\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\r\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\r\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\r\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\r\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\r\n SUM(other_paid) / COUNT(1) AS other_paid,\r\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\r\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\r\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\r\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\r\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\r\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\r\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\r\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\r\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\r\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\r\n SUM(lab_paid) / COUNT(1) AS lab_paid,\r\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\r\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\r\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\r\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\r\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\r\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\r\n SUM(total_allowed) / COUNT(1) AS total_allowed,\r\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\r\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\r\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\r\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\r\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\r\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\r\n SUM(other_allowed) / COUNT(1) AS other_allowed,\r\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\r\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\r\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\r\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\r\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\r\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\r\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\r\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\r\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\r\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\r\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\r\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\r\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\r\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\r\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\r\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\r\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\r\nGROUP BY 1,2,3,4", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\n payer,\n plan,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nFROM dev_thuxuan.financial_pmpm.pmpm_prep a\nGROUP BY 1,2,3,4", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_prep", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_prep"], "alias": "pmpm_prep", "checksum": {"name": "sha256", "checksum": "501e2b0133d5e6d7a90d626d503b77c0753fdcbe014b5cf6b09a53a8f9ac1f61"}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_prep", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9111907, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_prep", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith combine as (\r\nSELECT\r\n a.patient_id,\r\n a.year_month,\r\n a.payer,\r\n a.plan, \r\n a.data_source,\r\n \r\n -- service cat 1 paid\r\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\r\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\r\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\r\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\r\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\r\n COALESCE(b.other_paid, 0) AS other_paid,\r\n \r\n -- service cat 2 paid\r\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\r\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\r\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\r\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\r\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\r\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\r\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\r\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\r\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\r\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\r\n COALESCE(c.lab_paid, 0) AS lab_paid,\r\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\r\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\r\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\r\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\r\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\r\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\r\n \r\n -- service cat 1 allowed\r\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\r\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\r\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\r\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\r\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\r\n COALESCE(d.other_allowed, 0) AS other_allowed,\r\n \r\n -- service cat 2 allowed\r\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\r\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\r\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\r\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\r\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\r\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\r\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\r\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\r\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\r\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\r\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\r\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\r\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\r\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\r\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\r\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\r\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\r\nFROM {{ ref('financial_pmpm__member_months') }} a\r\nleft join {{ ref('financial_pmpm__service_category_1_paid_pivot') }} b\r\n on a.patient_id = b.patient_id\r\n and a.year_month = b.year_month\r\n and a.payer = b.payer\r\n and a.plan = b.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_paid_pivot') }} c\r\n on a.patient_id = c.patient_id\r\n and a.year_month = c.year_month\r\n and a.payer = c.payer\r\n and a.plan = c.plan\r\nleft join {{ ref('financial_pmpm__service_category_1_allowed_pivot') }} d\r\n on a.patient_id = d.patient_id\r\n and a.year_month = d.year_month\r\n and a.payer = d.payer\r\n and a.plan = d.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_allowed_pivot') }} e\r\n on a.patient_id = e.patient_id\r\n and a.year_month = e.year_month\r\n and a.payer = e.payer\r\n and a.plan = e.plan \r\n)\r\n\r\nselect *\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine", "language": "sql", "refs": [{"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_allowed_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_allowed_pivot", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "compiled": true, "compiled_code": "\n\nwith combine as (\nSELECT\n a.patient_id,\n a.year_month,\n a.payer,\n a.plan, \n a.data_source,\n \n -- service cat 1 paid\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\n COALESCE(b.other_paid, 0) AS other_paid,\n \n -- service cat 2 paid\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\n COALESCE(c.lab_paid, 0) AS lab_paid,\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\n \n -- service cat 1 allowed\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\n COALESCE(d.other_allowed, 0) AS other_allowed,\n \n -- service cat 2 allowed\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\nFROM dev_thuxuan.financial_pmpm.member_months a\nleft join dev_thuxuan.financial_pmpm._int_service_category_1_paid_pivot b\n on a.patient_id = b.patient_id\n and a.year_month = b.year_month\n and a.payer = b.payer\n and a.plan = b.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_2_paid_pivot c\n on a.patient_id = c.patient_id\n and a.year_month = c.year_month\n and a.payer = c.payer\n and a.plan = c.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_1_allowed_pivot d\n on a.patient_id = d.patient_id\n and a.year_month = d.year_month\n and a.payer = d.payer\n and a.plan = d.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_2_allowed_pivot e\n on a.patient_id = e.patient_id\n and a.year_month = e.year_month\n and a.payer = e.payer\n and a.plan = e.plan \n)\n\nselect *\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom combine", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__patient_spend_with_service_categories", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__patient_spend_with_service_categories"], "alias": "_int_patient_spend_with_service_categories", "checksum": {"name": "sha256", "checksum": "76ca55c6b220bea069a99cea0e72084bb7c72a5c0db880460e7f73407680ae02"}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_patient_spend_with_service_categories", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9471726, "relation_name": "dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith claims_with_service_categories as (\r\n select\r\n a.patient_id\r\n , a.payer\r\n , a.plan\r\n , a.service_category_1\r\n , a.service_category_2\r\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\r\n , a.paid_amount\r\n , a.allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_medical_claim') }} a\r\n)\r\n\r\n, medical_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from claims_with_service_categories\r\n)\r\n\r\n, rx_claims as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , 'Pharmacy' as service_category_1\r\n , cast(null as {{ dbt.type_string() }}) as service_category_2\r\n , {{try_to_cast_date('dispensing_date','YYYMMDD') }} as claim_date\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_pharmacy_claim') }}\r\n)\r\n\r\n, rx_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from rx_claims\r\n)\r\n\r\n, combine_medical_and_rx as (\r\nselect *\r\nfrom medical_claims_year_month\r\n\r\nunion all\r\n\r\nselect *\r\nfrom rx_claims_year_month\r\n)\r\n\r\nselect\r\n patient_id\r\n , year_month\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , sum(paid_amount) as total_paid\r\n , sum(allowed_amount) as total_allowed\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from combine_medical_and_rx\r\ngroup by 1,2,3,4,5,6,9", "language": "sql", "refs": [{"name": "financial_pmpm__stg_medical_claim", "package": null, "version": null}, {"name": "financial_pmpm__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date"], "nodes": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n), __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n),claims_with_service_categories as (\n select\n a.patient_id\n , a.payer\n , a.plan\n , a.service_category_1\n , a.service_category_2\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\n , a.paid_amount\n , a.allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_medical_claim a\n)\n\n, medical_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from claims_with_service_categories\n)\n\n, rx_claims as (\n select\n patient_id\n , payer\n , plan\n , 'Pharmacy' as service_category_1\n , cast(null as TEXT) as service_category_2\n , try_cast( dispensing_date as date ) as claim_date\n , paid_amount\n , allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_pharmacy_claim\n)\n\n, rx_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from rx_claims\n)\n\n, combine_medical_and_rx as (\nselect *\nfrom medical_claims_year_month\n\nunion all\n\nselect *\nfrom rx_claims_year_month\n)\n\nselect\n patient_id\n , year_month\n , payer\n , plan\n , service_category_1\n , service_category_2\n , sum(paid_amount) as total_paid\n , sum(allowed_amount) as total_allowed\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n from combine_medical_and_rx\ngroup by 1,2,3,4,5,6,9", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "sql": " __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n)"}, {"id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "sql": " __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_1_allowed_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_allowed_pivot"], "alias": "_int_service_category_1_allowed_pivot", "checksum": {"name": "sha256", "checksum": "d7670c26f5543ff55f06266d65d6c7bc716e4c5d4c7f7ca162f1688607ad631b"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9497907, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_1_allowed_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_allowed) as total_allowed\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_allowed\n else 0\n end\n )\n \n \n as ancillary_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_allowed\n else 0\n end\n )\n \n \n as other_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_allowed\n else 0\n end\n )\n \n \n as pharmacy_allowed\n \n \n \n \n\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_1_paid_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_paid_pivot"], "alias": "_int_service_category_1_paid_pivot", "checksum": {"name": "sha256", "checksum": "109e47fb5265f6efb0a765109920a5f73cbfc3f403700996b7f06d70e7695da4"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9557207, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_1_paid_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_paid) as total_paid\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_paid\n else 0\n end\n )\n \n \n as ancillary_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_paid\n else 0\n end\n )\n \n \n as other_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_paid\n else 0\n end\n )\n \n \n as pharmacy_paid\n \n \n \n \n\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_2_allowed_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_allowed_pivot"], "alias": "_int_service_category_2_allowed_pivot", "checksum": {"name": "sha256", "checksum": "fa9f6160300e6ed651e3530511e4d277204261368dd39278b161fcc1841e66ce"}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.953537, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_2_allowed_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id \r\n, year_month \r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_allowed) as total_allowed\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id \n, year_month \n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as acute_inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulance_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulatory_surgery_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_allowed\n else 0\n end\n )\n \n \n as dialysis_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_allowed\n else 0\n end\n )\n \n \n as durable_medical_equipment_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_allowed\n else 0\n end\n )\n \n \n as emergency_department_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_allowed\n else 0\n end\n )\n \n \n as home_health_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_allowed\n else 0\n end\n )\n \n \n as hospice_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_allowed\n else 0\n end\n )\n \n \n as lab_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_allowed\n else 0\n end\n )\n \n \n as skilled_nursing_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_allowed\n else 0\n end\n )\n \n \n as urgent_care_allowed\n \n \n \n \n\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_2_paid_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_paid_pivot"], "alias": "_int_service_category_2_paid_pivot", "checksum": {"name": "sha256", "checksum": "db092a4f2b87bf0e9b6dc7ae299032026beefa111e735c9d1569317538fe11fb"}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.958736, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_2_paid_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_paid) as total_paid\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as acute_inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_paid\n else 0\n end\n )\n \n \n as ambulance_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_paid\n else 0\n end\n )\n \n \n as ambulatory_surgery_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_paid\n else 0\n end\n )\n \n \n as dialysis_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_paid\n else 0\n end\n )\n \n \n as durable_medical_equipment_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_paid\n else 0\n end\n )\n \n \n as emergency_department_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_paid\n else 0\n end\n )\n \n \n as home_health_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_paid\n else 0\n end\n )\n \n \n as hospice_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_paid\n else 0\n end\n )\n \n \n as lab_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_paid\n else 0\n end\n )\n \n \n as skilled_nursing_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_paid\n else 0\n end\n )\n \n \n as urgent_care_paid\n \n \n \n \n\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_eligibility"], "alias": "financial_pmpm__stg_eligibility", "checksum": {"name": "sha256", "checksum": "5d748a17a0f5a9eb9d32f6490b0340ce31b7ca73d915267033d5a7f7d94497e8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["financial_pmpm"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9607701, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_medical_claim"], "alias": "financial_pmpm__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "2b54ef7b2265108ae6c9fa4b2ff6542a9adbfbd502b4def9140b075b7f21e5cb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9627352, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , claim_start_date\r\n , claim_end_date\r\n , service_category_1\r\n , service_category_2\r\n , paid_amount\r\n , allowed_amount\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_pharmacy_claim"], "alias": "financial_pmpm__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "52660c53aafffd07b26e62aab32b85efa64080bfcd0248ac69c2106fac7c80ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.96373, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n , dispensing_date\r\n , paid_amount\r\n , allowed_amount\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__list": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__list", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__list.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__list.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__list", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__list"], "alias": "list", "checksum": {"name": "sha256", "checksum": "02ca23ae8dfb65e6b4337e7a240d70e2758fd01067ecdc40290d6e2939c92f19"}, "config": {"enabled": true, "alias": "list", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays the list of suspecting conditions per patient, data_source, hcc, and diagnosis code with the reason and contributing factors.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition, observation, result, etc. was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "list", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9704435, "relation_name": "dev_thuxuan.hcc_suspecting.list", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith hcc_history_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, comorbidity_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_comorbidity_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, observation_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_observation_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, lab_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_lab_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, medication_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_medication_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from hcc_history_suspects\r\n union all\r\n select * from comorbidity_suspects\r\n union all\r\n select * from observation_suspects\r\n union all\r\n select * from lab_suspects\r\n union all\r\n select * from medication_suspects\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}, {"name": "hcc_suspecting__int_comorbidity_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_observation_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_lab_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_medication_suspects", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__list.sql", "compiled": true, "compiled_code": "\n\nwith hcc_history_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, comorbidity_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_comorbidity_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, observation_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_observation_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, lab_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_lab_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, medication_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_medication_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, unioned as (\n\n select * from hcc_history_suspects\n union all\n select * from comorbidity_suspects\n union all\n select * from observation_suspects\n union all\n select * from lab_suspects\n union all\n select * from medication_suspects\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from unioned\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__list_rollup": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__list_rollup", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__list_rollup"], "alias": "list_rollup", "checksum": {"name": "sha256", "checksum": "af9e01b29e7dbef236a892e44c24386aa71a33395f9429c03213361449d9e5bd"}, "config": {"enabled": true, "alias": "list_rollup", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays the list of suspecting conditions per patient and hcc with the latest contributing factor rolled up.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latest_suspect_date": {"name": "latest_suspect_date", "description": "Latest date when the suspecting condition, observation, result, etc. was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "list_rollup", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9754348, "relation_name": "dev_thuxuan.hcc_suspecting.list_rollup", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith list as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , row_number() over (\r\n partition by\r\n patient_id\r\n , hcc_code\r\n order by suspect_date desc\r\n ) as row_num\r\n from {{ ref('hcc_suspecting__list') }}\r\n\r\n)\r\n\r\n, list_dedupe as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date as latest_suspect_date\r\n from list\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(latest_suspect_date as date) as latest_suspect_date\r\n from list_dedupe\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , latest_suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__list", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__list"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "compiled": true, "compiled_code": "\n\nwith list as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n , row_number() over (\n partition by\n patient_id\n , hcc_code\n order by suspect_date desc\n ) as row_num\n from dev_thuxuan.hcc_suspecting.list\n\n)\n\n, list_dedupe as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date as latest_suspect_date\n from list\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(latest_suspect_date as date) as latest_suspect_date\n from list_dedupe\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , latest_suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__summary": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__summary.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__summary.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__summary", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "ba92ab6650921a4cbf6f93a52d370768beb0288776da11b44ac00b0a7c691125"}, "config": {"enabled": true, "alias": "summary", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays a rollup of suspecting conditions per patient.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_sex": {"name": "patient_sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient's current age.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspecting_gaps": {"name": "suspecting_gaps", "description": "Count of suspecting conditions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "summary", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.979419, "relation_name": "dev_thuxuan.hcc_suspecting.summary", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , floor({{ datediff('birth_date', 'current_date', 'hour') }} / 8766.0) as age\r\n from {{ ref('hcc_suspecting__stg_core__patient') }}\r\n where death_date is null\r\n\r\n)\r\n\r\n, suspecting_list as (\r\n\r\n select\r\n patient_id\r\n , count(*) as gaps\r\n from {{ ref('hcc_suspecting__list') }}\r\n group by patient_id\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n patients.patient_id\r\n , patients.sex\r\n , patients.birth_date\r\n , patients.age\r\n , suspecting_list.gaps\r\n from patients\r\n inner join suspecting_list\r\n on patients.patient_id = suspecting_list.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(sex as {{ dbt.type_string() }}) as patient_sex\r\n , cast(birth_date as date) as patient_birth_date\r\n , cast(age as integer) as patient_age\r\n , cast(gaps as integer) as suspecting_gaps\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , patient_sex\r\n , patient_birth_date\r\n , patient_age\r\n , suspecting_gaps\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__patient", "package": null, "version": null}, {"name": "hcc_suspecting__list", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__patient", "model.the_tuva_project.hcc_suspecting__list"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient\n),patients as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n current_date\n ) / 8766.0) as age\n from __dbt__cte__hcc_suspecting__stg_core__patient\n where death_date is null\n\n)\n\n, suspecting_list as (\n\n select\n patient_id\n , count(*) as gaps\n from dev_thuxuan.hcc_suspecting.list\n group by patient_id\n\n)\n\n, joined as (\n\n select\n patients.patient_id\n , patients.sex\n , patients.birth_date\n , patients.age\n , suspecting_list.gaps\n from patients\n inner join suspecting_list\n on patients.patient_id = suspecting_list.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(sex as TEXT) as patient_sex\n , cast(birth_date as date) as patient_birth_date\n , cast(age as integer) as patient_age\n , cast(gaps as integer) as suspecting_gaps\n from joined\n\n)\n\nselect\n patient_id\n , patient_sex\n , patient_birth_date\n , patient_age\n , suspecting_gaps\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__patient", "sql": " __dbt__cte__hcc_suspecting__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_all_conditions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_all_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_all_conditions"], "alias": "_int_all_conditions", "checksum": {"name": "sha256", "checksum": "31f7087d7800109df25b4f2bd2bfe15bef163cdf1ed470c43c7fd6be9bf04ff5"}, "config": {"enabled": true, "alias": "_int_all_conditions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "All historical conditions mapped to HCCs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_all_conditions", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9847288, "relation_name": "dev_thuxuan.hcc_suspecting._int_all_conditions", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n diagnosis_code\r\n , cms_hcc_v28 as hcc_code\r\n from {{ ref('hcc_suspecting__icd_10_cm_mappings') }}\r\n where cms_hcc_v28 is not null\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_hcc_mapping.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from conditions\r\n left join seed_hcc_mapping\r\n on conditions.code = seed_hcc_mapping.diagnosis_code\r\n left join seed_hcc_descriptions\r\n on seed_hcc_mapping.hcc_code = seed_hcc_descriptions.hcc_code\r\n where conditions.code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__icd_10_cm_mappings", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "compiled": true, "compiled_code": "\n\nwith conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v28 as hcc_code\n from dev_thuxuan.hcc_suspecting._value_set_icd_10_cm_mappings\n where cms_hcc_v28 is not null\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, joined as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code\n , conditions.data_source\n , seed_hcc_mapping.hcc_code\n , seed_hcc_descriptions.hcc_description\n from conditions\n left join seed_hcc_mapping\n on conditions.code = seed_hcc_mapping.diagnosis_code\n left join seed_hcc_descriptions\n on seed_hcc_mapping.hcc_code = seed_hcc_descriptions.hcc_code\n where conditions.code_type = 'icd-10-cm'\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(data_source as TEXT) as data_source\n from joined\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_all_medications": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_all_medications", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_all_medications"], "alias": "_int_all_medications", "checksum": {"name": "sha256", "checksum": "f1698a3af45d12bf1514f7f9c76cba5e93eb85f88349473f05795ec3205509be"}, "config": {"enabled": true, "alias": "_int_all_medications", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Union of medications and pharmacy claims.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed or paid date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug_code": {"name": "drug_code", "description": "NDC or rxnorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_system": {"name": "code_system", "description": "The type of drug code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_all_medications", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.988837, "relation_name": "dev_thuxuan.hcc_suspecting._int_all_medications", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claims as (\r\n\r\n select\r\n patient_id\r\n , coalesce(dispensing_date, paid_date) as dispensing_date\r\n , ndc_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__pharmacy_claim') }}\r\n\r\n)\r\n\r\n, ndc_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from medications\r\n where ndc_code is not null\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from medications\r\n where lower(source_code_type) = 'ndc'\r\n\r\n)\r\n\r\n, rxnorm_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , rxnorm_code as drug_code\r\n , 'rxnorm' as code_system\r\n , data_source\r\n from medications\r\n where rxnorm_code is not null\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code as drug_code\r\n , 'rxnorm' as code_system\r\n , data_source\r\n from medications\r\n where lower(source_code_type) = 'rxnorm'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from pharmacy_claims\r\n union all\r\n select * from ndc_medications\r\n union all\r\n select * from rxnorm_medications\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(dispensing_date as date) as dispensing_date\r\n , cast(drug_code as {{ dbt.type_string() }}) as drug_code\r\n , cast(code_system as {{ dbt.type_string() }}) as code_system\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , drug_code\r\n , code_system\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__medication", "package": null, "version": null}, {"name": "hcc_suspecting__stg_core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__medication as (\n\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n\n), __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n),medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__medication\n\n)\n\n, pharmacy_claims as (\n\n select\n patient_id\n , coalesce(dispensing_date, paid_date) as dispensing_date\n , ndc_code as drug_code\n , 'ndc' as code_system\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim\n\n)\n\n, ndc_medications as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code as drug_code\n , 'ndc' as code_system\n , data_source\n from medications\n where ndc_code is not null\n\n union all\n\n select\n patient_id\n , dispensing_date\n , source_code as drug_code\n , 'ndc' as code_system\n , data_source\n from medications\n where lower(source_code_type) = 'ndc'\n\n)\n\n, rxnorm_medications as (\n\n select\n patient_id\n , dispensing_date\n , rxnorm_code as drug_code\n , 'rxnorm' as code_system\n , data_source\n from medications\n where rxnorm_code is not null\n\n union all\n\n select\n patient_id\n , dispensing_date\n , source_code as drug_code\n , 'rxnorm' as code_system\n , data_source\n from medications\n where lower(source_code_type) = 'rxnorm'\n\n)\n\n, unioned as (\n\n select * from pharmacy_claims\n union all\n select * from ndc_medications\n union all\n select * from rxnorm_medications\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(dispensing_date as date) as dispensing_date\n , cast(drug_code as TEXT) as drug_code\n , cast(code_system as TEXT) as code_system\n , cast(data_source as TEXT) as data_source\n from unioned\n\n)\n\nselect\n patient_id\n , dispensing_date\n , drug_code\n , code_system\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__medication", "sql": " __dbt__cte__hcc_suspecting__stg_core__medication as (\n\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "sql": " __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_comorbidity_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_comorbidity_suspects"], "alias": "_int_comorbidity_suspects", "checksum": {"name": "sha256", "checksum": "940c1d10889c686d746892a5f1fa149f8b168c7d57d96b1774f3fdfe9c9d29ab"}, "config": {"enabled": true, "alias": "_int_comorbidity_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting comorbidities.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_concept_name": {"name": "condition_1_concept_name", "description": "Clinical concept name for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_code": {"name": "condition_1_code", "description": "Condition code for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_recorded_date": {"name": "condition_1_recorded_date", "description": "Recorded date for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_concept_name": {"name": "condition_2_concept_name", "description": "Clinical concept name for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_code": {"name": "condition_2_code", "description": "Condition code for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_recorded_date": {"name": "condition_2_recorded_date", "description": "Recorded date for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_comorbidity_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349085.9948149, "relation_name": "dev_thuxuan.hcc_suspecting._int_comorbidity_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN HCC 37 logic */\r\n, ckd_stage_1_or_2 as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n , row_number() over (\r\n partition by\r\n conditions.patient_id\r\n , conditions.data_source\r\n order by\r\n conditions.recorded_date desc\r\n , conditions.code desc\r\n ) as row_num\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) in (\r\n 'chronic kidney disease, stage 1'\r\n , 'chronic kidney disease, stage 2'\r\n )\r\n\r\n)\r\n\r\n, ckd_stage_1_or_2_dedupe as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n from ckd_stage_1_or_2\r\n where row_num = 1\r\n\r\n)\r\n\r\n, diabetes as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n , row_number() over (\r\n partition by\r\n conditions.patient_id\r\n , conditions.data_source\r\n order by\r\n conditions.recorded_date desc\r\n , conditions.code desc\r\n ) as row_num\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\r\n)\r\n\r\n, diabetes_dedupe as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n from diabetes\r\n where row_num = 1\r\n\r\n)\r\n\r\n, hcc_37_suspect as (\r\n\r\n select\r\n diabetes_dedupe.patient_id\r\n , diabetes_dedupe.data_source\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n , diabetes_dedupe.concept_name as condition_1_concept_name\r\n , diabetes_dedupe.code as condition_1_code\r\n , diabetes_dedupe.recorded_date as condition_1_recorded_date\r\n , ckd_stage_1_or_2_dedupe.concept_name as condition_2_concept_name\r\n , ckd_stage_1_or_2_dedupe.code as condition_2_code\r\n , ckd_stage_1_or_2_dedupe.recorded_date as condition_2_recorded_date\r\n from diabetes_dedupe\r\n inner join ckd_stage_1_or_2_dedupe\r\n on diabetes_dedupe.patient_id = ckd_stage_1_or_2_dedupe.patient_id\r\n and diabetes_dedupe.data_source = ckd_stage_1_or_2_dedupe.data_source\r\n /* ensure conditions overlap in the same year */\r\n and extract(year from diabetes_dedupe.recorded_date) = extract(year from ckd_stage_1_or_2_dedupe.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '37'\r\n\r\n)\r\n/* END HCC 37 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_37_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.condition_1_concept_name\r\n , unioned.condition_1_code\r\n , unioned.condition_1_recorded_date\r\n , unioned.condition_2_concept_name\r\n , unioned.condition_2_code\r\n , unioned.condition_2_recorded_date\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , condition_1_concept_name\r\n , condition_1_code\r\n , condition_1_recorded_date\r\n , condition_2_concept_name\r\n , condition_2_code\r\n , condition_2_recorded_date\r\n , current_year_billed\r\n , cast('Comorbidity suspect' as {{ dbt.type_string() }}) as reason\r\n , condition_1_concept_name\r\n || ' ('\r\n || condition_1_code\r\n || ' on '\r\n || condition_1_recorded_date\r\n || ')'\r\n || ' and '\r\n || condition_2_concept_name\r\n || ' ('\r\n || condition_2_code\r\n || ' on '\r\n || condition_2_recorded_date\r\n || ')'\r\n as contributing_factor\r\n , condition_1_recorded_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(condition_1_concept_name as {{ dbt.type_string() }}) as condition_1_concept_name\r\n , cast(condition_1_code as {{ dbt.type_string() }}) as condition_1_code\r\n , cast(condition_1_recorded_date as date) as condition_1_recorded_date\r\n , cast(condition_2_concept_name as {{ dbt.type_string() }}) as condition_2_concept_name\r\n , cast(condition_2_code as {{ dbt.type_string() }}) as condition_2_code\r\n , cast(condition_2_recorded_date as date) as condition_2_recorded_date\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , condition_1_concept_name\r\n , condition_1_code\r\n , condition_1_recorded_date\r\n , condition_2_concept_name\r\n , condition_2_code\r\n , condition_2_recorded_date\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "compiled": true, "compiled_code": "\n\nwith conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN HCC 37 logic */\n, ckd_stage_1_or_2 as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n , row_number() over (\n partition by\n conditions.patient_id\n , conditions.data_source\n order by\n conditions.recorded_date desc\n , conditions.code desc\n ) as row_num\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) in (\n 'chronic kidney disease, stage 1'\n , 'chronic kidney disease, stage 2'\n )\n\n)\n\n, ckd_stage_1_or_2_dedupe as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , concept_name\n from ckd_stage_1_or_2\n where row_num = 1\n\n)\n\n, diabetes as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n , row_number() over (\n partition by\n conditions.patient_id\n , conditions.data_source\n order by\n conditions.recorded_date desc\n , conditions.code desc\n ) as row_num\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\n)\n\n, diabetes_dedupe as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , concept_name\n from diabetes\n where row_num = 1\n\n)\n\n, hcc_37_suspect as (\n\n select\n diabetes_dedupe.patient_id\n , diabetes_dedupe.data_source\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n , diabetes_dedupe.concept_name as condition_1_concept_name\n , diabetes_dedupe.code as condition_1_code\n , diabetes_dedupe.recorded_date as condition_1_recorded_date\n , ckd_stage_1_or_2_dedupe.concept_name as condition_2_concept_name\n , ckd_stage_1_or_2_dedupe.code as condition_2_code\n , ckd_stage_1_or_2_dedupe.recorded_date as condition_2_recorded_date\n from diabetes_dedupe\n inner join ckd_stage_1_or_2_dedupe\n on diabetes_dedupe.patient_id = ckd_stage_1_or_2_dedupe.patient_id\n and diabetes_dedupe.data_source = ckd_stage_1_or_2_dedupe.data_source\n /* ensure conditions overlap in the same year */\n and extract(year from diabetes_dedupe.recorded_date) = extract(year from ckd_stage_1_or_2_dedupe.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '37'\n\n)\n/* END HCC 37 logic */\n\n, unioned as (\n\n select * from hcc_37_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.condition_1_concept_name\n , unioned.condition_1_code\n , unioned.condition_1_recorded_date\n , unioned.condition_2_concept_name\n , unioned.condition_2_code\n , unioned.condition_2_recorded_date\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , condition_1_concept_name\n , condition_1_code\n , condition_1_recorded_date\n , condition_2_concept_name\n , condition_2_code\n , condition_2_recorded_date\n , current_year_billed\n , cast('Comorbidity suspect' as TEXT) as reason\n , condition_1_concept_name\n || ' ('\n || condition_1_code\n || ' on '\n || condition_1_recorded_date\n || ')'\n || ' and '\n || condition_2_concept_name\n || ' ('\n || condition_2_code\n || ' on '\n || condition_2_recorded_date\n || ')'\n as contributing_factor\n , condition_1_recorded_date as suspect_date\n from add_billed_flag\n\n)\n\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(condition_1_concept_name as TEXT) as condition_1_concept_name\n , cast(condition_1_code as TEXT) as condition_1_code\n , cast(condition_1_recorded_date as date) as condition_1_recorded_date\n , cast(condition_2_concept_name as TEXT) as condition_2_concept_name\n , cast(condition_2_code as TEXT) as condition_2_code\n , cast(condition_2_recorded_date as date) as condition_2_recorded_date\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , condition_1_concept_name\n , condition_1_code\n , condition_1_recorded_date\n , condition_2_concept_name\n , condition_2_code\n , condition_2_recorded_date\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_lab_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_lab_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_lab_suspects"], "alias": "_int_lab_suspects", "checksum": {"name": "sha256", "checksum": "449554c7c59402b1dd00c92140045ae1c317c87985dcf2f32b74d1309a0c3fb5"}, "config": {"enabled": true, "alias": "_int_lab_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting conditions based on labs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "Cleaned numeric result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_code": {"name": "lab_code", "description": "The normalized code or source code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting lab result was recorded.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_lab_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0015147, "relation_name": "dev_thuxuan.hcc_suspecting._int_lab_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n from {{ ref('hcc_suspecting__int_prep_egfr_labs') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN CKD logic */\r\n\r\n/*\r\n Find a patient\u2019s two most recent eGFR lab results that are spaced by at\r\n least 90 days.\r\n*/\r\n, max_lab_date as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , max(result_date) as max_result_date\r\n from egfr_labs\r\n group by\r\n patient_id\r\n , data_source\r\n\r\n)\r\n\r\n, lab_lookback as (\r\n\r\n select\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , max_lab_date.max_result_date\r\n , max(egfr_labs.result_date) as lookback_result_date\r\n from egfr_labs\r\n left join max_lab_date\r\n on egfr_labs.patient_id = max_lab_date.patient_id\r\n and egfr_labs.data_source = max_lab_date.data_source\r\n where egfr_labs.result_date <= {{ dateadd('day', -90, 'max_result_date') }}\r\n group by\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , max_lab_date.max_result_date\r\n\r\n)\r\n\r\n/*\r\n Take the highest eGFR result that occurred between the date range.\r\n*/\r\n, eligible_labs as (\r\n\r\n select\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , egfr_labs.code_type\r\n , egfr_labs.code\r\n , egfr_labs.result_date\r\n , egfr_labs.result\r\n , row_number() over (\r\n partition by\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n order by egfr_labs.result desc\r\n ) as row_num\r\n from egfr_labs\r\n inner join lab_lookback\r\n on egfr_labs.patient_id = lab_lookback.patient_id\r\n and egfr_labs.data_source = lab_lookback.data_source\r\n where egfr_labs.result_date >= lab_lookback.lookback_result_date\r\n\r\n)\r\n\r\n/*\r\n Assign a patient's kidney disease stage based on the highest eGFR based on\r\n the following range:\r\n\r\n CKD 3a: eGFR in the range (45-59)\r\n CKD 3b: eGFR in the range (30-44)\r\n CKD 4: eGFR in the range (15-29)\r\n CKD 5: eGFR in the range (0-14)\r\n*/\r\n, ckd_suspects as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code as lab_code\r\n , result_date\r\n , result\r\n , case\r\n when result between 0 and 14 then '326'\r\n when result between 15 and 29 then '327'\r\n when result between 30 and 44 then '328'\r\n when result between 45 and 59 then '329'\r\n end as hcc_code\r\n , 'eGFR ('\r\n || code\r\n || ') result '\r\n || cast(result as {{ dbt.type_string() }})\r\n || ' on '\r\n || result_date\r\n as contributing_factor\r\n from eligible_labs\r\n where row_num = 1\r\n\r\n)\r\n/* END CKD logic */\r\n\r\n, unioned as (\r\n\r\n select * from ckd_suspects\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.result_date\r\n , unioned.result\r\n , unioned.lab_code\r\n , unioned.hcc_code\r\n , unioned.contributing_factor\r\n , seed_hcc_descriptions.hcc_description\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n inner join seed_hcc_descriptions\r\n on unioned.hcc_code = seed_hcc_descriptions.hcc_code\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , result_date\r\n , result\r\n , lab_code\r\n , hcc_code\r\n , hcc_description\r\n , contributing_factor\r\n , current_year_billed\r\n , cast('Lab result suspect' as {{ dbt.type_string() }}) as reason\r\n , result_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(result_date as date) as result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n , cast(lab_code as {{ dbt.type_string() }}) as lab_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , result_date\r\n , result\r\n , lab_code\r\n , hcc_code\r\n , hcc_description\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_egfr_labs", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "compiled": true, "compiled_code": "\n\nwith egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n from dev_thuxuan.hcc_suspecting._int_prep_egfr_labs\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN CKD logic */\n\n/*\n Find a patient\u2019s two most recent eGFR lab results that are spaced by at\n least 90 days.\n*/\n, max_lab_date as (\n\n select\n patient_id\n , data_source\n , max(result_date) as max_result_date\n from egfr_labs\n group by\n patient_id\n , data_source\n\n)\n\n, lab_lookback as (\n\n select\n egfr_labs.patient_id\n , egfr_labs.data_source\n , max_lab_date.max_result_date\n , max(egfr_labs.result_date) as lookback_result_date\n from egfr_labs\n left join max_lab_date\n on egfr_labs.patient_id = max_lab_date.patient_id\n and egfr_labs.data_source = max_lab_date.data_source\n where egfr_labs.result_date <= \n\n dateadd(\n day,\n -90,\n max_result_date\n )\n\n\n group by\n egfr_labs.patient_id\n , egfr_labs.data_source\n , max_lab_date.max_result_date\n\n)\n\n/*\n Take the highest eGFR result that occurred between the date range.\n*/\n, eligible_labs as (\n\n select\n egfr_labs.patient_id\n , egfr_labs.data_source\n , egfr_labs.code_type\n , egfr_labs.code\n , egfr_labs.result_date\n , egfr_labs.result\n , row_number() over (\n partition by\n egfr_labs.patient_id\n , egfr_labs.data_source\n order by egfr_labs.result desc\n ) as row_num\n from egfr_labs\n inner join lab_lookback\n on egfr_labs.patient_id = lab_lookback.patient_id\n and egfr_labs.data_source = lab_lookback.data_source\n where egfr_labs.result_date >= lab_lookback.lookback_result_date\n\n)\n\n/*\n Assign a patient's kidney disease stage based on the highest eGFR based on\n the following range:\n\n CKD 3a: eGFR in the range (45-59)\n CKD 3b: eGFR in the range (30-44)\n CKD 4: eGFR in the range (15-29)\n CKD 5: eGFR in the range (0-14)\n*/\n, ckd_suspects as (\n\n select\n patient_id\n , data_source\n , code_type\n , code as lab_code\n , result_date\n , result\n , case\n when result between 0 and 14 then '326'\n when result between 15 and 29 then '327'\n when result between 30 and 44 then '328'\n when result between 45 and 59 then '329'\n end as hcc_code\n , 'eGFR ('\n || code\n || ') result '\n || cast(result as TEXT)\n || ' on '\n || result_date\n as contributing_factor\n from eligible_labs\n where row_num = 1\n\n)\n/* END CKD logic */\n\n, unioned as (\n\n select * from ckd_suspects\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.result_date\n , unioned.result\n , unioned.lab_code\n , unioned.hcc_code\n , unioned.contributing_factor\n , seed_hcc_descriptions.hcc_description\n , billed_hccs.current_year_billed\n from unioned\n inner join seed_hcc_descriptions\n on unioned.hcc_code = seed_hcc_descriptions.hcc_code\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , result_date\n , result\n , lab_code\n , hcc_code\n , hcc_description\n , contributing_factor\n , current_year_billed\n , cast('Lab result suspect' as TEXT) as reason\n , result_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(result_date as date) as result_date\n , cast(result as numeric(28,6)) as result\n , cast(lab_code as TEXT) as lab_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , result_date\n , result\n , lab_code\n , hcc_code\n , hcc_description\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_medication_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_medication_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_medication_suspects"], "alias": "_int_medication_suspects", "checksum": {"name": "sha256", "checksum": "da72f5441fa9684f3829633759ccd5dbcd574f6a271a4b04f39c9f659d90b184"}, "config": {"enabled": true, "alias": "_int_medication_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting conditions based on medications.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed or paid date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug_code": {"name": "drug_code", "description": "NDC or rxnorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting medication was dispensed or paid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_medication_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0065222, "relation_name": "dev_thuxuan.hcc_suspecting._int_medication_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , drug_code\r\n , code_system\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_all_medications') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\r\n\r\n antidepressant medication taken within the past five years\r\n*/\r\n, hcc_155_suspect as (\r\n\r\n select\r\n all_medications.patient_id\r\n , all_medications.dispensing_date\r\n , all_medications.drug_code\r\n , all_medications.code_system\r\n , all_medications.data_source\r\n , seed_clinical_concepts.concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from all_medications\r\n inner join seed_clinical_concepts\r\n on all_medications.code_system = seed_clinical_concepts.code_system\r\n and all_medications.drug_code = seed_clinical_concepts.code\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '155'\r\n where lower(seed_clinical_concepts.concept_name) = 'antidepressant medication'\r\n and all_medications.dispensing_date >= {{ dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -5\r\n , from_date_or_timestamp = dbt.current_timestamp()\r\n ) }}\r\n\r\n)\r\n/* END HCC 155 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_155_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.concept_name\r\n , unioned.dispensing_date\r\n , unioned.drug_code\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , dispensing_date\r\n , drug_code\r\n , current_year_billed\r\n , cast('Medication suspect' as {{ dbt.type_string() }}) as reason\r\n , concept_name\r\n || ' ('\r\n || drug_code\r\n || ')'\r\n || ' dispensed on '\r\n || dispensing_date\r\n as contributing_factor\r\n , dispensing_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(dispensing_date as date) as dispensing_date\r\n , cast(drug_code as {{ dbt.type_string() }}) as drug_code\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , dispensing_date\r\n , drug_code\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_all_medications", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_all_medications", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "compiled": true, "compiled_code": "\n\nwith all_medications as (\n\n select\n patient_id\n , dispensing_date\n , drug_code\n , code_system\n , data_source\n from dev_thuxuan.hcc_suspecting._int_all_medications\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\n\n antidepressant medication taken within the past five years\n*/\n, hcc_155_suspect as (\n\n select\n all_medications.patient_id\n , all_medications.dispensing_date\n , all_medications.drug_code\n , all_medications.code_system\n , all_medications.data_source\n , seed_clinical_concepts.concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from all_medications\n inner join seed_clinical_concepts\n on all_medications.code_system = seed_clinical_concepts.code_system\n and all_medications.drug_code = seed_clinical_concepts.code\n inner join seed_hcc_descriptions\n on hcc_code = '155'\n where lower(seed_clinical_concepts.concept_name) = 'antidepressant medication'\n and all_medications.dispensing_date >= \n\n dateadd(\n year,\n -5,\n convert_timezone('UTC', current_timestamp())\n )\n\n\n\n)\n/* END HCC 155 logic */\n\n, unioned as (\n\n select * from hcc_155_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.concept_name\n , unioned.dispensing_date\n , unioned.drug_code\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , dispensing_date\n , drug_code\n , current_year_billed\n , cast('Medication suspect' as TEXT) as reason\n , concept_name\n || ' ('\n || drug_code\n || ')'\n || ' dispensed on '\n || dispensing_date\n as contributing_factor\n , dispensing_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(dispensing_date as date) as dispensing_date\n , cast(drug_code as TEXT) as drug_code\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , dispensing_date\n , drug_code\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_observation_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_observation_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_observation_suspects"], "alias": "_int_observation_suspects", "checksum": {"name": "sha256", "checksum": "d3a25d5592ec92c9e64cc2f6a935a94fcdccbd1ef4dcb7327bb5f2ee76134bff"}, "config": {"enabled": true, "alias": "_int_observation_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting observation conditions.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_result": {"name": "observation_result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The code for the comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Recorded date for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_concept_name": {"name": "condition_concept_name", "description": "Clinical concept name for the comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting observation was recorded.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_observation_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.012519, "relation_name": "dev_thuxuan.hcc_suspecting._int_observation_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , result\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__observation') }}\r\n\r\n)\r\n\r\n, numeric_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , cast(result as numeric) as result\r\n , code_type\r\n , code\r\n , data_source\r\n from observations\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n, depression_assessment as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.observation_date\r\n , numeric_observations.result\r\n , numeric_observations.code_type\r\n , numeric_observations.code\r\n , numeric_observations.data_source\r\n , seed_clinical_concepts.concept_name\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'depression assessment (phq-9)'\r\n\r\n)\r\n\r\n, diabetes as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\r\n\r\n)\r\n\r\n, hypertension as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'essential hypertension'\r\n\r\n)\r\n\r\n, obstructive_sleep_apnea as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'obstructive sleep apnea'\r\n\r\n)\r\n\r\n/* BEGIN HCC 48 logic (Morbid Obesity) */\r\n, bmi_over_30_with_osa as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , obstructive_sleep_apnea.code as condition_code\r\n , obstructive_sleep_apnea.recorded_date as condition_date\r\n , obstructive_sleep_apnea.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join obstructive_sleep_apnea\r\n on numeric_observations.patient_id = obstructive_sleep_apnea.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from obstructive_sleep_apnea.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 30\r\n\r\n)\r\n\r\n, bmi_over_35_with_diabetes as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , diabetes.code as condition_code\r\n , diabetes.recorded_date as condition_date\r\n , diabetes.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join diabetes\r\n on numeric_observations.patient_id = diabetes.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from diabetes.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 35\r\n\r\n)\r\n\r\n, bmi_over_35_with_hypertension as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , hypertension.code as condition_code\r\n , hypertension.recorded_date as condition_date\r\n , hypertension.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join hypertension\r\n on numeric_observations.patient_id = hypertension.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from hypertension.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 35\r\n\r\n)\r\n\r\n, bmi_over_40 as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , cast(null as {{ dbt.type_string() }}) as condition_code\r\n , cast(null as date) as condition_date\r\n , cast(null as {{ dbt.type_string() }}) as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 40\r\n\r\n)\r\n\r\n, hcc_48_unioned as (\r\n\r\n select * from bmi_over_30_with_osa\r\n union all\r\n select * from bmi_over_35_with_diabetes\r\n union all\r\n select * from bmi_over_35_with_hypertension\r\n union all\r\n select * from bmi_over_40\r\n\r\n)\r\n\r\n, hcc_48_suspect as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , 'BMI result '\r\n || cast(observation_result as {{ dbt.type_string() }})\r\n || case\r\n when condition_code is null then ''\r\n else ' with '\r\n || condition_concept_name\r\n || ' ('\r\n || condition_code\r\n || ' on '\r\n || condition_date\r\n || ')'\r\n end\r\n as contributing_factor\r\n from hcc_48_unioned\r\n\r\n)\r\n/* END HCC 48 logic */\r\n\r\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\r\n\r\n to determine a positive PHQ-9 assessment, we look at the past 3 screenings\r\n for a patient and take the highest result\r\n*/\r\n, eligible_depression_assessments as (\r\n\r\n select\r\n depression_assessment.patient_id\r\n , depression_assessment.observation_date\r\n , depression_assessment.result\r\n , depression_assessment.code_type\r\n , depression_assessment.code\r\n , depression_assessment.data_source\r\n , depression_assessment.concept_name\r\n , row_number() over (\r\n partition by\r\n depression_assessment.patient_id\r\n , depression_assessment.data_source\r\n order by depression_assessment.observation_date desc nulls last\r\n ) as assessment_order\r\n from depression_assessment\r\n\r\n)\r\n\r\n, depression_assessments_ordered as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n , result\r\n , row_number() over (\r\n partition by\r\n patient_id\r\n , data_source\r\n order by result desc nulls last\r\n ) as result_order --order the last three assessments by result value\r\n from eligible_depression_assessments\r\n where assessment_order <= 3\r\n\r\n)\r\n\r\n, hcc_155_suspect as (\r\n\r\n select\r\n depression_assessments_ordered.patient_id\r\n , depression_assessments_ordered.data_source\r\n , depression_assessments_ordered.observation_date\r\n , depression_assessments_ordered.result as observation_result\r\n , cast(null as {{ dbt.type_string() }}) as condition_code\r\n , cast(null as date) as condition_date\r\n , depression_assessments_ordered.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n , 'PHQ-9 result '\r\n || cast(depression_assessments_ordered.result as {{ dbt.type_string() }})\r\n || ' on '\r\n || depression_assessments_ordered.observation_date\r\n as contributing_factor\r\n from depression_assessments_ordered\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '155'\r\n where result_order = 1\r\n and result >= 15\r\n\r\n)\r\n\r\n/* END HCC 155 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_48_suspect\r\n union all\r\n select * from hcc_155_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.observation_date\r\n , unioned.observation_result\r\n , unioned.condition_code\r\n , unioned.condition_date\r\n , unioned.condition_concept_name\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.contributing_factor\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , contributing_factor\r\n , current_year_billed\r\n , cast('Observation suspect' as {{ dbt.type_string() }}) as reason\r\n , observation_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(observation_date as date) as observation_date\r\n , cast(observation_result as {{ dbt.type_string() }}) as observation_result\r\n , cast(condition_code as {{ dbt.type_string() }}) as condition_code\r\n , cast(condition_date as date) as condition_date\r\n , cast(condition_concept_name as {{ dbt.type_string() }}) as condition_concept_name\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__stg_core__observation", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.apply_regex", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "model.the_tuva_project.hcc_suspecting__stg_core__observation", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n\n),conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , result\n , code_type\n , code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__observation\n\n)\n\n, numeric_observations as (\n\n select\n patient_id\n , observation_date\n , cast(result as numeric) as result\n , code_type\n , code\n , data_source\n from observations\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$')\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n, depression_assessment as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.observation_date\n , numeric_observations.result\n , numeric_observations.code_type\n , numeric_observations.code\n , numeric_observations.data_source\n , seed_clinical_concepts.concept_name\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'depression assessment (phq-9)'\n\n)\n\n, diabetes as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\n\n)\n\n, hypertension as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'essential hypertension'\n\n)\n\n, obstructive_sleep_apnea as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'obstructive sleep apnea'\n\n)\n\n/* BEGIN HCC 48 logic (Morbid Obesity) */\n, bmi_over_30_with_osa as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , obstructive_sleep_apnea.code as condition_code\n , obstructive_sleep_apnea.recorded_date as condition_date\n , obstructive_sleep_apnea.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join obstructive_sleep_apnea\n on numeric_observations.patient_id = obstructive_sleep_apnea.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from obstructive_sleep_apnea.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 30\n\n)\n\n, bmi_over_35_with_diabetes as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , diabetes.code as condition_code\n , diabetes.recorded_date as condition_date\n , diabetes.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join diabetes\n on numeric_observations.patient_id = diabetes.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from diabetes.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 35\n\n)\n\n, bmi_over_35_with_hypertension as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , hypertension.code as condition_code\n , hypertension.recorded_date as condition_date\n , hypertension.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join hypertension\n on numeric_observations.patient_id = hypertension.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from hypertension.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 35\n\n)\n\n, bmi_over_40 as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , cast(null as TEXT) as condition_code\n , cast(null as date) as condition_date\n , cast(null as TEXT) as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 40\n\n)\n\n, hcc_48_unioned as (\n\n select * from bmi_over_30_with_osa\n union all\n select * from bmi_over_35_with_diabetes\n union all\n select * from bmi_over_35_with_hypertension\n union all\n select * from bmi_over_40\n\n)\n\n, hcc_48_suspect as (\n\n select\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , 'BMI result '\n || cast(observation_result as TEXT)\n || case\n when condition_code is null then ''\n else ' with '\n || condition_concept_name\n || ' ('\n || condition_code\n || ' on '\n || condition_date\n || ')'\n end\n as contributing_factor\n from hcc_48_unioned\n\n)\n/* END HCC 48 logic */\n\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\n\n to determine a positive PHQ-9 assessment, we look at the past 3 screenings\n for a patient and take the highest result\n*/\n, eligible_depression_assessments as (\n\n select\n depression_assessment.patient_id\n , depression_assessment.observation_date\n , depression_assessment.result\n , depression_assessment.code_type\n , depression_assessment.code\n , depression_assessment.data_source\n , depression_assessment.concept_name\n , row_number() over (\n partition by\n depression_assessment.patient_id\n , depression_assessment.data_source\n order by depression_assessment.observation_date desc nulls last\n ) as assessment_order\n from depression_assessment\n\n)\n\n, depression_assessments_ordered as (\n\n select\n patient_id\n , observation_date\n , code_type\n , code\n , data_source\n , concept_name\n , result\n , row_number() over (\n partition by\n patient_id\n , data_source\n order by result desc nulls last\n ) as result_order --order the last three assessments by result value\n from eligible_depression_assessments\n where assessment_order <= 3\n\n)\n\n, hcc_155_suspect as (\n\n select\n depression_assessments_ordered.patient_id\n , depression_assessments_ordered.data_source\n , depression_assessments_ordered.observation_date\n , depression_assessments_ordered.result as observation_result\n , cast(null as TEXT) as condition_code\n , cast(null as date) as condition_date\n , depression_assessments_ordered.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n , 'PHQ-9 result '\n || cast(depression_assessments_ordered.result as TEXT)\n || ' on '\n || depression_assessments_ordered.observation_date\n as contributing_factor\n from depression_assessments_ordered\n inner join seed_hcc_descriptions\n on hcc_code = '155'\n where result_order = 1\n and result >= 15\n\n)\n\n/* END HCC 155 logic */\n\n, unioned as (\n\n select * from hcc_48_suspect\n union all\n select * from hcc_155_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.observation_date\n , unioned.observation_result\n , unioned.condition_code\n , unioned.condition_date\n , unioned.condition_concept_name\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.contributing_factor\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , contributing_factor\n , current_year_billed\n , cast('Observation suspect' as TEXT) as reason\n , observation_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(observation_date as date) as observation_date\n , cast(observation_result as TEXT) as observation_result\n , cast(condition_code as TEXT) as condition_code\n , cast(condition_date as date) as condition_date\n , cast(condition_concept_name as TEXT) as condition_concept_name\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__observation", "sql": " __dbt__cte__hcc_suspecting__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_patient_hcc_history", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_patient_hcc_history"], "alias": "_int_patient_hcc_history", "checksum": {"name": "sha256", "checksum": "f4ec22767e68112d095fba9659e7887bed20e220f30878556c94c9641bb86849"}, "config": {"enabled": true, "alias": "_int_patient_hcc_history", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This intermediate model displays the full history of a patient's recorded HCCs with a flag for recorded during the current year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the ICD-10-CM condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__icd_10_cm_mappings.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_recorded": {"name": "first_recorded", "description": "Date the HCC was first recorded in the patient's record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_recorded": {"name": "last_recorded", "description": "Date the HCC was last recorded in the patient's record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_billed": {"name": "last_billed", "description": "Date the HCC was last billed in the patient's record (where condition_type <> 'problem').\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_patient_hcc_history", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0201974, "relation_name": "dev_thuxuan.hcc_suspecting._int_patient_hcc_history", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_conditions as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__int_all_conditions') }}\r\n where hcc_code is not null\r\n\r\n)\r\n\r\n, hcc_grouped as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , min(recorded_date) as first_recorded\r\n , max(recorded_date) as last_recorded\r\n from all_conditions\r\n where hcc_code is not null\r\n group by\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n\r\n)\r\n\r\n, hcc_billed as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , max(recorded_date) as last_billed\r\n from all_conditions\r\n where hcc_code is not null\r\n and lower(condition_type) <> 'problem'\r\n group by\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n\r\n)\r\n\r\n, add_flag as (\r\n\r\n select\r\n hcc_grouped.patient_id\r\n , hcc_grouped.data_source\r\n , hcc_grouped.hcc_code\r\n , hcc_grouped.hcc_description\r\n , hcc_grouped.first_recorded\r\n , hcc_grouped.last_recorded\r\n , hcc_billed.last_billed\r\n , case\r\n when extract(year from hcc_billed.last_billed) = extract(year from {{ dbt.current_timestamp() }} )\r\n then 1\r\n else 0\r\n end as current_year_billed\r\n from hcc_grouped\r\n left join hcc_billed\r\n on hcc_grouped.patient_id = hcc_billed.patient_id\r\n and hcc_grouped.hcc_code = hcc_billed.hcc_code\r\n and hcc_grouped.data_source = hcc_billed.data_source\r\n\r\n)\r\n\r\n, all_conditions_with_flag as (\r\n\r\n select distinct\r\n all_conditions.patient_id\r\n , all_conditions.data_source\r\n , all_conditions.recorded_date\r\n , all_conditions.condition_type\r\n , all_conditions.icd_10_cm_code\r\n , all_conditions.hcc_code\r\n , all_conditions.hcc_description\r\n , add_flag.first_recorded\r\n , add_flag.last_recorded\r\n , add_flag.last_billed\r\n , add_flag.current_year_billed\r\n , cast('Prior coding history' as {{ dbt.type_string() }}) as reason\r\n , icd_10_cm_code\r\n || case\r\n when last_billed is not null then ' last billed on ' || last_billed\r\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\r\n else ' (missing recorded and billing dates) '\r\n end as contributing_factor\r\n , coalesce(last_billed, last_recorded) as condition_date\r\n from all_conditions\r\n left join add_flag\r\n on all_conditions.patient_id = add_flag.patient_id\r\n and all_conditions.hcc_code = add_flag.hcc_code\r\n and all_conditions.data_source = add_flag.data_source\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , last_billed\r\n , current_year_billed\r\n , 'Prior coding history' as reason\r\n , icd_10_cm_code\r\n || case\r\n when last_billed is not null then ' last billed on ' || last_billed\r\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\r\n else ' (missing recorded and billing dates) '\r\n end as contributing_factor\r\n , coalesce(last_billed, last_recorded) as suspect_date\r\n from all_conditions_with_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(icd_10_cm_code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(first_recorded as date) as first_recorded\r\n , cast(last_recorded as date) as last_recorded\r\n , cast(last_billed as date) as last_billed\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , last_billed\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_all_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "compiled": true, "compiled_code": "\n\nwith all_conditions as (\n\n select\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._int_all_conditions\n where hcc_code is not null\n\n)\n\n, hcc_grouped as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , min(recorded_date) as first_recorded\n , max(recorded_date) as last_recorded\n from all_conditions\n where hcc_code is not null\n group by\n patient_id\n , hcc_code\n , hcc_description\n , data_source\n\n)\n\n, hcc_billed as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , max(recorded_date) as last_billed\n from all_conditions\n where hcc_code is not null\n and lower(condition_type) <> 'problem'\n group by\n patient_id\n , hcc_code\n , hcc_description\n , data_source\n\n)\n\n, add_flag as (\n\n select\n hcc_grouped.patient_id\n , hcc_grouped.data_source\n , hcc_grouped.hcc_code\n , hcc_grouped.hcc_description\n , hcc_grouped.first_recorded\n , hcc_grouped.last_recorded\n , hcc_billed.last_billed\n , case\n when extract(year from hcc_billed.last_billed) = extract(year from convert_timezone('UTC', current_timestamp()) )\n then 1\n else 0\n end as current_year_billed\n from hcc_grouped\n left join hcc_billed\n on hcc_grouped.patient_id = hcc_billed.patient_id\n and hcc_grouped.hcc_code = hcc_billed.hcc_code\n and hcc_grouped.data_source = hcc_billed.data_source\n\n)\n\n, all_conditions_with_flag as (\n\n select distinct\n all_conditions.patient_id\n , all_conditions.data_source\n , all_conditions.recorded_date\n , all_conditions.condition_type\n , all_conditions.icd_10_cm_code\n , all_conditions.hcc_code\n , all_conditions.hcc_description\n , add_flag.first_recorded\n , add_flag.last_recorded\n , add_flag.last_billed\n , add_flag.current_year_billed\n , cast('Prior coding history' as TEXT) as reason\n , icd_10_cm_code\n || case\n when last_billed is not null then ' last billed on ' || last_billed\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\n else ' (missing recorded and billing dates) '\n end as contributing_factor\n , coalesce(last_billed, last_recorded) as condition_date\n from all_conditions\n left join add_flag\n on all_conditions.patient_id = add_flag.patient_id\n and all_conditions.hcc_code = add_flag.hcc_code\n and all_conditions.data_source = add_flag.data_source\n\n)\n\n, add_standard_fields as (\n\n select distinct\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , last_billed\n , current_year_billed\n , 'Prior coding history' as reason\n , icd_10_cm_code\n || case\n when last_billed is not null then ' last billed on ' || last_billed\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\n else ' (missing recorded and billing dates) '\n end as contributing_factor\n , coalesce(last_billed, last_recorded) as suspect_date\n from all_conditions_with_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(icd_10_cm_code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(first_recorded as date) as first_recorded\n , cast(last_recorded as date) as last_recorded\n , cast(last_billed as date) as last_billed\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , last_billed\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_prep_conditions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_prep_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_prep_conditions"], "alias": "_int_prep_conditions", "checksum": {"name": "sha256", "checksum": "1e62f38c7c47c6b0de539861d3cd81d18120cc672f9b441bee2b0bf819a4c47e"}, "config": {"enabled": true, "alias": "_int_prep_conditions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Preparing conditions; mapping snomed-ct conditions to icd-10-cm.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_prep_conditions", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0238035, "relation_name": "dev_thuxuan.hcc_suspecting._int_prep_conditions", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__condition') }}\r\n\r\n)\r\n\r\n/*\r\n Default mapping guidance: Most map groups terminate with an unconditional\r\n rule \u2013 a rule whose predicate is \u201cTRUE\u201d or, equivalently, \u201cOTHERWISE TRUE\u201d.\r\n This rule is considered a \u201cdefault\u201d because it should be applied if\r\n nothing further is known about the patient\u2019s condition.\r\n*/\r\n, seed_snomed_icd_10_map as (\r\n\r\n select\r\n referenced_component_id as snomed_code\r\n , map_target as icd_10_code\r\n from {{ ref('terminology__snomed_icd_10_map') }}\r\n where lower(map_rule) in ('true', 'otherwise true')\r\n and map_group = '1'\r\n\r\n)\r\n\r\n, snomed_conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , 'icd-10-cm' as code_type\r\n , icd_10_code as code\r\n , data_source\r\n from conditions\r\n inner join seed_snomed_icd_10_map\r\n on conditions.code = seed_snomed_icd_10_map.snomed_code\r\n where conditions.code_type = 'snomed-ct'\r\n\r\n)\r\n\r\n, other_conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from conditions\r\n where conditions.code_type <> 'snomed-ct'\r\n\r\n)\r\n\r\n, union_conditions as (\r\n\r\n select * from snomed_conditions\r\n union all\r\n select * from other_conditions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(code as {{ dbt.type_string() }}) as code\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from union_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__condition", "package": null, "version": null}, {"name": "terminology__snomed_icd_10_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__condition", "seed.the_tuva_project.terminology__snomed_icd_10_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition\n),conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__condition\n\n)\n\n/*\n Default mapping guidance: Most map groups terminate with an unconditional\n rule \u2013 a rule whose predicate is \u201cTRUE\u201d or, equivalently, \u201cOTHERWISE TRUE\u201d.\n This rule is considered a \u201cdefault\u201d because it should be applied if\n nothing further is known about the patient\u2019s condition.\n*/\n, seed_snomed_icd_10_map as (\n\n select\n referenced_component_id as snomed_code\n , map_target as icd_10_code\n from dev_thuxuan.terminology.snomed_icd_10_map\n where lower(map_rule) in ('true', 'otherwise true')\n and map_group = '1'\n\n)\n\n, snomed_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , 'icd-10-cm' as code_type\n , icd_10_code as code\n , data_source\n from conditions\n inner join seed_snomed_icd_10_map\n on conditions.code = seed_snomed_icd_10_map.snomed_code\n where conditions.code_type = 'snomed-ct'\n\n)\n\n, other_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from conditions\n where conditions.code_type <> 'snomed-ct'\n\n)\n\n, union_conditions as (\n\n select * from snomed_conditions\n union all\n select * from other_conditions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(code_type as TEXT) as code_type\n , cast(code as TEXT) as code\n , cast(data_source as TEXT) as data_source\n from union_conditions\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__condition", "sql": " __dbt__cte__hcc_suspecting__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_prep_egfr_labs", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_prep_egfr_labs"], "alias": "_int_prep_egfr_labs", "checksum": {"name": "sha256", "checksum": "7cc3aff1cef825a5ea34ae89c1dc8f2b16adcd7c52560a0718407bfbaea6fea8"}, "config": {"enabled": true, "alias": "_int_prep_egfr_labs", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Preparing eGFR labs with clean numeric results.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The normalized code type or source code type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized code or source code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "Cleaned numeric result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_prep_egfr_labs", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0288913, "relation_name": "dev_thuxuan.hcc_suspecting._int_prep_egfr_labs", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith lab_result as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , status\r\n , result\r\n , result_date\r\n from {{ ref('hcc_suspecting__stg_core__lab_result') }}\r\n\r\n)\r\n\r\n, seed_egfr_codes as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n where lower(concept_name) = 'estimated glomerular filtration rate'\r\n\r\n)\r\n\r\n, egfr_labs as (\r\n\r\n select distinct\r\n lab_result.patient_id\r\n , lab_result.data_source\r\n , lab_result.code_type\r\n , lab_result.code\r\n , lab_result.result_date\r\n , lab_result.result\r\n from lab_result\r\n inner join seed_egfr_codes\r\n on lab_result.code = seed_egfr_codes.code\r\n and lab_result.code_type = seed_egfr_codes.code_system\r\n where lab_result.result is not null\r\n and lower(lab_result.status) not in ('cancelled', 'entered-in-error')\r\n\r\n)\r\n\r\n, numeric_egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n from egfr_labs\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }}\r\n\r\n)\r\n\r\n, clean_non_numeric_egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n , cast(case\r\n when lower(result) like '%unsatisfactory specimen%' then null\r\n when result like '%>%' then null\r\n when result like '%<%' then null\r\n when result like '%@%' then trim(replace(result,'@',''))\r\n when result like '%mL/min/1.73m2%' then trim(replace(result,'mL/min/1.73m2',''))\r\n else null\r\n end as {{ dbt.type_numeric() }}) as clean_result\r\n from egfr_labs\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }} = False\r\n\r\n)\r\n\r\n, unioned_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n from numeric_egfr_labs\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , clean_result as result\r\n from clean_non_numeric_egfr_labs\r\n where clean_result is not null\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(code as {{ dbt.type_string() }}) as code\r\n , cast(result_date as date) as result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n from unioned_labs\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__lab_result", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.the_tuva_project.apply_regex", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "seed.the_tuva_project.hcc_suspecting__clinical_concepts"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__lab_result as (\n\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n\n),lab_result as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , status\n , result\n , result_date\n from __dbt__cte__hcc_suspecting__stg_core__lab_result\n\n)\n\n, seed_egfr_codes as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n where lower(concept_name) = 'estimated glomerular filtration rate'\n\n)\n\n, egfr_labs as (\n\n select distinct\n lab_result.patient_id\n , lab_result.data_source\n , lab_result.code_type\n , lab_result.code\n , lab_result.result_date\n , lab_result.result\n from lab_result\n inner join seed_egfr_codes\n on lab_result.code = seed_egfr_codes.code\n and lab_result.code_type = seed_egfr_codes.code_system\n where lab_result.result is not null\n and lower(lab_result.status) not in ('cancelled', 'entered-in-error')\n\n)\n\n, numeric_egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , cast(result as numeric(28,6)) as result\n from egfr_labs\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$')\n\n)\n\n, clean_non_numeric_egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n , cast(case\n when lower(result) like '%unsatisfactory specimen%' then null\n when result like '%>%' then null\n when result like '%<%' then null\n when result like '%@%' then trim(replace(result,'@',''))\n when result like '%mL/min/1.73m2%' then trim(replace(result,'mL/min/1.73m2',''))\n else null\n end as numeric(28,6)) as clean_result\n from egfr_labs\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$') = False\n\n)\n\n, unioned_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n from numeric_egfr_labs\n\n union all\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , clean_result as result\n from clean_non_numeric_egfr_labs\n where clean_result is not null\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(code_type as TEXT) as code_type\n , cast(code as TEXT) as code\n , cast(result_date as date) as result_date\n , cast(result as numeric(28,6)) as result\n from unioned_labs\n\n)\n\nselect\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "sql": " __dbt__cte__hcc_suspecting__stg_core__lab_result as (\n\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__condition": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__condition", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "745c9b9ac8c84d1567536d8b9004b6158df4abeeb8f8d9e6ae2e8f7c02c7879e"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_condition", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.032498, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , condition_type\r\n , lower(normalized_code_type) as code_type\r\n , normalized_code as code\r\n , data_source\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__lab_result"], "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "331fad9316618c8110b28f7cf90d49c3265eae9ad92d9c11ffd350095e11cfb7"}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging conditions from core.", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_lab_result", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0375881, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n lab_result_id\r\n , patient_id\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , status\r\n , result\r\n , result_date\r\n , data_source\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n lab_result_id\r\n , patient_id\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , status\r\n , result\r\n , result_date\r\n , data_source\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as code_type\r\n , cast(null as {{ dbt.type_string() }} ) as code\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__medication": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__medication", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__medication"], "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "05e79760b6c6bdba890466e9d41602ef19bda525ddee108b675bbcceac1738c1"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging medications from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_medication", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.041506, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__observation": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__observation", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__observation"], "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "713a9f995052ee452003d08059d64c1c42cb8998b33b9b2f2442e022f2e5ba2f"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging observations from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_observation", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0455816, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , result\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , data_source\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , result\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , data_source\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as code_type\r\n , cast(null as {{ dbt.type_string() }} ) as code\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__patient": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__patient", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "751bf83a7239d99b66b7156431ae7a9593c9c6fa536a6231f5f8c1d3e825d692"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging patients from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_patient", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.050103, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__pharmacy_claim"], "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "5bdb60655574ed35470ffedb608f408a7275efa5e7044d6471825e5dadf3b9c7"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging pharmacy claims from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_pharmacy_claim", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0540328, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , data_source\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , data_source\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_claim_type"], "alias": "count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "c01e48572ea6f3654f67289cdc65c27a267af5daeac27f7a04004252222fad62"}, "config": {"enabled": true, "alias": "count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by claim type.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.059139, "relation_name": "dev_thuxuan.insights.count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect \r\n claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\nunion all\r\nselect \r\n 'pharmacy'\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\n\nselect \n claim_type\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by claim_type\nunion all\nselect \n 'pharmacy'\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_date_column": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_date_column", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_date_column.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_date_column.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_date_column"], "alias": "count_claim_by_date_column", "checksum": {"name": "sha256", "checksum": "aaacd6758dd9d1e44444a80e2e0852d4b13bcf8b0fd630e983ee730292d86eb2"}, "config": {"enabled": true, "alias": "count_claim_by_date_column", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by multiple dates.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_date_column", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0657198, "relation_name": "dev_thuxuan.insights.count_claim_by_date_column", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith date_stage as(\r\n\r\n select\r\n 'claim_start_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_start_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_start_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'claim_end_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n union all\r\n\r\n select\r\n 'admission_date' as date_field\r\n , cast({{ date_part(\"year\", \"admission_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"admission_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'discharge_date' as date_field\r\n , cast({{ date_part(\"year\", \"discharge_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"discharge_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'medical paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'dispensing_date' as date_field\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'pharmacy paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all \r\n\r\n select\r\n 'member_months' as date_field\r\n , year_month\r\n , count(*) as distinct_count\r\n from {{ ref('financial_pmpm__member_months') }}\r\n group by\r\n year_month\r\n)\r\n\r\n\r\n, all_date_range as (\r\n select distinct \r\n replace(cal.year_month,'-','') as year_month\r\n from {{ ref('terminology__calendar') }} cal\r\n where (cal.year_month >= (select min(year_month) from date_stage)\r\n and cal.year_month <= (select max(year_month) from date_stage))\r\n \r\n)\r\n\r\nselect\r\n cast(all_date.year_month as {{ dbt.type_int() }} ) as year_month\r\n , member_months.distinct_count as member_months\r\n , claim_start.distinct_count as claim_start_date\r\n , claim_end.distinct_count as claim_end_date\r\n , admission_date.distinct_count as admission_date\r\n , discharge_date.distinct_count as discharge_date\r\n , med_paid_date.distinct_count as medical_paid_date\r\n , dispensing_date.distinct_count as dispensing_date\r\n , pharm_paid_date.distinct_count as pharmacy_paid_date\r\nfrom all_date_range all_date\r\nleft join date_stage member_months\r\n on all_date.year_month = member_months.year_month\r\n and member_months.date_field = 'member_months'\r\nleft join date_stage claim_start\r\n on all_date.year_month = claim_start.year_month\r\n and claim_start.date_field = 'claim_start_date'\r\nleft join date_stage claim_end\r\n on all_date.year_month = claim_end.year_month\r\n and claim_end.date_field = 'claim_end_date'\r\nleft join date_stage admission_date\r\n on all_date.year_month = admission_date.year_month\r\n and admission_date.date_field = 'admission_date'\r\nleft join date_stage discharge_date\r\n on all_date.year_month = discharge_date.year_month\r\n and discharge_date.date_field = 'discharge_date'\r\nleft join date_stage med_paid_date\r\n on all_date.year_month = med_paid_date.year_month\r\n and med_paid_date.date_field = 'medical paid_date'\r\nleft join date_stage dispensing_date\r\n on all_date.year_month = dispensing_date.year_month\r\n and dispensing_date.date_field = 'dispensing_date'\r\nleft join date_stage pharm_paid_date\r\n on all_date.year_month = pharm_paid_date.year_month\r\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.type_int"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_date_column.sql", "compiled": true, "compiled_code": "\n\nwith date_stage as(\n\n select\n 'claim_start_date' as date_field\n , cast(date_part('year', claim_start_date) as TEXT) || right('0'||cast(date_part('month', claim_start_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'claim_end_date' as date_field\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n union all\n\n select\n 'admission_date' as date_field\n , cast(date_part('year', admission_date) as TEXT) || right('0'||cast(date_part('month', admission_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'discharge_date' as date_field\n , cast(date_part('year', discharge_date) as TEXT) || right('0'||cast(date_part('month', discharge_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'medical paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'dispensing_date' as date_field\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n\n union all\n\n select\n 'pharmacy paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n\n union all \n\n select\n 'member_months' as date_field\n , year_month\n , count(*) as distinct_count\n from dev_thuxuan.financial_pmpm.member_months\n group by\n year_month\n)\n\n\n, all_date_range as (\n select distinct \n replace(cal.year_month,'-','') as year_month\n from dev_thuxuan.terminology.calendar cal\n where (cal.year_month >= (select min(year_month) from date_stage)\n and cal.year_month <= (select max(year_month) from date_stage))\n \n)\n\nselect\n cast(all_date.year_month as INT ) as year_month\n , member_months.distinct_count as member_months\n , claim_start.distinct_count as claim_start_date\n , claim_end.distinct_count as claim_end_date\n , admission_date.distinct_count as admission_date\n , discharge_date.distinct_count as discharge_date\n , med_paid_date.distinct_count as medical_paid_date\n , dispensing_date.distinct_count as dispensing_date\n , pharm_paid_date.distinct_count as pharmacy_paid_date\nfrom all_date_range all_date\nleft join date_stage member_months\n on all_date.year_month = member_months.year_month\n and member_months.date_field = 'member_months'\nleft join date_stage claim_start\n on all_date.year_month = claim_start.year_month\n and claim_start.date_field = 'claim_start_date'\nleft join date_stage claim_end\n on all_date.year_month = claim_end.year_month\n and claim_end.date_field = 'claim_end_date'\nleft join date_stage admission_date\n on all_date.year_month = admission_date.year_month\n and admission_date.date_field = 'admission_date'\nleft join date_stage discharge_date\n on all_date.year_month = discharge_date.year_month\n and discharge_date.date_field = 'discharge_date'\nleft join date_stage med_paid_date\n on all_date.year_month = med_paid_date.year_month\n and med_paid_date.date_field = 'medical paid_date'\nleft join date_stage dispensing_date\n on all_date.year_month = dispensing_date.year_month\n and dispensing_date.date_field = 'dispensing_date'\nleft join date_stage pharm_paid_date\n on all_date.year_month = pharm_paid_date.year_month\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_service_category"], "alias": "count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "124b0ce56f0f8f67c32cae100a47e34ea7478bd60ba54b000c0da458314a9c54"}, "config": {"enabled": true, "alias": "count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by service category.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0708334, "relation_name": "dev_thuxuan.insights.count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect \r\n 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect \n 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect \n 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__orphan_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__orphan_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__orphan_claim_by_claim_type"], "alias": "orphan_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "85e2bf37a4ec730b078660ae5eec830c406e4280f5b8c2246ab0ae1aca2312c7"}, "config": {"enabled": true, "alias": "orphan_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of medical and pharmacy claims without a corresponding eligibilty record.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "orphan_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.073823, "relation_name": "dev_thuxuan.insights.orphan_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith medical_claim_orphan as(\r\nselect\r\n 'medical_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__medical_claim') }}\r\n)\r\n\r\n, pharmacy_claim_orphan as(\r\nselect\r\n 'pharmacy_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n)\r\n, union_orphans as(\r\n select \r\n med.* \r\n from medical_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n\r\n union all\r\n\r\n select \r\n med.* \r\n from pharmacy_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n)\r\n\r\nselect\r\n claim_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom union_orphans\r\ngroup by claim_category", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim_orphan as(\nselect\n 'medical_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\nfrom dev_thuxuan.core.medical_claim\n)\n\n, pharmacy_claim_orphan as(\nselect\n 'pharmacy_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\nfrom dev_thuxuan.core.pharmacy_claim\n)\n, union_orphans as(\n select \n med.* \n from medical_claim_orphan med\n left join dev_thuxuan.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n\n union all\n\n select \n med.* \n from pharmacy_claim_orphan med\n left join dev_thuxuan.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n)\n\nselect\n claim_category\n , count(distinct claim_id) as distinct_claim_count\nfrom union_orphans\ngroup by claim_category", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_claim_type"], "alias": "sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "732a164bcfdc86d47816a8a0ee706f34376b8a7b1798b89c9ec919da22523fd9"}, "config": {"enabled": true, "alias": "sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0778365, "relation_name": "dev_thuxuan.insights.sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\n\r\nunion all\r\n\r\nselect \r\n 'pharmacy'\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , null as total_charge_amount\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by claim_type\n\nunion all\n\nselect \n 'pharmacy'\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , null as total_charge_amount\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_service_category"], "alias": "sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "7aabf9570eb13c0960d1a6b2722813a6b057b9c4a6dd6e15d4bc46a8f362a504"}, "config": {"enabled": true, "alias": "sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.083429, "relation_name": "dev_thuxuan.insights.sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n 'service_category_1' as service_category_type\r\n , service_category_1\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect\r\n 'service_category_2' as service_category_type\r\n , service_category_2\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect\n 'service_category_1' as service_category_type\n , service_category_1\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect\n 'service_category_2' as service_category_type\n , service_category_2\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_claim_type"], "alias": "trend_count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "c5ee3e86f2b7e68b0e472ec3aaf41a7cc6005fc95b6aafd77680354259a33d77"}, "config": {"enabled": true, "alias": "trend_count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.0885944, "relation_name": "dev_thuxuan.insights.trend_count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_with_previous_count as(\r\n select \r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\r\n from trend_by_claim_type\r\n)\r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom trend_with_previous_count", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_with_previous_count as(\n select \n year_month\n , claim_type\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\n from trend_by_claim_type\n)\n\nselect\n year_month\n , claim_type\n , distinct_claim_count\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom trend_with_previous_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_service_category"], "alias": "trend_count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "d4e0c3634f4c7e270c36b9a310ff5d1c5fe4f134f7bd4844ffa7a46a91e7eb6c"}, "config": {"enabled": true, "alias": "trend_count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.093514, "relation_name": "dev_thuxuan.insights.trend_count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_service_category_1 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_1\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_2\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, previous_service_category_1_claim_count as(\r\n select\r\n year_month\r\n , service_category_1\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_1\r\n)\r\n, previous_service_category_2_claim_count as(\r\n select\r\n year_month\r\n , service_category_2\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_2\r\n)\r\nselect \r\n year_month\r\n , service_category_1 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_1_claim_count\r\n\r\n union all\r\n\r\n select \r\n year_month\r\n , service_category_2 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_2_claim_count", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_service_category_1 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_1\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_2\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, previous_service_category_1_claim_count as(\n select\n year_month\n , service_category_1\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_1\n)\n, previous_service_category_2_claim_count as(\n select\n year_month\n , service_category_2\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_2\n)\nselect \n year_month\n , service_category_1 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_1_claim_count\n\n union all\n\n select \n year_month\n , service_category_2 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_2_claim_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_claim_type"], "alias": "trend_sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "45c6027bf9a6e62f881f86b83e2792c74ba3d9fcec8135a665f28674db67527f"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1021311, "relation_name": "dev_thuxuan.insights.trend_sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_medical_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_by_pharmacy_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , cast('pharmacy' as {{ dbt.type_string() }}) as claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , 0 as total_charge_amount\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n)\r\n, trend_with_previous_medical_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_medical_claim_type\r\n)\r\n, trend_with_previous_pharmacy_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_pharmacy_claim_type\r\n)\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_medical_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_pharmacy_sum", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_medical_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_by_pharmacy_claim_type as(\n select\n cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , cast('pharmacy' as TEXT) as claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , 0 as total_charge_amount\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n)\n, trend_with_previous_medical_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_medical_claim_type\n)\n, trend_with_previous_pharmacy_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_pharmacy_claim_type\n)\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_medical_sum\n\nunion all \n\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_pharmacy_sum", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_service_category"], "alias": "trend_sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "34291f05b11ce9daf8c55c5f5ee36f8c5bd9114b442392153df5c8ac9bfda815"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1101344, "relation_name": "dev_thuxuan.insights.trend_sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith trend_by_service_category_1 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, trend_with_previous_service_category_1_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_1\r\n)\r\n, trend_with_previous_service_category_2_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_2\r\n)\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_1_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_2_sum", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\n\nwith trend_by_service_category_1 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, trend_with_previous_service_category_1_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_1\n)\n, trend_with_previous_service_category_2_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_2\n)\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_1_sum\n\nunion all \n\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_2_sum", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_counts": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_counts", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_counts.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_counts.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_counts", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_counts"], "alias": "summary_counts", "checksum": {"name": "sha256", "checksum": "744c720898dd2acc91d01ccb4ec34c9f8f0a8b43d1b18d3ac1eed11fc010f4e8"}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_counts", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1158104, "relation_name": "dev_thuxuan.quality_measures.summary_counts", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith summary_long as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , performance_flag\r\n from {{ ref('quality_measures__summary_long') }}\r\n where measure_id is not null\r\n\r\n)\r\n\r\n, calculate_performance_rate as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , sum(denominator_flag) as denominator_sum\r\n , sum(numerator_flag) as numerator_sum\r\n , sum(exclusion_flag) as exclusion_sum\r\n , (\r\n cast(sum(performance_flag) as {{ dbt.type_numeric() }}) /\r\n (cast(count(performance_flag) as {{ dbt.type_numeric() }}) )\r\n )*100 as performance_rate\r\n from summary_long\r\n group by\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(denominator_sum as integer) as denominator_sum\r\n , cast(numerator_sum as integer) as numerator_sum\r\n , cast(exclusion_sum as integer) as exclusion_sum\r\n , round(cast(performance_rate as {{ dbt.type_numeric() }}),3) as performance_rate\r\n from calculate_performance_rate\r\n\r\n)\r\n\r\nselect\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_sum\r\n , numerator_sum\r\n , exclusion_sum\r\n , performance_rate\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_counts.sql", "compiled": true, "compiled_code": "\n\nwith summary_long as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , performance_flag\n from dev_thuxuan.quality_measures.summary_long\n where measure_id is not null\n\n)\n\n, calculate_performance_rate as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , sum(denominator_flag) as denominator_sum\n , sum(numerator_flag) as numerator_sum\n , sum(exclusion_flag) as exclusion_sum\n , (\n cast(sum(performance_flag) as numeric(28,6)) /\n (cast(count(performance_flag) as numeric(28,6)) )\n )*100 as performance_rate\n from summary_long\n group by\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n\n)\n\n, add_data_types as (\n\n select\n cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(denominator_sum as integer) as denominator_sum\n , cast(numerator_sum as integer) as numerator_sum\n , cast(exclusion_sum as integer) as exclusion_sum\n , round(cast(performance_rate as numeric(28,6)),3) as performance_rate\n from calculate_performance_rate\n\n)\n\nselect\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_sum\n , numerator_sum\n , exclusion_sum\n , performance_rate\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_long.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_long.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_long", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_long"], "alias": "summary_long", "checksum": {"name": "sha256", "checksum": "0ed79230024d00804c7d6d41a24123640d1fd2416d96d75415007300dafc809a"}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_flag": {"name": "performance_flag", "description": "Performance flag calculated by using exclusion, numerator, and denominator flags. When excluded from a measure the flag is null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1218824, "relation_name": "dev_thuxuan.quality_measures.summary_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* measures should already be at the full eligibility population grain */\r\nwith measures_unioned as (\r\n\r\n select * from {{ ref('quality_measures__int_nqf2372_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0034_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0059_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_cqm236_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0053_long') }}\r\n \r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from measures_unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , case\r\n when exclusion_flag = 1 then null\r\n when numerator_flag = 1 then 1\r\n when denominator_flag = 1 then 0\r\n else null end as performance_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_long", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0053_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_long.sql", "compiled": true, "compiled_code": "\n\n/* measures should already be at the full eligibility population grain */\nwith measures_unioned as (\n\n select * from dev_thuxuan.quality_measures._int_nqf2372_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0034_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0059_long\n union all\n select * from dev_thuxuan.quality_measures._int_cqm236_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0053_long\n \n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from measures_unioned\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , case\n when exclusion_flag = 1 then null\n when numerator_flag = 1 then 1\n when denominator_flag = 1 then 0\n else null end as performance_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_wide.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_wide.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_wide", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_wide"], "alias": "summary_wide", "checksum": {"name": "sha256", "checksum": "bd94bc3fba08437952f6a9cc93674495ac30a9849d9f29f20b52b221dd39bba8"}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Performance flag for NQF2372, Breast Cancer Screening. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0034": {"name": "nqf_0034", "description": "Performance flag for NQF0034, Colorectal Cancer Screening. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0059": {"name": "nqf_0059", "description": "Performance flag for NQF0059, Diabetes: Hemoglobin A1c (HbA1c) Poor Control (> 9%). A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cqm_236": {"name": "cqm_236", "description": "Performance flag for CQM236, Controlling High Blood Pressure. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0053": {"name": "nqf_0053", "description": "Performance flag for NQF0053, Osteoporosis Management in Women Who Had a Fracture. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_wide", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1275563, "relation_name": "dev_thuxuan.quality_measures.summary_wide", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Each measure is pivoted into a boolean column by evaluating the\r\n denominator, numerator, and exclusion flags.\r\n*/\r\nwith measures_long as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , performance_flag\r\n , measure_id\r\n from {{ ref('quality_measures__summary_long') }}\r\n\r\n)\r\n\r\n, nqf_2372 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF2372'\r\n\r\n)\r\n, nqf_0034 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0034'\r\n\r\n)\r\n\r\n,nqf_0059 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0059'\r\n\r\n)\r\n\r\n, cqm_236 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'CQM236'\r\n\r\n)\r\n\r\n,nqf_0053 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0053'\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n measures_long.patient_id\r\n , nqf_2372.performance_flag as nqf_2372\r\n , nqf_0034.performance_flag as nqf_0034\r\n , nqf_0059.performance_flag as nqf_0059\r\n , cqm_236.performance_flag as cqm_236\r\n , nqf_0053.performance_flag as nqf_0053\r\n from measures_long\r\n left join nqf_2372\r\n on measures_long.patient_id = nqf_2372.patient_id\r\n left join nqf_0034\r\n on measures_long.patient_id = nqf_0034.patient_id\r\n left join nqf_0059\r\n on measures_long.patient_id = nqf_0059.patient_id\r\n left join cqm_236\r\n on measures_long.patient_id = cqm_236.patient_id\r\n left join nqf_0053\r\n on measures_long.patient_id = nqf_0053.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(nqf_2372 as integer) as nqf_2372\r\n , cast(nqf_0034 as integer) as nqf_0034\r\n , cast(nqf_0059 as integer) as nqf_0059\r\n , cast(cqm_236 as integer) as cqm_236\r\n , cast(nqf_0053 as integer) as nqf_0053\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , nqf_2372\r\n , nqf_0034\r\n , nqf_0059\r\n , cqm_236\r\n , nqf_0053\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_wide.sql", "compiled": true, "compiled_code": "\n\n/*\n Each measure is pivoted into a boolean column by evaluating the\n denominator, numerator, and exclusion flags.\n*/\nwith measures_long as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , performance_flag\n , measure_id\n from dev_thuxuan.quality_measures.summary_long\n\n)\n\n, nqf_2372 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF2372'\n\n)\n, nqf_0034 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0034'\n\n)\n\n,nqf_0059 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0059'\n\n)\n\n, cqm_236 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'CQM236'\n\n)\n\n,nqf_0053 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0053'\n\n)\n\n, joined as (\n\n select\n measures_long.patient_id\n , nqf_2372.performance_flag as nqf_2372\n , nqf_0034.performance_flag as nqf_0034\n , nqf_0059.performance_flag as nqf_0059\n , cqm_236.performance_flag as cqm_236\n , nqf_0053.performance_flag as nqf_0053\n from measures_long\n left join nqf_2372\n on measures_long.patient_id = nqf_2372.patient_id\n left join nqf_0034\n on measures_long.patient_id = nqf_0034.patient_id\n left join nqf_0059\n on measures_long.patient_id = nqf_0059.patient_id\n left join cqm_236\n on measures_long.patient_id = cqm_236.patient_id\n left join nqf_0053\n on measures_long.patient_id = nqf_0053.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(nqf_2372 as integer) as nqf_2372\n , cast(nqf_0034 as integer) as nqf_0034\n , cast(nqf_0059 as integer) as nqf_0059\n , cast(cqm_236 as integer) as cqm_236\n , cast(nqf_0053 as integer) as nqf_0053\n from joined\n\n)\n\nselect\n patient_id\n , nqf_2372\n , nqf_0034\n , nqf_0059\n , cqm_236\n , nqf_0053\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_denominator"], "alias": "_int_cqm236_denominator", "checksum": {"name": "sha256", "checksum": "35c363a48eeabb6290b6a9b30e2954e6a8dffb8484751335056adf685aca0427"}, "config": {"enabled": true, "alias": "_int_cqm236_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of CQM 236, Controlling Blood Pressure\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2238708, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'office visit'\r\n , 'home healthcare services'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'annual wellness visit'\r\n , 'telephone visits'\r\n , 'emergency department evaluation and management visit'\r\n )\r\n\r\n), visits_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n from {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'outpatient'\r\n , 'nonacute inpatient'\r\n , 'encounter inpatient'\r\n , 'acute_inpatient'\r\n , 'emergency_department'\r\n )\r\n\r\n)\r\n\r\n, procedure_encounters as (\r\n\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n)\r\n\r\n, claims_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n, all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select\r\n patient_id\r\n , min(min_date) min_date\r\n , max(max_date) max_date\r\n , concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n\r\n)\r\n\r\n, hypertension_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'essential hypertension'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, hypertension_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join hypertension_codes\r\n on conditions.source_code_type = hypertension_codes.code_system\r\n and conditions.source_code = hypertension_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.patient_id\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.patient_id = e.patient_id\r\n where p.death_date is null\r\n\r\n)\r\n\r\n-- Patients 18-85 years of age who had a visit and diagnosis of essential hypertension starting before and continuing into, or starting during the first six months of the measurement period.\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n hypertension_conditions.patient_id\r\n , hypertension_conditions.recorded_date\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from hypertension_conditions\r\n left join patients_with_age\r\n on hypertension_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_cqm236__performance_period')}} pp\r\n where max_age >= 18 and min_age <= 85\r\n and hypertension_conditions.recorded_date between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )\r\n }}\r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )}}\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff", "macro.dbt.dateadd"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cqm236__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'office visit'\n , 'home healthcare services'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'annual wellness visit'\n , 'telephone visits'\n , 'emergency department evaluation and management visit'\n )\n\n), visits_encounters as (\n\n select \n patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n from __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n where lower(encounter_type) in (\n 'home health'\n , 'outpatient'\n , 'nonacute inpatient'\n , 'encounter inpatient'\n , 'acute_inpatient'\n , 'emergency_department'\n )\n\n)\n\n, procedure_encounters as (\n\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n)\n\n, claims_encounters as (\n\n select \n patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n, all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select\n patient_id\n , min(min_date) min_date\n , max(max_date) max_date\n , concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n\n)\n\n, hypertension_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'essential hypertension'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, hypertension_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join hypertension_codes\n on conditions.source_code_type = hypertension_codes.code_system\n and conditions.source_code = hypertension_codes.code\n\n)\n\n, patients_with_age as (\n select\n p.patient_id\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.patient_id = e.patient_id\n where p.death_date is null\n\n)\n\n-- Patients 18-85 years of age who had a visit and diagnosis of essential hypertension starting before and continuing into, or starting during the first six months of the measurement period.\n, qualifying_patients as (\n\n select\n distinct\n hypertension_conditions.patient_id\n , hypertension_conditions.recorded_date\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from hypertension_conditions\n left join patients_with_age\n on hypertension_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_cqm236__performance_period pp\n where max_age >= 18 and min_age <= 85\n and hypertension_conditions.recorded_date between\n \n\n dateadd(\n month,\n -12,\n performance_period_begin\n )\n\n\n and \n \n\n dateadd(\n month,\n 6,\n performance_period_begin\n )\n\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_exclude_procedures_observations", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_exclude_procedures_observations"], "alias": "_int_cqm236_exclude_procedures_observations", "checksum": {"name": "sha256", "checksum": "34e76bf84dae9a3549bc9535f5bebbeead7fcd169bb247db04487fdd6f3a6c94"}, "config": {"enabled": true, "alias": "_int_cqm236_exclude_procedures_observations", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with certain observations and procedures for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_exclude_procedures_observations", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2265518, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_exclude_procedures_observations", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_cqm236_denominator') }}\r\n\r\n)\r\n\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'dialysis services'\r\n , 'end stage renal disease'\r\n , 'esrd monthly outpatient services'\r\n , 'kidney transplant'\r\n , 'kidney transplant recipient'\r\n , 'pregnancy'\r\n )\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n, excluded_patients as (\r\n\r\n select\r\n exclusions_unioned.*\r\n , case\r\n when exclusion_reason = 'pregnancy' then 1\r\n else 0\r\n end as is_pregnant\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.age\r\n from exclusions_unioned\r\n inner join denominator\r\n on exclusions_unioned.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, exclusions_filtered as (\r\n\r\n select\r\n *\r\n from excluded_patients\r\n where is_pregnant = 1\r\n and exclusion_date between performance_period_begin and performance_period_end\r\n \r\n union all\r\n\r\n select\r\n *\r\n from excluded_patients\r\n where is_pregnant = 0\r\n and exclusion_date between performance_period_begin and performance_period_end\r\n or (exclusion_date between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"performance_period_begin\") }}\r\n and performance_period_end)\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , age\r\n , 'measure specific exclusion for observation procedure' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n exclusions_filtered", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'dialysis services'\n , 'end stage renal disease'\n , 'esrd monthly outpatient services'\n , 'kidney transplant'\n , 'kidney transplant recipient'\n , 'pregnancy'\n )\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, exclusions_unioned as (\n\n select\n patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select\n patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n, excluded_patients as (\n\n select\n exclusions_unioned.*\n , case\n when exclusion_reason = 'pregnancy' then 1\n else 0\n end as is_pregnant\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.age\n from exclusions_unioned\n inner join denominator\n on exclusions_unioned.patient_id = denominator.patient_id\n\n)\n\n, exclusions_filtered as (\n\n select\n *\n from excluded_patients\n where is_pregnant = 1\n and exclusion_date between performance_period_begin and performance_period_end\n \n union all\n\n select\n *\n from excluded_patients\n where is_pregnant = 0\n and exclusion_date between performance_period_begin and performance_period_end\n or (exclusion_date between \n\n dateadd(\n year,\n -1,\n performance_period_begin\n )\n\n\n and performance_period_end)\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , age\n , 'measure specific exclusion for observation procedure' as exclusion_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom\n exclusions_filtered", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_exclusions"], "alias": "_int_cqm236_exclusions", "checksum": {"name": "sha256", "checksum": "c762773bfd786926baa8db3ef90b0f6ca98cf1de636e0b8877a5cde26a78d432"}, "config": {"enabled": true, "alias": "_int_cqm236_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2305527, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_cqm236__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_cqm236__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , age\r\n from {{ref('quality_measures__int_cqm236_denominator')}}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, measure_specific_procedure_observation_exclusion as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n , age\r\n from {{ref('quality_measures__int_cqm236_exclude_procedures_observations')}}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select *\r\n from valid_advanced_illness_exclusions\r\n \r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select *\r\n from valid_institutional_snp\r\n\r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, frailty_exclusion_older_than_80 as (\r\n\r\n select\r\n frailty.patient_id\r\n , frailty.exclusion_date\r\n , frailty.exclusion_reason\r\n , 'measure specific exclusion for patients older than 80' as exclusion_type\r\n , denominator.age\r\n from frailty\r\n inner join denominator\r\n where frailty.patient_id = denominator.patient_id\r\n and denominator.age >= 81\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from combined_exclusions\r\n where exclusion_type != 'hospice_palliative'\r\n and age >= 66\r\n\r\n union all\r\n\r\n select * from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n union all\r\n\r\n select * from frailty_exclusion_older_than_80\r\n\r\n union all\r\n\r\n select * from measure_specific_procedure_observation_exclusion\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_exclude_procedures_observations", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, denominator as (\n\n select\n patient_id\n , age\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, measure_specific_procedure_observation_exclusion as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n , age\n from dev_thuxuan.quality_measures._int_cqm236_exclude_procedures_observations\n\n)\n\n, exclusions as (\n\n select *\n from valid_advanced_illness_exclusions\n \n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from valid_hospice_palliative\n\n union all\n\n select *\n from valid_institutional_snp\n\n union all\n\n select *\n from valid_dementia_exclusions\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, frailty_exclusion_older_than_80 as (\n\n select\n frailty.patient_id\n , frailty.exclusion_date\n , frailty.exclusion_reason\n , 'measure specific exclusion for patients older than 80' as exclusion_type\n , denominator.age\n from frailty\n inner join denominator\n where frailty.patient_id = denominator.patient_id\n and denominator.age >= 81\n\n)\n\n, valid_exclusions as (\n\n select * from combined_exclusions\n where exclusion_type != 'hospice_palliative'\n and age >= 66\n\n union all\n\n select * from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n union all\n\n select * from frailty_exclusion_older_than_80\n\n union all\n\n select * from measure_specific_procedure_observation_exclusion\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_long"], "alias": "_int_cqm236_long", "checksum": {"name": "sha256", "checksum": "5c5f52a7d958f3f50a705d29892f0500931f6f852346aedd2c00282c1cfeb61d"}, "config": {"enabled": true, "alias": "_int_cqm236_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of CQM 236,Controlling Blood Pressure before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.241245, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_cqm236_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n from {{ ref('quality_measures__int_cqm236_numerator') }}\r\n where numerator_flag = 1\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_cqm236_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.observation_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.observation_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , observation_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(observation_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_numerator", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , observation_date\n from dev_thuxuan.quality_measures._int_cqm236_numerator\n where numerator_flag = 1\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_cqm236_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.observation_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.observation_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , observation_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(observation_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_numerator"], "alias": "_int_cqm236_numerator", "checksum": {"name": "sha256", "checksum": "bcb5c041509c225e00cc829eb48839b78348f5340a14b3ad31a78e486ab36d94"}, "config": {"enabled": true, "alias": "_int_cqm236_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2352455, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select * from {{ref('quality_measures__int_cqm236_denominator')}}\r\n\r\n)\r\n\r\n, encounters as (\r\n\r\n select * from {{ref('quality_measures__stg_core__encounter')}}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select * from {{ref('quality_measures__stg_core__observation')}}\r\n where lower(normalized_description) in \r\n (\r\n 'systolic blood pressure'\r\n , 'diastolic blood pressure'\r\n )\r\n and normalized_code not in (\r\n '99473' -- Self-measured blood pressure using a device validated for clinical accuracy; patient education/training and device calibration\r\n , '99474' -- Separate self-measurements of two readings one minute apart, twice daily over a 30-day period (minimum of 12 readings), collection of data reported by the patient and/or caregiver to the physician or other qualified health care professional, with report of average systolic and diastolic pressures and subsequent communication of a treatment plan to the patient\r\n )\r\n\r\n)\r\n\r\n, observations_within_range as (\r\n\r\n select\r\n observations.*\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from observations\r\n inner join denominator\r\n on observations.patient_id = denominator.patient_id\r\n and observations.observation_date between \r\n denominator.performance_period_begin and denominator.performance_period_end\r\n\r\n)\r\n\r\n, observations_with_encounters as (\r\n\r\n select\r\n observations_within_range.*\r\n , case\r\n when lower(encounters.encounter_type) in (\r\n 'emergency department'\r\n ,'acute inpatient'\r\n )\r\n then 0\r\n else 1\r\n end as is_valid_encounter_observation\r\n from observations_within_range\r\n left join encounters\r\n on observations_within_range.patient_id = encounters.patient_id\r\n and observations_within_range.observation_date between \r\n encounters.encounter_start_date and encounters.encounter_end_date\r\n)\r\n\r\n, valid_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , cast(result as {{ dbt.type_float() }}) as bp_reading\r\n , normalized_description\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n from observations_with_encounters\r\n where is_valid_encounter_observation = 1\r\n\r\n)\r\n\r\n, systolic_bp_observations as (\r\n\r\n select\r\n *\r\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\r\n from valid_observations\r\n where lower(normalized_description) = 'systolic blood pressure'\r\n\r\n)\r\n\r\n, diastolic_bp_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading\r\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\r\n from valid_observations\r\n where lower(normalized_description) = 'diastolic blood pressure'\r\n\r\n)\r\n\r\n, least_recent_systolic_bp as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading as systolic_bp\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n from systolic_bp_observations\r\n where rn = 1\r\n\r\n)\r\n\r\n, least_recent_diastolic_bp as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading as diastolic_bp\r\n from diastolic_bp_observations\r\n where rn = 1\r\n\r\n)\r\n\r\n, patients_with_bp_readings as (\r\n\r\n select\r\n least_recent_systolic_bp.*\r\n , least_recent_diastolic_bp.diastolic_bp\r\n from least_recent_systolic_bp\r\n inner join least_recent_diastolic_bp\r\n on least_recent_systolic_bp.patient_id = least_recent_diastolic_bp.patient_id\r\n and least_recent_systolic_bp.observation_date = least_recent_diastolic_bp.observation_date\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n *\r\n , case\r\n when systolic_bp < 140.0 and diastolic_bp < 90.0\r\n then 1\r\n else 0\r\n end as numerator_flag\r\n from patients_with_bp_readings\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(observation_date as date) as observation_date\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , observation_date\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n),denominator as (\n\n select * from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n, encounters as (\n\n select * from __dbt__cte__quality_measures__stg_core__encounter\n\n)\n\n, observations as (\n\n select * from __dbt__cte__quality_measures__stg_core__observation\n where lower(normalized_description) in \n (\n 'systolic blood pressure'\n , 'diastolic blood pressure'\n )\n and normalized_code not in (\n '99473' -- Self-measured blood pressure using a device validated for clinical accuracy; patient education/training and device calibration\n , '99474' -- Separate self-measurements of two readings one minute apart, twice daily over a 30-day period (minimum of 12 readings), collection of data reported by the patient and/or caregiver to the physician or other qualified health care professional, with report of average systolic and diastolic pressures and subsequent communication of a treatment plan to the patient\n )\n\n)\n\n, observations_within_range as (\n\n select\n observations.*\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from observations\n inner join denominator\n on observations.patient_id = denominator.patient_id\n and observations.observation_date between \n denominator.performance_period_begin and denominator.performance_period_end\n\n)\n\n, observations_with_encounters as (\n\n select\n observations_within_range.*\n , case\n when lower(encounters.encounter_type) in (\n 'emergency department'\n ,'acute inpatient'\n )\n then 0\n else 1\n end as is_valid_encounter_observation\n from observations_within_range\n left join encounters\n on observations_within_range.patient_id = encounters.patient_id\n and observations_within_range.observation_date between \n encounters.encounter_start_date and encounters.encounter_end_date\n)\n\n, valid_observations as (\n\n select\n patient_id\n , observation_date\n , cast(result as FLOAT) as bp_reading\n , normalized_description\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n from observations_with_encounters\n where is_valid_encounter_observation = 1\n\n)\n\n, systolic_bp_observations as (\n\n select\n *\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\n from valid_observations\n where lower(normalized_description) = 'systolic blood pressure'\n\n)\n\n, diastolic_bp_observations as (\n\n select\n patient_id\n , observation_date\n , bp_reading\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\n from valid_observations\n where lower(normalized_description) = 'diastolic blood pressure'\n\n)\n\n, least_recent_systolic_bp as (\n\n select\n patient_id\n , observation_date\n , bp_reading as systolic_bp\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n from systolic_bp_observations\n where rn = 1\n\n)\n\n, least_recent_diastolic_bp as (\n\n select\n patient_id\n , observation_date\n , bp_reading as diastolic_bp\n from diastolic_bp_observations\n where rn = 1\n\n)\n\n, patients_with_bp_readings as (\n\n select\n least_recent_systolic_bp.*\n , least_recent_diastolic_bp.diastolic_bp\n from least_recent_systolic_bp\n inner join least_recent_diastolic_bp\n on least_recent_systolic_bp.patient_id = least_recent_diastolic_bp.patient_id\n and least_recent_systolic_bp.observation_date = least_recent_diastolic_bp.observation_date\n\n)\n\n, numerator as (\n\n select\n *\n , case\n when systolic_bp < 140.0 and diastolic_bp < 90.0\n then 1\n else 0\n end as numerator_flag\n from patients_with_bp_readings\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(observation_date as date) as observation_date\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , observation_date\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236__performance_period"], "alias": "_int_cqm236__performance_period", "checksum": {"name": "sha256", "checksum": "68c2780987fdd7d1e3c8024e4ba00995aa5212c4f38c7472b1376ded088f664e"}, "config": {"enabled": true, "alias": "_int_cqm236__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Controlling Blood Pressure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2189178, "relation_name": "dev_thuxuan.quality_measures._int_cqm236__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\nfrom period_begin", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\nfrom period_begin", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_denominator"], "alias": "_int_nqf0034_denominator", "checksum": {"name": "sha256", "checksum": "aebb6f9562d902ac8199c4fb1c6f14d8c766ae28ca1049d6c336443b704937c0"}, "config": {"enabled": true, "alias": "_int_nqf0034_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "min_age": {"name": "min_age", "description": "Patient's minumum age during encounter as of the performance_period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "max_age": {"name": "max_age", "description": "Patient's maximum age during encounter as of the performance_period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "qualifying_types": {"name": "qualifying_types", "description": "Indicative letter of patient's type of encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1726935, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR:\r\nPatients 45-75 years of age with a visit during the measurement period\r\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\r\nshould be used\r\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\r\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\r\nCQMs.\r\nDenominator Criteria (Eligible Cases):\r\nPatients 45 to 75 years of age on date of encounter\r\nAND\r\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\r\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\r\n99396*, 99397*, G0438, G0439\r\n*/\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n), visits_encounters as (\r\n select PATIENT_ID\r\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\r\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\r\n From {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\r\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\r\n where ENCOUNTER_TYPE in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n\r\n )\r\n\r\n,procedure_encounters as (\r\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n\r\n)\r\n,\r\nclaims_encounters as (\r\n select PATIENT_ID\r\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\r\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\r\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\r\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n,all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.PATIENT_ID\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8766.0) as min_age\r\n , max_date\r\n ,floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8766.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.PATIENT_ID = e.PATIENT_ID\r\n where p.BIRTH_DATE is not null\r\n\r\n)\r\n\r\nselect PATIENT_ID,\r\n min_age,\r\n max_age,\r\n qualifying_types\r\nFrom patients_with_age\r\nwhere max_age >= 45 and min_age <= 75", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR:\nPatients 45-75 years of age with a visit during the measurement period\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\nshould be used\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\nCQMs.\nDenominator Criteria (Eligible Cases):\nPatients 45 to 75 years of age on date of encounter\nAND\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\n99396*, 99397*, G0438, G0439\n*/\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n), visits_encounters as (\n select PATIENT_ID\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\n From __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\n where ENCOUNTER_TYPE in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n\n )\n\n,procedure_encounters as (\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n,\nclaims_encounters as (\n select PATIENT_ID\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp on\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n,all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, patients_with_age as (\n select\n p.PATIENT_ID\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8766.0) as min_age\n , max_date\n ,floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8766.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.PATIENT_ID = e.PATIENT_ID\n where p.BIRTH_DATE is not null\n\n)\n\nselect PATIENT_ID,\n min_age,\n max_age,\n qualifying_types\nFrom patients_with_age\nwhere max_age >= 45 and min_age <= 75", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_colectomy_cancer"], "alias": "_int_nqf0034_exclude_colectomy_cancer", "checksum": {"name": "sha256", "checksum": "a94f64137485d27a201b5279dfd8d3a76f83c98e84ea316999a3f4c3f3dfc8b9"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_colectomy_cancer", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_type": {"name": "exclusion_type", "description": "Measure specific exclusion for historical record of colectomy cancer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "desciption": "The date and timestamp of the dbt run."}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_colectomy_cancer", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1777065, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_exclude_colectomy_cancer", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR EXCLUSIONS:\r\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Malignant Neoplasm of Colon'\r\n , 'Total Colectomy'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'measure specific exclusion for historical record of colectomy cancer' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\n*/\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Malignant Neoplasm of Colon'\n , 'Total Colectomy'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'measure specific exclusion for historical record of colectomy cancer' as exclusion_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclusions"], "alias": "_int_nqf0034_exclusions", "checksum": {"name": "sha256", "checksum": "ef96b731ff607c92679f3b339841efe4f1beb12caa13e16ed9063889163b6631"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1812928, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0034__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0034__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , max_age as age\r\n from {{ref('quality_measures__int_nqf0034_denominator')}}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n and lower(exclusion_reason) in \r\n (\r\n 'palliative care encounter'\r\n , 'palliative care intervention'\r\n , 'hospice care ambulatory'\r\n , 'hospice encounter'\r\n )\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, measure_specific_colectomy_colorectal_cancer_exclusion as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_nqf0034_exclude_colectomy_cancer')}}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select *\r\n from valid_advanced_illness_exclusions\r\n \r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select *\r\n from valid_institutional_snp\r\n\r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from measure_specific_colectomy_colorectal_cancer_exclusion\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from combined_exclusions\r\n where exclusion_type not in (\r\n 'measure specific exclusion for historical record of colectomy cancer'\r\n , 'hospice_palliative'\r\n ) \r\n and age >= 66\r\n\r\n union all\r\n\r\n select * from combined_exclusions --age irrelvant exclusions\r\n where exclusion_type in (\r\n 'measure specific exclusion for historical record of colectomy cancer'\r\n , 'hospice_palliative'\r\n ) \r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, denominator as (\n\n select\n patient_id\n , max_age as age\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n and lower(exclusion_reason) in \n (\n 'palliative care encounter'\n , 'palliative care intervention'\n , 'hospice care ambulatory'\n , 'hospice encounter'\n )\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, measure_specific_colectomy_colorectal_cancer_exclusion as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_nqf0034_exclude_colectomy_cancer\n\n)\n\n, exclusions as (\n\n select *\n from valid_advanced_illness_exclusions\n \n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from valid_hospice_palliative\n\n union all\n\n select *\n from valid_institutional_snp\n\n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from measure_specific_colectomy_colorectal_cancer_exclusion\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select * from combined_exclusions\n where exclusion_type not in (\n 'measure specific exclusion for historical record of colectomy cancer'\n , 'hospice_palliative'\n ) \n and age >= 66\n\n union all\n\n select * from combined_exclusions --age irrelvant exclusions\n where exclusion_type in (\n 'measure specific exclusion for historical record of colectomy cancer'\n , 'hospice_palliative'\n ) \n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_long"], "alias": "_int_nqf0034_long", "checksum": {"name": "sha256", "checksum": "a8124cc5add3eda96e9d32673c8964315bd97df070397fa016e9b12c35044dd3"}, "config": {"enabled": true, "alias": "_int_nqf0034_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0034, Colorectal Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1874614, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n{%- set measure_id -%}\r\n(\r\n select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(\r\n\r\n select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(\r\n select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n from {{ ref('quality_measures__int_nqf0034_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0034_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , {{ measure_id }} as measure_id\r\n , {{ measure_name }} as measure_name\r\n , {{ measure_version }} as measure_version\r\n from patient\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_exclusions", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "compiled": true, "compiled_code": "/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n patient_id\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n from dev_thuxuan.quality_measures._int_nqf0034_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0034_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , pp.performance_period_begin\n , pp.performance_period_end\n , (\n select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n ) as measure_id\n , (\n\n select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_name\n , (\n select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_version\n from patient\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_numerator"], "alias": "_int_nqf0034_numerator", "checksum": {"name": "sha256", "checksum": "385aca17e9dd859c94c525cfa7ce49916944a11ae22ba5943ef3bce951edfbd6"}, "config": {"enabled": true, "alias": "_int_nqf0034_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0034, Colorectal Cancer Screening\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence": {"name": "evidence", "description": "Reason (usually the value set concept name) that includes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.190477, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n/*\r\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\r\nfollowing criteria:\r\n- Fecal occult blood test (FOBT) during the measurement period\r\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\r\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\r\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\r\nmeasurement period.\r\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\r\nmeasurement period.\r\n\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n, screening_codes as\r\n(\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Fecal Occult Blood Test (FOBT)' -- mp\r\n ,'Flexible Sigmoidoscopy' --mp+4\r\n ,'Colonoscopy' -- mp+9\r\n ,'CT Colonography' -- mp+4\r\n ,'sDNA FIT Test' -- mp+2\r\n )\r\n)\r\n, screening_periods as (\r\n select *,\r\n case concept_name\r\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\r\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\r\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\r\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\r\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\r\n else pp.performance_period_begin end as effective_performance_period_begin\r\n\r\n from screening_codes\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n )\r\n\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, labs as (\r\n select patient_id\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__lab_result')}}\r\n )\r\n\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\r\n , screening_codes.concept_name\r\n from medical_claim\r\n inner join screening_periods\r\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on medical_claim.hcpcs_code = screening_codes.code\r\n where screening_codes.code_system in ('hcpcs', 'cpt' )\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , screening_codes.concept_name\r\n from observations\r\n inner join screening_periods\r\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on observations.code = screening_codes.code\r\n and observations.code_type = screening_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , screening_codes.concept_name\r\n from procedures\r\n inner join screening_periods\r\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on procedures.code = screening_codes.code\r\n and procedures.code_type = screening_codes.code_system\r\n\r\n)\r\n\r\n,qualifying_labs as (\r\n select\r\n patient_id\r\n , coalesce(collection_date,result_date) as lab_date\r\n , screening_codes.concept_name\r\n from labs\r\n inner join screening_periods\r\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on ( labs.normalized_code = screening_codes.code\r\n and labs.normalized_code_type = screening_codes.code_system )\r\n or ( labs.source_code = screening_codes.code\r\n and labs.source_code_type = screening_codes.code_system )\r\n )\r\n\r\n,qualifying_events as (\r\n select\r\n patient_id\r\n , claim_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_claims\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , observation_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_observations\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , procedure_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_procedures\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , lab_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_labs\r\n\r\n )\r\n\r\nselect\r\n cast (qualifying_events.patient_id as {{ dbt.type_string() }}) patient_id\r\n ,cast( evidence_date as date) as evidence_date\r\n ,cast( evidence as {{ dbt.type_string() }}) as evidence\r\n\r\nfrom qualifying_events\r\ninner join denominator\r\n on qualifying_events.patient_id = denominator.patient_id", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "compiled": true, "compiled_code": "\n\n\n/*\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\nfollowing criteria:\n- Fecal occult blood test (FOBT) during the measurement period\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\nmeasurement period.\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\nmeasurement period.\n\n*/\n\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n),denominator as (\n\n select\n patient_id\n\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n, screening_codes as\n(\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Fecal Occult Blood Test (FOBT)' -- mp\n ,'Flexible Sigmoidoscopy' --mp+4\n ,'Colonoscopy' -- mp+9\n ,'CT Colonography' -- mp+4\n ,'sDNA FIT Test' -- mp+2\n )\n)\n, screening_periods as (\n select *,\n case concept_name\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\n else pp.performance_period_begin end as effective_performance_period_begin\n\n from screening_codes\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n )\n\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, labs as (\n select patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__lab_result\n )\n\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\n , screening_codes.concept_name\n from medical_claim\n inner join screening_periods\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on medical_claim.hcpcs_code = screening_codes.code\n where screening_codes.code_system in ('hcpcs', 'cpt' )\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n , screening_codes.concept_name\n from observations\n inner join screening_periods\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on observations.code = screening_codes.code\n and observations.code_type = screening_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , screening_codes.concept_name\n from procedures\n inner join screening_periods\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on procedures.code = screening_codes.code\n and procedures.code_type = screening_codes.code_system\n\n)\n\n,qualifying_labs as (\n select\n patient_id\n , coalesce(collection_date,result_date) as lab_date\n , screening_codes.concept_name\n from labs\n inner join screening_periods\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on ( labs.normalized_code = screening_codes.code\n and labs.normalized_code_type = screening_codes.code_system )\n or ( labs.source_code = screening_codes.code\n and labs.source_code_type = screening_codes.code_system )\n )\n\n,qualifying_events as (\n select\n patient_id\n , claim_date as evidence_date\n , concept_name as evidence\n from qualifying_claims\n\n union all\n\n select\n patient_id\n , observation_date as evidence_date\n , concept_name as evidence\n from qualifying_observations\n\n union all\n\n select\n patient_id\n , procedure_date as evidence_date\n , concept_name as evidence\n from qualifying_procedures\n\n union all\n\n select\n patient_id\n , lab_date as evidence_date\n , concept_name as evidence\n from qualifying_labs\n\n )\n\nselect\n cast (qualifying_events.patient_id as TEXT) patient_id\n ,cast( evidence_date as date) as evidence_date\n ,cast( evidence as TEXT) as evidence\n\nfrom qualifying_events\ninner join denominator\n on qualifying_events.patient_id = denominator.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "sql": " __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__performance_period"], "alias": "_int_nqf0034__performance_period", "checksum": {"name": "sha256", "checksum": "a49a0c6632579c310d621764621dc383b6acb81c7557c9ff38f701d58e5e8139"}, "config": {"enabled": true, "alias": "_int_nqf0034__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for NQF 0034 Colorectal Cancer screening.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1934583, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback periods for each type of test\r\n\r\n during the measurement period:\r\n - Fecal occult blood test (FOBT) during the measurement period\r\n\r\n during the measurement period or the two years prior:\r\n - Fecal immunochemical DNA test (FIT-DNA)\r\n\r\n during the measurement period or the four years prior:\r\n - Flexible sigmoidoscopy\r\n - Computed tomography (CT) colonography\r\n\r\n during the measurement period or the nine years prior:\r\n - Colonoscopy\r\n\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -2\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_1yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -3\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_2yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -5\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_4yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -10\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_9yp\r\n from period_begin\r\n\r\n)\r\n\r\nselect\r\n cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\r\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\r\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\r\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\r\nfrom period_lookback", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd"], "nodes": []}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "compiled": true, "compiled_code": "\n/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback periods for each type of test\n\n during the measurement period:\n - Fecal occult blood test (FOBT) during the measurement period\n\n during the measurement period or the two years prior:\n - Fecal immunochemical DNA test (FIT-DNA)\n\n during the measurement period or the four years prior:\n - Flexible sigmoidoscopy\n - Computed tomography (CT) colonography\n\n during the measurement period or the nine years prior:\n - Colonoscopy\n\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n year,\n -2,\n performance_period_end\n )\n\n as performance_period_begin_1yp\n , \n\n dateadd(\n year,\n -3,\n performance_period_end\n )\n\n as performance_period_begin_2yp\n , \n\n dateadd(\n year,\n -5,\n performance_period_end\n )\n\n as performance_period_begin_4yp\n , \n\n dateadd(\n year,\n -10,\n performance_period_end\n )\n\n as performance_period_begin_9yp\n from period_begin\n\n)\n\nselect\n cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_denominator"], "alias": "_int_nqf0053_denominator", "checksum": {"name": "sha256", "checksum": "e81a89fa14f3cb5ec74e73c174567370646130eb70b341eb629b572a55e86937"}, "config": {"enabled": true, "alias": "_int_nqf0053_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date of incident/fracture recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.24879, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }} as value_sets\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__stg_core__procedure')}}\r\n\r\n)\r\n\r\n, visits_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n , encounter_type\r\n from {{ref('quality_measures__stg_core__encounter')}} as encounter\r\n inner join {{ ref('quality_measures__int_nqf0053__performance_period') }} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n\r\n)\r\n\r\n, procedure_encounters as (\r\n\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0053__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n)\r\n\r\n, claims_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n , place_of_service_code\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0053__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n)\r\n\r\n, all_encounters as (\r\n\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n\r\n)\r\n\r\n, encounters_by_patient as (\r\n\r\n select\r\n patient_id\r\n , min(min_date) min_date\r\n , max(max_date) max_date\r\n , concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n\r\n)\r\n\r\n, bone_fracture_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) = 'fracture diagnoses'\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, bone_fracture_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join bone_fracture_codes\r\n on conditions.source_code_type = bone_fracture_codes.code_system\r\n and conditions.source_code = bone_fracture_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n\r\n select\r\n patient.patient_id\r\n , patient.sex\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} patient\r\n inner join encounters_by_patient e\r\n on patient.patient_id = e.patient_id\r\n where patient.death_date is null\r\n\r\n)\r\n\r\n, qualifying_patients_w_fractures as (\r\n\r\n select\r\n distinct\r\n bone_fracture_conditions.patient_id\r\n , bone_fracture_conditions.recorded_date\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from bone_fracture_conditions\r\n left join patients_with_age\r\n on bone_fracture_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_nqf0053__performance_period')}} pp\r\n where max_age >= 50 and min_age <= 85\r\n and bone_fracture_conditions.recorded_date between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )\r\n }}\r\n and\r\n pp.lookback_period_june\r\n and lower(patients_with_age.sex) = 'female'\r\n\r\n)\r\n\r\n, fracture_procedures as (\r\n\r\n select\r\n procedures.*\r\n from procedures\r\n inner join visit_codes\r\n on procedures.source_code = visit_codes.code\r\n and procedures.source_code_type = visit_codes.code_system\r\n inner join {{ ref('quality_measures__int_nqf0053__performance_period') }} as pp\r\n on procedures.procedure_date \r\n between pp.performance_period_begin and pp.performance_period_end\r\n where lower(visit_codes.concept_name) = 'fracture procedures'\r\n\r\n)\r\n\r\n, qualifying_patients_w_encounter as (\r\n\r\n select\r\n qualifying_patients_w_fractures.*\r\n from qualifying_patients_w_fractures\r\n inner join visits_encounters\r\n on qualifying_patients_w_fractures.patient_id = visits_encounters.patient_id\r\n where \r\n lower(visits_encounters.encounter_type) in (\r\n 'acute inpatient'\r\n , 'annual wellness visit'\r\n , 'emergency department visit'\r\n , 'emergency department'\r\n , 'home healthcare services'\r\n , 'office visit'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'emergency department evaluation and management visit'\r\n , 'outpatient'\r\n )\r\n)\r\n\r\n, qualifying_patients_w_procedure as (\r\n\r\n select\r\n qualifying_patients_w_fractures.*\r\n from qualifying_patients_w_fractures\r\n inner join fracture_procedures\r\n on qualifying_patients_w_fractures.patient_id = fracture_procedures.patient_id\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n qualifying_patients_w_encounter.*\r\n from qualifying_patients_w_encounter\r\n left join qualifying_patients_w_procedure\r\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\r\n left join claims_encounters\r\n on qualifying_patients_w_encounter.patient_id = claims_encounters.patient_id\r\n where (cast(claims_encounters.place_of_service_code as {{ dbt.type_string() }}) not in ('21')\r\n or claims_encounters.patient_id is null)\r\n\r\n union all\r\n\r\n select\r\n distinct\r\n qualifying_patients_w_procedure.*\r\n from qualifying_patients_w_procedure\r\n left join qualifying_patients_w_encounter\r\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\r\n where qualifying_patients_w_encounter.patient_id is null\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , recorded_date \r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff", "macro.dbt.dateadd"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes as value_sets\n\n)\n\n, procedures as (\n\n select\n *\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, visits_encounters as (\n\n select \n patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n , encounter_type\n from __dbt__cte__quality_measures__stg_core__encounter as encounter\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n\n)\n\n, procedure_encounters as (\n\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n)\n\n, claims_encounters as (\n\n select \n patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n)\n\n, all_encounters as (\n\n select\n patient_id\n , min_date\n , max_date\n , 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select\n patient_id\n , min_date\n , max_date\n , cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select\n patient_id\n , min_date\n , max_date\n , cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n\n)\n\n, encounters_by_patient as (\n\n select\n patient_id\n , min(min_date) min_date\n , max(max_date) max_date\n , concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n\n)\n\n, bone_fracture_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) = 'fracture diagnoses'\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, bone_fracture_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join bone_fracture_codes\n on conditions.source_code_type = bone_fracture_codes.code_system\n and conditions.source_code = bone_fracture_codes.code\n\n)\n\n, patients_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient patient\n inner join encounters_by_patient e\n on patient.patient_id = e.patient_id\n where patient.death_date is null\n\n)\n\n, qualifying_patients_w_fractures as (\n\n select\n distinct\n bone_fracture_conditions.patient_id\n , bone_fracture_conditions.recorded_date\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from bone_fracture_conditions\n left join patients_with_age\n on bone_fracture_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_nqf0053__performance_period pp\n where max_age >= 50 and min_age <= 85\n and bone_fracture_conditions.recorded_date between\n \n\n dateadd(\n month,\n -6,\n performance_period_begin\n )\n\n\n and\n pp.lookback_period_june\n and lower(patients_with_age.sex) = 'female'\n\n)\n\n, fracture_procedures as (\n\n select\n procedures.*\n from procedures\n inner join visit_codes\n on procedures.source_code = visit_codes.code\n and procedures.source_code_type = visit_codes.code_system\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on procedures.procedure_date \n between pp.performance_period_begin and pp.performance_period_end\n where lower(visit_codes.concept_name) = 'fracture procedures'\n\n)\n\n, qualifying_patients_w_encounter as (\n\n select\n qualifying_patients_w_fractures.*\n from qualifying_patients_w_fractures\n inner join visits_encounters\n on qualifying_patients_w_fractures.patient_id = visits_encounters.patient_id\n where \n lower(visits_encounters.encounter_type) in (\n 'acute inpatient'\n , 'annual wellness visit'\n , 'emergency department visit'\n , 'emergency department'\n , 'home healthcare services'\n , 'office visit'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'emergency department evaluation and management visit'\n , 'outpatient'\n )\n)\n\n, qualifying_patients_w_procedure as (\n\n select\n qualifying_patients_w_fractures.*\n from qualifying_patients_w_fractures\n inner join fracture_procedures\n on qualifying_patients_w_fractures.patient_id = fracture_procedures.patient_id\n\n)\n\n, qualifying_patients as (\n\n select\n distinct\n qualifying_patients_w_encounter.*\n from qualifying_patients_w_encounter\n left join qualifying_patients_w_procedure\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\n left join claims_encounters\n on qualifying_patients_w_encounter.patient_id = claims_encounters.patient_id\n where (cast(claims_encounters.place_of_service_code as TEXT) not in ('21')\n or claims_encounters.patient_id is null)\n\n union all\n\n select\n distinct\n qualifying_patients_w_procedure.*\n from qualifying_patients_w_procedure\n left join qualifying_patients_w_encounter\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\n where qualifying_patients_w_encounter.patient_id is null\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , recorded_date \n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_exclude_procedures_medications", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_exclude_procedures_medications"], "alias": "_int_nqf0053_exclude_procedures_medications", "checksum": {"name": "sha256", "checksum": "f79562d8f7cc595d84b6ba050bedc1e7d034a2e0f6574ad93c8b55b855f4910b"}, "config": {"enabled": true, "alias": "_int_nqf0053_exclude_procedures_medications", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with certain procedures and medicatons for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_type": {"name": "exclusion_type", "description": "measure specific exclusion for procedure medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "desciption": "The date and timestamp of the dbt run."}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_exclude_procedures_medications", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.262965, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_exclude_procedures_medications", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0053_denominator')}}\r\n\r\n)\r\n\r\n, value_sets as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets')}}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code\r\n , source_code_type\r\n from {{ ref('quality_measures__stg_core__procedure')}}\r\n\r\n)\r\n\r\n, pharmacy_claims as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , prescribing_date\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, bone_density_test_codes as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from value_sets\r\n where lower(concept_name) in (\r\n 'bone mineral density test'\r\n , 'bone mineral density tests cpt'\r\n , 'bone mineral density tests hcpcs'\r\n , 'bone mineral density tests icd10pcs'\r\n , 'dexa dual energy xray absorptiometry, bone density'\r\n )\r\n\r\n)\r\n\r\n, osteoporosis_medication_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) in \r\n ( \r\n 'osteoporosis medications for urology care'\r\n , 'osteoporosis medication'\r\n , 'bisphosphonates'\r\n )\r\n\r\n)\r\n\r\n, bone_density_test_procedures as (\r\n\r\n select\r\n procedures.*\r\n , bone_density_test_codes.concept_name\r\n from procedures\r\n inner join bone_density_test_codes\r\n on procedures.source_code = bone_density_test_codes.code\r\n and procedures.source_code_type = bone_density_test_codes.code_system\r\n\r\n)\r\n\r\n, osteoporosis_pharmacy_claims as (\r\n\r\n select\r\n pharmacy_claims.patient_id\r\n , pharmacy_claims.dispensing_date\r\n , pharmacy_claims.ndc_code\r\n , osteoporosis_medication_codes.concept_name\r\n from pharmacy_claims\r\n inner join osteoporosis_medication_codes\r\n on pharmacy_claims.ndc_code = osteoporosis_medication_codes.code\r\n and lower(osteoporosis_medication_codes.code_system) = 'ndc'\r\n \r\n)\r\n\r\n, osteoporosis_medications as (\r\n\r\n select\r\n medications.patient_id\r\n , medications.encounter_id\r\n , medications.prescribing_date\r\n , medications.dispensing_date\r\n , medications.source_code\r\n , medications.source_code_type\r\n , osteoporosis_medication_codes.concept_name\r\n from medications\r\n inner join osteoporosis_medication_codes\r\n on medications.source_code = osteoporosis_medication_codes.code\r\n and medications.source_code_type = osteoporosis_medication_codes.code_system\r\n\r\n)\r\n\r\n, valid_osteoporosis_medications_procedures as (\r\n\r\n select\r\n denominator.patient_id\r\n , osteoporosis_pharmacy_claims.concept_name as exclusion_reason\r\n , osteoporosis_pharmacy_claims.dispensing_date as exclusion_date\r\n from denominator\r\n inner join osteoporosis_pharmacy_claims\r\n on denominator.patient_id = osteoporosis_pharmacy_claims.patient_id\r\n where osteoporosis_pharmacy_claims.dispensing_date\r\n between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n \r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , osteoporosis_medications.concept_name as exclusion_reason\r\n , coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date) as exclusion_date\r\n from denominator\r\n inner join osteoporosis_medications\r\n on denominator.patient_id = osteoporosis_medications.patient_id\r\n and coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date)\r\n between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n\r\n)\r\n\r\n, valid_tests_performed as (\r\n\r\n select\r\n denominator.patient_id\r\n , bone_density_test_procedures.concept_name as exclusion_reason\r\n , procedure_date as exclusion_date\r\n from denominator\r\n inner join bone_density_test_procedures\r\n on denominator.patient_id = bone_density_test_procedures.patient_id\r\n where bone_density_test_procedures.procedure_date\r\n between \r\n {{ dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -2\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from valid_tests_performed\r\n\r\n union all\r\n\r\n select * from valid_osteoporosis_medications_procedures\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'measure specific exclusion for procedure medication' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n valid_exclusions", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n), __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, value_sets as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n\n)\n\n, procedures as (\n\n select\n patient_id\n , encounter_id\n , procedure_date\n , source_code\n , source_code_type\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, pharmacy_claims as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n, medications as (\n\n select\n patient_id\n , encounter_id\n , prescribing_date\n , dispensing_date\n , source_code\n , source_code_type\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, bone_density_test_codes as (\n\n select\n concept_name\n , code\n , code_system\n from value_sets\n where lower(concept_name) in (\n 'bone mineral density test'\n , 'bone mineral density tests cpt'\n , 'bone mineral density tests hcpcs'\n , 'bone mineral density tests icd10pcs'\n , 'dexa dual energy xray absorptiometry, bone density'\n )\n\n)\n\n, osteoporosis_medication_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) in \n ( \n 'osteoporosis medications for urology care'\n , 'osteoporosis medication'\n , 'bisphosphonates'\n )\n\n)\n\n, bone_density_test_procedures as (\n\n select\n procedures.*\n , bone_density_test_codes.concept_name\n from procedures\n inner join bone_density_test_codes\n on procedures.source_code = bone_density_test_codes.code\n and procedures.source_code_type = bone_density_test_codes.code_system\n\n)\n\n, osteoporosis_pharmacy_claims as (\n\n select\n pharmacy_claims.patient_id\n , pharmacy_claims.dispensing_date\n , pharmacy_claims.ndc_code\n , osteoporosis_medication_codes.concept_name\n from pharmacy_claims\n inner join osteoporosis_medication_codes\n on pharmacy_claims.ndc_code = osteoporosis_medication_codes.code\n and lower(osteoporosis_medication_codes.code_system) = 'ndc'\n \n)\n\n, osteoporosis_medications as (\n\n select\n medications.patient_id\n , medications.encounter_id\n , medications.prescribing_date\n , medications.dispensing_date\n , medications.source_code\n , medications.source_code_type\n , osteoporosis_medication_codes.concept_name\n from medications\n inner join osteoporosis_medication_codes\n on medications.source_code = osteoporosis_medication_codes.code\n and medications.source_code_type = osteoporosis_medication_codes.code_system\n\n)\n\n, valid_osteoporosis_medications_procedures as (\n\n select\n denominator.patient_id\n , osteoporosis_pharmacy_claims.concept_name as exclusion_reason\n , osteoporosis_pharmacy_claims.dispensing_date as exclusion_date\n from denominator\n inner join osteoporosis_pharmacy_claims\n on denominator.patient_id = osteoporosis_pharmacy_claims.patient_id\n where osteoporosis_pharmacy_claims.dispensing_date\n between\n \n\n dateadd(\n month,\n -12,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n \n union all\n\n select\n denominator.patient_id\n , osteoporosis_medications.concept_name as exclusion_reason\n , coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date) as exclusion_date\n from denominator\n inner join osteoporosis_medications\n on denominator.patient_id = osteoporosis_medications.patient_id\n and coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date)\n between\n \n\n dateadd(\n month,\n -12,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n\n)\n\n, valid_tests_performed as (\n\n select\n denominator.patient_id\n , bone_density_test_procedures.concept_name as exclusion_reason\n , procedure_date as exclusion_date\n from denominator\n inner join bone_density_test_procedures\n on denominator.patient_id = bone_density_test_procedures.patient_id\n where bone_density_test_procedures.procedure_date\n between \n \n\n dateadd(\n year,\n -2,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n\n)\n\n, valid_exclusions as (\n\n select * from valid_tests_performed\n\n union all\n\n select * from valid_osteoporosis_medications_procedures\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'measure specific exclusion for procedure medication' as exclusion_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom\n valid_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_exclusions"], "alias": "_int_nqf0053_exclusions", "checksum": {"name": "sha256", "checksum": "ae6cb2b387cbad852c1c8c5725fc3ab386523e87281a93ebb68a4e0bd97ad84b"}, "config": {"enabled": true, "alias": "_int_nqf0053_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.258965, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set lookback_period_december -%}\r\n(\r\n select \r\n lookback_period_december\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, frailty_within_defined_window as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = performance_period_begin\r\n ) \r\n }}\r\n and {{ lookback_period_december }}\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, exclusion_procedure_and_medication as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_nqf0053_exclude_procedures_medications')}}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between \r\n {{dbt.dateadd(\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = performance_period_begin\r\n ) \r\n }}\r\n \r\n and {{ lookback_period_december }}\r\n\r\n)\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, frailty_patients_within_defined_window as (\r\n\r\n select\r\n frailty_within_defined_window.patient_id\r\n , frailty_within_defined_window.exclusion_date\r\n , frailty_within_defined_window.exclusion_reason\r\n , 'measure specific exclusion for defined window' as exclusion_type\r\n from frailty_within_defined_window\r\n \r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n\r\n union all\r\n\r\n select * from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select * from valid_institutional_snp\r\n\r\n union all\r\n\r\n select * from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select * from exclusion_procedure_and_medication\r\n\r\n union all\r\n\r\n select * from frailty_patients_within_defined_window\r\n\r\n)\r\n\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ref('quality_measures__int_nqf0053_denominator')}} as denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select \r\n * \r\n from combined_exclusions\r\n where exclusion_type = 'institutional_snp'\r\n and age >= 66\r\n\r\n union all \r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type in\r\n (\r\n 'advanced_illness'\r\n , 'dementia'\r\n ) \r\n and age between 66 and 80\r\n\r\n union all \r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type = 'measure specific exclusion for defined window'\r\n and age >= 81\r\n\r\n union all\r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type in\r\n (\r\n 'measure specific exclusion for procedure medication'\r\n , 'hospice_palliative'\r\n )\r\n\r\n)\r\n\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_exclude_procedures_medications", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0053_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, frailty_within_defined_window as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between \n \n\n dateadd(\n month,\n -6,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n lookback_period_december\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, exclusion_procedure_and_medication as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_nqf0053_exclude_procedures_medications\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between \n \n\n dateadd(\n month,\n -6,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n \n and (\n select \n lookback_period_december\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n)\n\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, frailty_patients_within_defined_window as (\n\n select\n frailty_within_defined_window.patient_id\n , frailty_within_defined_window.exclusion_date\n , frailty_within_defined_window.exclusion_reason\n , 'measure specific exclusion for defined window' as exclusion_type\n from frailty_within_defined_window\n \n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n\n union all\n\n select * from valid_dementia_exclusions\n\n union all\n\n select * from valid_institutional_snp\n\n union all\n\n select * from valid_hospice_palliative\n\n union all\n\n select * from exclusion_procedure_and_medication\n\n union all\n\n select * from frailty_patients_within_defined_window\n\n)\n\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf0053_denominator as denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select \n * \n from combined_exclusions\n where exclusion_type = 'institutional_snp'\n and age >= 66\n\n union all \n\n select \n *\n from combined_exclusions\n where exclusion_type in\n (\n 'advanced_illness'\n , 'dementia'\n ) \n and age between 66 and 80\n\n union all \n\n select \n *\n from combined_exclusions\n where exclusion_type = 'measure specific exclusion for defined window'\n and age >= 81\n\n union all\n\n select \n *\n from combined_exclusions\n where exclusion_type in\n (\n 'measure specific exclusion for procedure medication'\n , 'hospice_palliative'\n )\n\n)\n\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_long"], "alias": "_int_nqf0053_long", "checksum": {"name": "sha256", "checksum": "d73d2adf3a09493ecca5d251b73cc07390411eb8b5d2aefe9426391a0f84de67"}, "config": {"enabled": true, "alias": "_int_nqf0053_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2696598, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_nqf0053_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from {{ ref('quality_measures__int_nqf0053_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0053_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , numerator.evidence_value\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.evidence_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n , evidence_value\n from dev_thuxuan.quality_measures._int_nqf0053_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0053_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , numerator.evidence_value\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.evidence_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_numerator"], "alias": "_int_nqf0053_numerator", "checksum": {"name": "sha256", "checksum": "2a91742dc89b7cd7dfd6d571da88ba7ed7b1a90ce8f18be9860ce53a40343276"}, "config": {"enabled": true, "alias": "_int_nqf0053_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.254961, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select \r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , recorded_date\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ref('quality_measures__int_nqf0053_denominator')}}\r\n\r\n)\r\n\r\n, value_sets as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n \r\n)\r\n\r\n, osteo_procedure_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) in (\r\n 'bone mineral density test'\r\n , 'bone mineral density tests cpt'\r\n , 'bone mineral density tests icd10pcs'\r\n , 'bone mineral density tests hcpcs'\r\n , 'dexa dual energy xray absorptiometry, bone density'\r\n , 'central dual energy x-ray absorptiometry (dxa)'\r\n , 'spinal densitometry x-ray' \r\n , 'ultrasonography for densitometry' \r\n , 'ct bone density axial'\r\n , 'peripheral dual-energy x-ray absorptiometry (dxa)'\r\n , 'osteoporosis medication'\r\n )\r\n\r\n)\r\n\r\n, procedures_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n from {{ref('quality_measures__stg_core__procedure')}} as procs\r\n inner join osteo_procedure_codes\r\n on procs.source_code = osteo_procedure_codes.code\r\n and procs.source_code_type = osteo_procedure_codes.code_system\r\n\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures_osteo_related.patient_id\r\n , procedures_osteo_related.procedure_date\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.recorded_date\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from procedures_osteo_related\r\n inner join denominator\r\n on procedures_osteo_related.patient_id = denominator.patient_id\r\n and \r\n procedures_osteo_related.procedure_date between\r\n denominator.recorded_date \r\n and\r\n {{dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator.recorded_date\"\r\n )\r\n }} \r\n\r\n)\r\n\r\n, denominator_patients_disqualified_from_procedure as (\r\n \r\n select \r\n denominator.patient_id\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.recorded_date\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end \r\n from denominator\r\n left join qualifying_procedures \r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n where qualifying_procedures.patient_id is null\r\n\r\n)\r\n\r\n-- pharmacy_claim begin\r\n\r\n, osteo_rx_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) \r\n in \r\n ( \r\n 'osteoporosis medications for urology care'\r\n , 'osteoporosis medication'\r\n , 'bisphosphonates'\r\n )\r\n\r\n)\r\n\r\n, pharmacy_claims_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code \r\n from {{ref('quality_measures__stg_pharmacy_claim')}} as pharmacy_claims\r\n inner join osteo_rx_codes\r\n on pharmacy_claims.ndc_code = osteo_rx_codes.code\r\n and lower(osteo_rx_codes.code_system) = 'ndc'\r\n\r\n)\r\n\r\n, qualifying_pharmacy_claims as (\r\n\r\n select \r\n pharmacy_claims_osteo_related.patient_id\r\n , pharmacy_claims_osteo_related.dispensing_date\r\n , pharmacy_claims_osteo_related.ndc_code\r\n , denominator_patients_disqualified_from_procedure.measure_id\r\n , denominator_patients_disqualified_from_procedure.measure_name\r\n , denominator_patients_disqualified_from_procedure.measure_version\r\n , denominator_patients_disqualified_from_procedure.recorded_date\r\n , denominator_patients_disqualified_from_procedure.performance_period_begin\r\n , denominator_patients_disqualified_from_procedure.performance_period_end\r\n from pharmacy_claims_osteo_related\r\n inner join denominator_patients_disqualified_from_procedure\r\n on pharmacy_claims_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\r\n and pharmacy_claims_osteo_related.dispensing_date \r\n between \r\n denominator_patients_disqualified_from_procedure.recorded_date \r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator_patients_disqualified_from_procedure.recorded_date\"\r\n )\r\n }}\r\n)\r\n\r\n-- medication begin\r\n\r\n, medication_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , prescribing_date\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ref('quality_measures__stg_core__medication')}} as medications\r\n inner join osteo_rx_codes\r\n on medications.source_code = osteo_rx_codes.code\r\n and medications.source_code_type = osteo_rx_codes.code_system\r\n\r\n)\r\n\r\n, qualifying_medications as (\r\n\r\n select\r\n medication_osteo_related.patient_id\r\n , medication_osteo_related.encounter_id\r\n , denominator_patients_disqualified_from_procedure.measure_id\r\n , denominator_patients_disqualified_from_procedure.measure_name\r\n , denominator_patients_disqualified_from_procedure.measure_version\r\n , denominator_patients_disqualified_from_procedure.recorded_date\r\n , denominator_patients_disqualified_from_procedure.performance_period_begin\r\n , denominator_patients_disqualified_from_procedure.performance_period_end\r\n from medication_osteo_related\r\n inner join denominator_patients_disqualified_from_procedure\r\n on medication_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\r\n and coalesce(medication_osteo_related.prescribing_date, medication_osteo_related.dispensing_date) between \r\n denominator_patients_disqualified_from_procedure.recorded_date \r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator_patients_disqualified_from_procedure.recorded_date\"\r\n )\r\n }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n qualifying_procedures.patient_id\r\n , qualifying_procedures.performance_period_begin\r\n , qualifying_procedures.performance_period_end\r\n , qualifying_procedures.measure_id\r\n , qualifying_procedures.measure_name\r\n , qualifying_procedures.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_procedures\r\n\r\n union all\r\n\r\n select \r\n qualifying_pharmacy_claims.patient_id\r\n , qualifying_pharmacy_claims.performance_period_begin\r\n , qualifying_pharmacy_claims.performance_period_end\r\n , qualifying_pharmacy_claims.measure_id\r\n , qualifying_pharmacy_claims.measure_name\r\n , qualifying_pharmacy_claims.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_pharmacy_claims\r\n\r\n union all\r\n\r\n select \r\n qualifying_medications.patient_id\r\n , qualifying_medications.performance_period_begin\r\n , qualifying_medications.performance_period_end\r\n , qualifying_medications.measure_id\r\n , qualifying_medications.measure_name\r\n , qualifying_medications.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_medications\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n), __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n),denominator as (\n\n select \n patient_id\n , performance_period_begin\n , performance_period_end\n , recorded_date\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, value_sets as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n \n)\n\n, osteo_procedure_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) in (\n 'bone mineral density test'\n , 'bone mineral density tests cpt'\n , 'bone mineral density tests icd10pcs'\n , 'bone mineral density tests hcpcs'\n , 'dexa dual energy xray absorptiometry, bone density'\n , 'central dual energy x-ray absorptiometry (dxa)'\n , 'spinal densitometry x-ray' \n , 'ultrasonography for densitometry' \n , 'ct bone density axial'\n , 'peripheral dual-energy x-ray absorptiometry (dxa)'\n , 'osteoporosis medication'\n )\n\n)\n\n, procedures_osteo_related as (\n\n select\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n from __dbt__cte__quality_measures__stg_core__procedure as procs\n inner join osteo_procedure_codes\n on procs.source_code = osteo_procedure_codes.code\n and procs.source_code_type = osteo_procedure_codes.code_system\n\n)\n\n, qualifying_procedures as (\n\n select\n procedures_osteo_related.patient_id\n , procedures_osteo_related.procedure_date\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.recorded_date\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from procedures_osteo_related\n inner join denominator\n on procedures_osteo_related.patient_id = denominator.patient_id\n and \n procedures_osteo_related.procedure_date between\n denominator.recorded_date \n and\n \n\n dateadd(\n month,\n 6,\n denominator.recorded_date\n )\n\n \n\n)\n\n, denominator_patients_disqualified_from_procedure as (\n \n select \n denominator.patient_id\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.recorded_date\n , denominator.performance_period_begin\n , denominator.performance_period_end \n from denominator\n left join qualifying_procedures \n on denominator.patient_id = qualifying_procedures.patient_id\n where qualifying_procedures.patient_id is null\n\n)\n\n-- pharmacy_claim begin\n\n, osteo_rx_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) \n in \n ( \n 'osteoporosis medications for urology care'\n , 'osteoporosis medication'\n , 'bisphosphonates'\n )\n\n)\n\n, pharmacy_claims_osteo_related as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code \n from __dbt__cte__quality_measures__stg_pharmacy_claim as pharmacy_claims\n inner join osteo_rx_codes\n on pharmacy_claims.ndc_code = osteo_rx_codes.code\n and lower(osteo_rx_codes.code_system) = 'ndc'\n\n)\n\n, qualifying_pharmacy_claims as (\n\n select \n pharmacy_claims_osteo_related.patient_id\n , pharmacy_claims_osteo_related.dispensing_date\n , pharmacy_claims_osteo_related.ndc_code\n , denominator_patients_disqualified_from_procedure.measure_id\n , denominator_patients_disqualified_from_procedure.measure_name\n , denominator_patients_disqualified_from_procedure.measure_version\n , denominator_patients_disqualified_from_procedure.recorded_date\n , denominator_patients_disqualified_from_procedure.performance_period_begin\n , denominator_patients_disqualified_from_procedure.performance_period_end\n from pharmacy_claims_osteo_related\n inner join denominator_patients_disqualified_from_procedure\n on pharmacy_claims_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\n and pharmacy_claims_osteo_related.dispensing_date \n between \n denominator_patients_disqualified_from_procedure.recorded_date \n and \n \n\n dateadd(\n month,\n 6,\n denominator_patients_disqualified_from_procedure.recorded_date\n )\n\n\n)\n\n-- medication begin\n\n, medication_osteo_related as (\n\n select\n patient_id\n , encounter_id\n , prescribing_date\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication as medications\n inner join osteo_rx_codes\n on medications.source_code = osteo_rx_codes.code\n and medications.source_code_type = osteo_rx_codes.code_system\n\n)\n\n, qualifying_medications as (\n\n select\n medication_osteo_related.patient_id\n , medication_osteo_related.encounter_id\n , denominator_patients_disqualified_from_procedure.measure_id\n , denominator_patients_disqualified_from_procedure.measure_name\n , denominator_patients_disqualified_from_procedure.measure_version\n , denominator_patients_disqualified_from_procedure.recorded_date\n , denominator_patients_disqualified_from_procedure.performance_period_begin\n , denominator_patients_disqualified_from_procedure.performance_period_end\n from medication_osteo_related\n inner join denominator_patients_disqualified_from_procedure\n on medication_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\n and coalesce(medication_osteo_related.prescribing_date, medication_osteo_related.dispensing_date) between \n denominator_patients_disqualified_from_procedure.recorded_date \n and \n \n\n dateadd(\n month,\n 6,\n denominator_patients_disqualified_from_procedure.recorded_date\n )\n\n\n\n)\n\n, numerator as (\n\n select\n qualifying_procedures.patient_id\n , qualifying_procedures.performance_period_begin\n , qualifying_procedures.performance_period_end\n , qualifying_procedures.measure_id\n , qualifying_procedures.measure_name\n , qualifying_procedures.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_procedures\n\n union all\n\n select \n qualifying_pharmacy_claims.patient_id\n , qualifying_pharmacy_claims.performance_period_begin\n , qualifying_pharmacy_claims.performance_period_end\n , qualifying_pharmacy_claims.measure_id\n , qualifying_pharmacy_claims.measure_name\n , qualifying_pharmacy_claims.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_pharmacy_claims\n\n union all\n\n select \n qualifying_medications.patient_id\n , qualifying_medications.performance_period_begin\n , qualifying_medications.performance_period_end\n , qualifying_medications.measure_id\n , qualifying_medications.measure_name\n , qualifying_medications.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_medications\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(null as TEXT) as evidence_value\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053__performance_period"], "alias": "_int_nqf0053__performance_period", "checksum": {"name": "sha256", "checksum": "226bc6043c33ce7ef5a214d868efbf57f67b6e9f5111389563bd6291d2b7ef25"}, "config": {"enabled": true, "alias": "_int_nqf0053__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Osteoporosis Management in women who had a fracture\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.244254, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n-- lookback_period for last june 30 and december 31\r\n, lookback_period as (\r\n\r\n select\r\n *\r\n , case\r\n when performance_period_end >= cast(extract(year from performance_period_end) || '-06-30' as date)\r\n then extract(year from performance_period_end) || '-06-30'\r\n else extract(year from performance_period_begin) || '-06-30'\r\n end as lookback_period_june\r\n , case\r\n when performance_period_end >= cast(extract(year from performance_period_end) || '-12-31' as date)\r\n then extract(year from performance_period_end) || '-12-31'\r\n else extract(year from performance_period_begin) || '-12-31'\r\n end as lookback_period_december\r\n from period_begin\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(lookback_period_june as date) as lookback_period_june\r\n , cast(lookback_period_december as date) as lookback_period_december\r\nfrom lookback_period", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n-- lookback_period for last june 30 and december 31\n, lookback_period as (\n\n select\n *\n , case\n when performance_period_end >= cast(extract(year from performance_period_end) || '-06-30' as date)\n then extract(year from performance_period_end) || '-06-30'\n else extract(year from performance_period_begin) || '-06-30'\n end as lookback_period_june\n , case\n when performance_period_end >= cast(extract(year from performance_period_end) || '-12-31' as date)\n then extract(year from performance_period_end) || '-12-31'\n else extract(year from performance_period_begin) || '-12-31'\n end as lookback_period_december\n from period_begin\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(lookback_period_june as date) as lookback_period_june\n , cast(lookback_period_december as date) as lookback_period_december\nfrom lookback_period", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_denominator"], "alias": "_int_nqf0059_denominator", "checksum": {"name": "sha256", "checksum": "b5a8f0b765120b741709f2e154e009d93e9b3e8340689ac8bea8c2c3e084bab0"}, "config": {"enabled": true, "alias": "_int_nqf0059_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.20121, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'office visit'\r\n , 'home healthcare services'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'annual wellness visit'\r\n , 'telephone visits'\r\n , 'nutrition services'\r\n )\r\n\r\n), visits_encounters as (\r\n select patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n from {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n)\r\n\r\n, procedure_encounters as (\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n\r\n)\r\n, claims_encounters as (\r\n select patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n, all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n)\r\n\r\n, diabetics_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'diabetes'\r\n , 'hba1c laboratory test'\r\n )\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, diabetic_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join diabetics_codes\r\n on conditions.source_code_type = diabetics_codes.code_system\r\n and conditions.source_code = diabetics_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.patient_id\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.patient_id = e.patient_id\r\n where p.death_date is null\r\n\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n diabetic_conditions.patient_id\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from diabetic_conditions\r\n left join patients_with_age\r\n on diabetic_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_nqf0059__performance_period')}} pp\r\n where max_age >= 18 and min_age <= 75\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'office visit'\n , 'home healthcare services'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'annual wellness visit'\n , 'telephone visits'\n , 'nutrition services'\n )\n\n), visits_encounters as (\n select patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n from __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n)\n\n, procedure_encounters as (\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n, claims_encounters as (\n select patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n, all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, diabetics_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'diabetes'\n , 'hba1c laboratory test'\n )\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, diabetic_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join diabetics_codes\n on conditions.source_code_type = diabetics_codes.code_system\n and conditions.source_code = diabetics_codes.code\n\n)\n\n, patients_with_age as (\n select\n p.patient_id\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.patient_id = e.patient_id\n where p.death_date is null\n\n\n)\n\n, qualifying_patients as (\n\n select\n distinct\n diabetic_conditions.patient_id\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from diabetic_conditions\n left join patients_with_age\n on diabetic_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_nqf0059__performance_period pp\n where max_age >= 18 and min_age <= 75\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_exclusions"], "alias": "_int_nqf0059_exclusions", "checksum": {"name": "sha256", "checksum": "ea896de807aed1b1ef46709b24cf36e6affcbcfcda625f4649e713919ce46b59"}, "config": {"enabled": true, "alias": "_int_nqf0059_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2051885, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0059__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0059__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n union all\r\n select * from valid_dementia_exclusions\r\n union all\r\n select * from valid_hospice_palliative\r\n union all\r\n select * from valid_institutional_snp\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ref('quality_measures__int_nqf0059_denominator')}} as denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type != 'hospice_palliative'\r\n and age >= 66\r\n\r\n union all\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0059_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n union all\n select * from valid_dementia_exclusions\n union all\n select * from valid_hospice_palliative\n union all\n select * from valid_institutional_snp\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf0059_denominator as denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select\n *\n from combined_exclusions\n where exclusion_type != 'hospice_palliative'\n and age >= 66\n\n union all\n\n select\n *\n from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_long"], "alias": "_int_nqf0059_long", "checksum": {"name": "sha256", "checksum": "25867f22966d541962e4704268fe7d215780b6bf1d97feb83572c0e08531f49d"}, "config": {"enabled": true, "alias": "_int_nqf0059_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0059,Diabetes Hemoglobin a1c before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2111964, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_nqf0059_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from {{ ref('quality_measures__int_nqf0059_numerator') }}\r\n where numerator_flag = 1\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0059_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , numerator.evidence_value\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.evidence_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_nqf0059_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n , evidence_value\n from dev_thuxuan.quality_measures._int_nqf0059_numerator\n where numerator_flag = 1\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0059_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , numerator.evidence_value\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.evidence_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_numerator"], "alias": "_int_nqf0059_numerator", "checksum": {"name": "sha256", "checksum": "186bed0fb07ed03dd664664310073a784d25b81b7712cbc5226c62eb0ed9f326"}, "config": {"enabled": true, "alias": "_int_nqf0059_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2157938, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf0059_denominator') }}\r\n\r\n)\r\n\r\n, hba1c_test_code as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'hba1c laboratory test'\r\n )\r\n)\r\n\r\n, labs as (\r\n select\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__lab_result')}}\r\n\r\n)\r\n\r\n, qualifying_labs as (\r\n select\r\n labs.patient_id\r\n , labs.result as evidence_value\r\n , coalesce(collection_date,result_date) as evidence_date\r\n , hba1c_test_code.concept_name\r\n , row_number() over(partition by labs.patient_id order by coalesce(collection_date,result_date) desc) as rn\r\n from labs\r\n inner join hba1c_test_code\r\n on ( labs.normalized_code = hba1c_test_code.code\r\n and labs.normalized_code_type = hba1c_test_code.code_system )\r\n or ( labs.source_code = hba1c_test_code.code\r\n and labs.source_code_type = hba1c_test_code.code_system )\r\n left join denominator\r\n on labs.patient_id = denominator.patient_id\r\n where coalesce(collection_date,result_date) <= denominator.performance_period_end\r\n and {{ apply_regex('labs.result', '[+-]?([0-9]*[.])?[0-9]+') }}\r\n\r\n)\r\n\r\n, recent_readings as (\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from qualifying_labs\r\n where rn = 1 \r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n denominator.*\r\n , recent_readings.evidence_date\r\n , recent_readings.evidence_value\r\n from denominator\r\n left join recent_readings\r\n on denominator.patient_id = recent_readings.patient_id\r\n\r\n)\r\n\r\n, test_not_performed as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , 1 as numerator_flag\r\n from qualifying_patients\r\n where \r\n (evidence_date not between performance_period_begin and performance_period_end)\r\n or evidence_date is null\r\n\r\n)\r\n\r\n, valid_patients as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , case\r\n when cast(evidence_value as {{ dbt.type_numeric() }}) > 9.0 then 1\r\n else 0\r\n end as numerator_flag\r\n from qualifying_patients\r\n where evidence_date between performance_period_begin and performance_period_end\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select * from valid_patients\r\n\r\n union all\r\n \r\n select * from test_not_performed\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.apply_regex", "macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf0059_denominator\n\n)\n\n, hba1c_test_code as (\n\n select\n code\n , code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'hba1c laboratory test'\n )\n)\n\n, labs as (\n select\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__lab_result\n\n)\n\n, qualifying_labs as (\n select\n labs.patient_id\n , labs.result as evidence_value\n , coalesce(collection_date,result_date) as evidence_date\n , hba1c_test_code.concept_name\n , row_number() over(partition by labs.patient_id order by coalesce(collection_date,result_date) desc) as rn\n from labs\n inner join hba1c_test_code\n on ( labs.normalized_code = hba1c_test_code.code\n and labs.normalized_code_type = hba1c_test_code.code_system )\n or ( labs.source_code = hba1c_test_code.code\n and labs.source_code_type = hba1c_test_code.code_system )\n left join denominator\n on labs.patient_id = denominator.patient_id\n where coalesce(collection_date,result_date) <= denominator.performance_period_end\n and regexp_like(labs.result, '[+-]?([0-9]*[.])?[0-9]+')\n\n)\n\n, recent_readings as (\n select\n patient_id\n , evidence_date\n , evidence_value\n from qualifying_labs\n where rn = 1 \n\n)\n\n, qualifying_patients as (\n\n select\n denominator.*\n , recent_readings.evidence_date\n , recent_readings.evidence_value\n from denominator\n left join recent_readings\n on denominator.patient_id = recent_readings.patient_id\n\n)\n\n, test_not_performed as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , 1 as numerator_flag\n from qualifying_patients\n where \n (evidence_date not between performance_period_begin and performance_period_end)\n or evidence_date is null\n\n)\n\n, valid_patients as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , case\n when cast(evidence_value as numeric(28,6)) > 9.0 then 1\n else 0\n end as numerator_flag\n from qualifying_patients\n where evidence_date between performance_period_begin and performance_period_end\n\n)\n\n, numerator as (\n\n select * from valid_patients\n\n union all\n \n select * from test_not_performed\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "sql": " __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059__performance_period"], "alias": "_int_nqf0059__performance_period", "checksum": {"name": "sha256", "checksum": "f13d1c4bf53ca57e3a1841574bb22dcef8a630be9a41d57290d3f6981797c0a0"}, "config": {"enabled": true, "alias": "_int_nqf0059__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Diabetes Hemoglobin a1c.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1964998, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r | as_bool\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\nfrom period_begin", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\nfrom period_begin", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_denominator"], "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "d1a48f8615fd3b0caaedf65765014ea72f327aabb4223538f229693b664cb6fc"}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_lookback": {"name": "performance_period_lookback", "description": "Lookback period of NQF2372.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1509876, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith performance_period as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_end\r\n , performance_period_begin\r\n , performance_period_lookback\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n\r\n, patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n from {{ ref('quality_measures__stg_core__encounter') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n)\r\n\r\n, patient_with_age as (\r\n\r\n select\r\n patient.patient_id\r\n , patient.sex\r\n , patient.birth_date\r\n , patient.death_date\r\n , performance_period.measure_id\r\n , performance_period.measure_name\r\n , performance_period.measure_version\r\n , performance_period.performance_period_begin\r\n , performance_period.performance_period_end\r\n , performance_period.performance_period_lookback\r\n , floor({{ datediff('patient.birth_date', 'performance_period.performance_period_end', 'hour') }} / 8766.0) as age\r\n from patient\r\n cross join performance_period\r\n\r\n)\r\n\r\n/*\r\n Filter patient to living women 51 - 74 years of age\r\n at the beginning of the measurement period\r\n*/\r\n, patient_filtered as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , 1 as denominator_flag\r\n from patient_with_age\r\n where lower(sex) = 'female'\r\n and age between 51 and 74\r\n and death_date is null\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by claim procedures\r\n*/\r\n, visit_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n from medical_claim\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code = visit_codes.code\r\n where visit_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n/*\r\n Filter encounters to qualifying visit type\r\n*/\r\n, visit_encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_start_date\r\n from encounters\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by procedure\r\n*/\r\n, visit_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join visit_codes\r\n on procedures.code = visit_codes.code\r\n and procedures.code_type = visit_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Filter to final eligible population/denominator before exclusions\r\n with a qualifying visit during the measurement period\r\n*/\r\n, eligible_population as (\r\n\r\n select\r\n patient_filtered.patient_id\r\n , patient_filtered.age\r\n , patient_filtered.measure_id\r\n , patient_filtered.measure_name\r\n , patient_filtered.measure_version\r\n , patient_filtered.performance_period_begin\r\n , patient_filtered.performance_period_end\r\n , performance_period_lookback\r\n , patient_filtered.denominator_flag\r\n from patient_filtered\r\n left join visit_claims\r\n on patient_filtered.patient_id = visit_claims.patient_id\r\n left join visit_procedures\r\n on patient_filtered.patient_id = visit_procedures.patient_id\r\n left join visit_encounters\r\n on patient_filtered.patient_id = visit_encounters.patient_id\r\n where (\r\n visit_claims.claim_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_claims.claim_end_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_procedures.procedure_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_encounters.encounter_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n )\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from eligible_population\r\n\r\n)\r\n\r\n select distinct\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),performance_period as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_end\n , performance_period_begin\n , performance_period_lookback\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n, patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , death_date\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, encounters as (\n\n select\n patient_id\n , encounter_type\n , encounter_start_date\n from __dbt__cte__quality_measures__stg_core__encounter\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n)\n\n, patient_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , patient.birth_date\n , patient.death_date\n , performance_period.measure_id\n , performance_period.measure_name\n , performance_period.measure_version\n , performance_period.performance_period_begin\n , performance_period.performance_period_end\n , performance_period.performance_period_lookback\n , floor(datediff(\n hour,\n patient.birth_date,\n performance_period.performance_period_end\n ) / 8766.0) as age\n from patient\n cross join performance_period\n\n)\n\n/*\n Filter patient to living women 51 - 74 years of age\n at the beginning of the measurement period\n*/\n, patient_filtered as (\n\n select\n patient_id\n , age\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , 1 as denominator_flag\n from patient_with_age\n where lower(sex) = 'female'\n and age between 51 and 74\n and death_date is null\n\n)\n\n/*\n Filter to qualifying visit types by claim procedures\n*/\n, visit_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n from medical_claim\n inner join visit_codes\n on medical_claim.hcpcs_code = visit_codes.code\n where visit_codes.code_system = 'hcpcs'\n\n)\n\n/*\n Filter encounters to qualifying visit type\n*/\n, visit_encounters as (\n\n select\n patient_id\n , encounter_start_date\n from encounters\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n)\n\n/*\n Filter to qualifying visit types by procedure\n*/\n, visit_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join visit_codes\n on procedures.code = visit_codes.code\n and procedures.code_type = visit_codes.code_system\n\n)\n\n/*\n Filter to final eligible population/denominator before exclusions\n with a qualifying visit during the measurement period\n*/\n, eligible_population as (\n\n select\n patient_filtered.patient_id\n , patient_filtered.age\n , patient_filtered.measure_id\n , patient_filtered.measure_name\n , patient_filtered.measure_version\n , patient_filtered.performance_period_begin\n , patient_filtered.performance_period_end\n , performance_period_lookback\n , patient_filtered.denominator_flag\n from patient_filtered\n left join visit_claims\n on patient_filtered.patient_id = visit_claims.patient_id\n left join visit_procedures\n on patient_filtered.patient_id = visit_procedures.patient_id\n left join visit_encounters\n on patient_filtered.patient_id = visit_encounters.patient_id\n where (\n visit_claims.claim_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_claims.claim_end_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_procedures.procedure_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_encounters.encounter_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n )\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_lookback as date) as performance_period_lookback\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from eligible_population\n\n)\n\n select distinct\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_mastectomy", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_mastectomy"], "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "cbeec7a759b67ead397c2973b62195cf910802220a0cf4dd967e1591d4853459"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_mastectomy", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.153998, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_exclude_mastectomy", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy or for whom there is evidence of a right and a left\r\n unilateral mastectomy\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n , 'Status Post Left Mastectomy'\r\n , 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n , 'Unilateral Mastectomy Right'\r\n , 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, all_mastectomy as (\r\n\r\n select\r\n denominator.patient_id\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy\r\n*/\r\n, bilateral_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n )\r\n\r\n)\r\n\r\n, right_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Right'\r\n )\r\n\r\n)\r\n\r\n, left_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Left Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n )\r\n\r\n)\r\n\r\n, unspecified_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Women for whom there is evidence of a right AND a left unilateral mastectomy\r\n or unspecific mastectomies on different dates\r\n*/\r\n, unilateral_mastectomy as (\r\n\r\n select\r\n right_mastectomy.patient_id\r\n , right_mastectomy.exclusion_date\r\n , right_mastectomy.exclusion_reason\r\n from right_mastectomy\r\n inner join left_mastectomy\r\n on right_mastectomy.patient_id = left_mastectomy.patient_id\r\n\r\n union all\r\n\r\n select\r\n unspecified_mastectomy.patient_id\r\n , unspecified_mastectomy.exclusion_date\r\n , unspecified_mastectomy.exclusion_reason\r\n from unspecified_mastectomy\r\n inner join unspecified_mastectomy as self_join\r\n on unspecified_mastectomy.patient_id = self_join.patient_id\r\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from bilateral_mastectomy\r\n union all\r\n select * from unilateral_mastectomy\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom unioned", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "compiled": true, "compiled_code": "\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy or for whom there is evidence of a right and a left\n unilateral mastectomy\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n , 'Status Post Left Mastectomy'\n , 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Left'\n , 'Unilateral Mastectomy Right'\n , 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, all_mastectomy as (\n\n select\n denominator.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n\n)\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy\n*/\n, bilateral_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n )\n\n)\n\n, right_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Right'\n )\n\n)\n\n, left_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Left Mastectomy'\n , 'Unilateral Mastectomy Left'\n )\n\n)\n\n, unspecified_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n/*\n Women for whom there is evidence of a right AND a left unilateral mastectomy\n or unspecific mastectomies on different dates\n*/\n, unilateral_mastectomy as (\n\n select\n right_mastectomy.patient_id\n , right_mastectomy.exclusion_date\n , right_mastectomy.exclusion_reason\n from right_mastectomy\n inner join left_mastectomy\n on right_mastectomy.patient_id = left_mastectomy.patient_id\n\n union all\n\n select\n unspecified_mastectomy.patient_id\n , unspecified_mastectomy.exclusion_date\n , unspecified_mastectomy.exclusion_reason\n from unspecified_mastectomy\n inner join unspecified_mastectomy as self_join\n on unspecified_mastectomy.patient_id = self_join.patient_id\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\n\n)\n\n, unioned as (\n\n select * from bilateral_mastectomy\n union all\n select * from unilateral_mastectomy\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclusions"], "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "0599c399c1615fecc7c447c26c22bcda6f8241d74c87256e7640c34ee10e0a03"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.157996, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_mastectomy_patients as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_mastectomy') }}\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where lower(exclusion_reason) in \r\n (\r\n 'palliative care encounter'\r\n , 'palliative care intervention'\r\n , 'hospice care ambulatory'\r\n , 'hospice encounter'\r\n )\r\n and\r\n exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_mastectomy_patients_with_exclusion_type as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'mastectomy_performed' as exclusion_type\r\n from valid_mastectomy_patients\r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n\r\n union all\r\n\r\n select * from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select * from valid_institutional_snp\r\n\r\n union all\r\n\r\n select * from valid_hospice_palliative\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ ref('quality_measures__int_nqf2372_denominator') }} denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from combined_exclusions\r\n where exclusion_type != 'hospice_palliative' \r\n and age >= 66\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n)\r\n\r\n, valid_exclusions_with_mastectomy as (\r\n\r\n select *\r\n from valid_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_mastectomy_patients_with_exclusion_type\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions_with_mastectomy\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_mastectomy", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_mastectomy_patients as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf2372_exclude_mastectomy\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where lower(exclusion_reason) in \n (\n 'palliative care encounter'\n , 'palliative care intervention'\n , 'hospice care ambulatory'\n , 'hospice encounter'\n )\n and\n exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n)\n\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n)\n-- advanced illness end\n\n, valid_mastectomy_patients_with_exclusion_type as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'mastectomy_performed' as exclusion_type\n from valid_mastectomy_patients\n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n\n union all\n\n select * from valid_dementia_exclusions\n\n union all\n\n select * from valid_institutional_snp\n\n union all\n\n select * from valid_hospice_palliative\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf2372_denominator denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from combined_exclusions\n where exclusion_type != 'hospice_palliative' \n and age >= 66\n\n union all\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n)\n\n, valid_exclusions_with_mastectomy as (\n\n select *\n from valid_exclusions\n\n union all\n\n select *\n from valid_mastectomy_patients_with_exclusion_type\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions_with_mastectomy\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_long"], "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "46ce297037405779c778234131cf080c6f0e5f48135a4645e9e6b2398b8daee5"}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1650238, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n from {{ ref('quality_measures__int_nqf2372_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n from {{ ref('quality_measures__int_nqf2372_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then denominator.denominator_flag\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null\r\n then numerator.numerator_flag\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null\r\n then exclusions.exclusion_flag\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , numerator_flag\n from dev_thuxuan.quality_measures._int_nqf2372_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n from dev_thuxuan.quality_measures._int_nqf2372_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then denominator.denominator_flag\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null\n then numerator.numerator_flag\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null\n then exclusions.exclusion_flag\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_numerator"], "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "a0903f344296f48c8dbbad2d57dab19ecc6d8fe96cabac29cc707acd8ffbd257"}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1697004, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Eligible population from the denominator model before exclusions\r\n*/\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, mammography_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name = 'Mammography'\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n from medical_claim\r\n inner join mammography_codes\r\n on medical_claim.hcpcs_code = mammography_codes.code\r\n where mammography_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n from observations\r\n inner join mammography_codes\r\n on observations.code = mammography_codes.code\r\n and observations.code_type = mammography_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join mammography_codes\r\n on procedures.code = mammography_codes.code\r\n and procedures.code_type = mammography_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Check if patients in the eligible population have had a screening,\r\n diagnostic, film, digital or digital breast tomosynthesis (3D)\r\n mammography results documented and reviewed.\r\n*/\r\n\r\n, patients_with_mammograms as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.performance_period_lookback\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_start_date\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_end_date\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_observations.observation_date\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_procedures.procedure_date\r\n else null\r\n end as evidence_date\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n else 0\r\n end as numerator_flag\r\n from denominator\r\n left join qualifying_claims\r\n on denominator.patient_id = qualifying_claims.patient_id\r\n left join qualifying_observations\r\n on denominator.patient_id = qualifying_observations.patient_id\r\n left join qualifying_procedures\r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from patients_with_mammograms\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "compiled": true, "compiled_code": "\n\n/*\n Eligible population from the denominator model before exclusions\n*/\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name = 'Mammography'\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n from medical_claim\n inner join mammography_codes\n on medical_claim.hcpcs_code = mammography_codes.code\n where mammography_codes.code_system = 'hcpcs'\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n from observations\n inner join mammography_codes\n on observations.code = mammography_codes.code\n and observations.code_type = mammography_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join mammography_codes\n on procedures.code = mammography_codes.code\n and procedures.code_type = mammography_codes.code_system\n\n)\n\n/*\n Check if patients in the eligible population have had a screening,\n diagnostic, film, digital or digital breast tomosynthesis (3D)\n mammography results documented and reviewed.\n*/\n\n, patients_with_mammograms as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.performance_period_lookback\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_start_date\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_end_date\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_observations.observation_date\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_procedures.procedure_date\n else null\n end as evidence_date\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n else 0\n end as numerator_flag\n from denominator\n left join qualifying_claims\n on denominator.patient_id = qualifying_claims.patient_id\n left join qualifying_observations\n on denominator.patient_id = qualifying_observations.patient_id\n left join qualifying_procedures\n on denominator.patient_id = qualifying_procedures.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(numerator_flag as integer) as numerator_flag\n from patients_with_mammograms\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , numerator_flag\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__performance_period"], "alias": "_int_nqf2372__performance_period", "checksum": {"name": "sha256", "checksum": "4bb3e6347eee038dcf4dcf1814b1b9b45f40ca74e2b6f194d9a7d2955ae50b29"}, "config": {"enabled": true, "alias": "_int_nqf2372__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Breast Cancer screening.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1452441, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback period to 27 months prior to the end of the\r\n performance period\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -27\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_lookback\r\n from period_begin\r\n\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\nfrom period_lookback", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback period to 27 months prior to the end of the\n performance period\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n month,\n -27,\n performance_period_end\n )\n\n as performance_period_lookback\n from period_begin\n\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_version\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_lookback as date) as performance_period_lookback\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_advanced_illness"], "alias": "_int_shared_exclusions_advanced_illness", "checksum": {"name": "sha256", "checksum": "17e0f227c6b6ce36f0cbdf3bde53649b9c5658647ad1ee5a1e5905975f8f07e8"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1332388, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'advanced illness'\r\n , 'acute inpatient'\r\n , 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n where lower(exclusion_codes.concept_name) = 'advanced illness'\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, acute_inpatient as (\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n , cast(null as date) as procedure_date\r\n from patients_with_frailty\r\n inner join med_claim_exclusions\r\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\r\n inner join condition_exclusions\r\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\r\n where lower(med_claim_exclusions.concept_name) = 'acute inpatient'\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , cast(null as date) as claim_start_date\r\n , cast(null as date) as claim_end_date\r\n , procedure_exclusions.procedure_date\r\n from patients_with_frailty\r\n inner join procedure_exclusions\r\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\r\n inner join condition_exclusions\r\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\r\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\r\n where lower(procedure_exclusions.concept_name) = 'acute inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient as (\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n , cast(null as date) as procedure_date\r\n from patients_with_frailty\r\n inner join med_claim_exclusions\r\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\r\n inner join condition_exclusions\r\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\r\n where lower(med_claim_exclusions.concept_name) in (\r\n 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , cast(null as date) as claim_start_date\r\n , cast(null as date) as claim_end_date\r\n , procedure_exclusions.procedure_date\r\n from patients_with_frailty\r\n inner join procedure_exclusions\r\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\r\n inner join condition_exclusions\r\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\r\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\r\n where lower(procedure_exclusions.concept_name) in (\r\n 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n acute_inpatient.patient_id\r\n , acute_inpatient.exclusion_date\r\n , acute_inpatient.exclusion_reason\r\n , acute_inpatient.claim_start_date\r\n , acute_inpatient.claim_end_date\r\n , acute_inpatient.procedure_date\r\n , 'acute_inpatient' as patient_type\r\n from acute_inpatient\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient.patient_id\r\n , nonacute_outpatient.exclusion_date\r\n , nonacute_outpatient.exclusion_reason\r\n , nonacute_outpatient.claim_start_date\r\n , nonacute_outpatient.claim_end_date\r\n , nonacute_outpatient.procedure_date\r\n , 'nonacute_outpatient' as patient_type\r\n from nonacute_outpatient\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'advanced_illness' as exclusion_type\r\n , claim_start_date\r\n , claim_end_date\r\n , procedure_date\r\n , patient_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions_unioned", "language": "sql", "refs": [{"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'advanced illness'\n , 'acute inpatient'\n , 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n where lower(exclusion_codes.concept_name) = 'advanced illness'\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, acute_inpatient as (\n\n select distinct\n patients_with_frailty.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n , cast(null as date) as procedure_date\n from patients_with_frailty\n inner join med_claim_exclusions\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\n inner join condition_exclusions\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\n where lower(med_claim_exclusions.concept_name) = 'acute inpatient'\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , cast(null as date) as claim_start_date\n , cast(null as date) as claim_end_date\n , procedure_exclusions.procedure_date\n from patients_with_frailty\n inner join procedure_exclusions\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\n inner join condition_exclusions\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\n where lower(procedure_exclusions.concept_name) = 'acute inpatient'\n\n)\n\n, nonacute_outpatient as (\n\n select distinct\n patients_with_frailty.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n , cast(null as date) as procedure_date\n from patients_with_frailty\n inner join med_claim_exclusions\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\n inner join condition_exclusions\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\n where lower(med_claim_exclusions.concept_name) in (\n 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , cast(null as date) as claim_start_date\n , cast(null as date) as claim_end_date\n , procedure_exclusions.procedure_date\n from patients_with_frailty\n inner join procedure_exclusions\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\n inner join condition_exclusions\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\n where lower(procedure_exclusions.concept_name) in (\n 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n)\n\n, exclusions_unioned as (\n\n select\n acute_inpatient.patient_id\n , acute_inpatient.exclusion_date\n , acute_inpatient.exclusion_reason\n , acute_inpatient.claim_start_date\n , acute_inpatient.claim_end_date\n , acute_inpatient.procedure_date\n , 'acute_inpatient' as patient_type\n from acute_inpatient\n\n union all\n\n select\n nonacute_outpatient.patient_id\n , nonacute_outpatient.exclusion_date\n , nonacute_outpatient.exclusion_reason\n , nonacute_outpatient.claim_start_date\n , nonacute_outpatient.claim_end_date\n , nonacute_outpatient.procedure_date\n , 'nonacute_outpatient' as patient_type\n from nonacute_outpatient\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'advanced_illness' as exclusion_type\n , claim_start_date\n , claim_end_date\n , procedure_date\n , patient_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_dementia"], "alias": "_int_shared_exclusions_dementia", "checksum": {"name": "sha256", "checksum": "2940b3292df3f2c9c540d84621c1fffb9b4c331d9b0286a1eb527a5fd8a5628a"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and taking dementia medications for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.136281, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_dementia", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'dementia medications'\r\n )\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claim as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, medication_exclusions as (\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.rxnorm_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'rxnorm'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.source_code = exclusion_codes.code\r\n and medications.source_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, pharmacy_claim_exclusions as (\r\n\r\n select\r\n pharmacy_claim.patient_id\r\n , pharmacy_claim.dispensing_date\r\n , pharmacy_claim.ndc_code\r\n , pharmacy_claim.paid_date\r\n , exclusion_codes.concept_name\r\n from pharmacy_claim\r\n inner join exclusion_codes\r\n on pharmacy_claim.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n)\r\n\r\n, frailty_with_dementia as (\r\n\r\n select\r\n patients_with_frailty.patient_id\r\n , patients_with_frailty.exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || pharmacy_claim_exclusions.concept_name\r\n as exclusion_reason\r\n , pharmacy_claim_exclusions.dispensing_date\r\n , pharmacy_claim_exclusions.paid_date\r\n from patients_with_frailty\r\n inner join pharmacy_claim_exclusions\r\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients_with_frailty.patient_id\r\n , medication_exclusions.dispensing_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || medication_exclusions.concept_name\r\n as exclusion_reason\r\n , medication_exclusions.dispensing_date\r\n , null as paid_date\r\n from patients_with_frailty\r\n inner join medication_exclusions\r\n on patients_with_frailty.patient_id = medication_exclusions.patient_id\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'dementia' as exclusion_type\r\n , dispensing_date\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom frailty_with_dementia", "language": "sql", "refs": [{"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n),patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'dementia medications'\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n, medication_exclusions as (\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.rxnorm_code = exclusion_codes.code\n where exclusion_codes.code_system = 'rxnorm'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join exclusion_codes\n on pharmacy_claim.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n)\n\n, frailty_with_dementia as (\n\n select\n patients_with_frailty.patient_id\n , patients_with_frailty.exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n , pharmacy_claim_exclusions.dispensing_date\n , pharmacy_claim_exclusions.paid_date\n from patients_with_frailty\n inner join pharmacy_claim_exclusions\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\n\n union all\n\n select\n patients_with_frailty.patient_id\n , medication_exclusions.dispensing_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || medication_exclusions.concept_name\n as exclusion_reason\n , medication_exclusions.dispensing_date\n , null as paid_date\n from patients_with_frailty\n inner join medication_exclusions\n on patients_with_frailty.patient_id = medication_exclusions.patient_id\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'dementia' as exclusion_type\n , dispensing_date\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom frailty_with_dementia", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_frailty", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_frailty"], "alias": "_int_shared_exclusions_frailty", "checksum": {"name": "sha256", "checksum": "41e832cc78098a822ad3583681601d409417ce80cbd2dde8b8c9936f640cd788"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty used by other exclusion models.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_frailty", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1305597, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_frailty", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'frailty device'\r\n , 'frailty diagnosis'\r\n , 'frailty encounter'\r\n , 'frailty symptom'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_frailty as (\r\n\r\n select\r\n patients.patient_id\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join condition_exclusions\r\n on patients.patient_id = condition_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , med_claim_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join med_claim_exclusions\r\n on patients.patient_id = med_claim_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join observation_exclusions\r\n on patients.patient_id = observation_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join procedure_exclusions\r\n on patients.patient_id = procedure_exclusions.patient_id\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_frailty", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),patients as (\n\n select\n patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'frailty device'\n , 'frailty diagnosis'\n , 'frailty encounter'\n , 'frailty symptom'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_frailty as (\n\n select\n patients.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from patients\n inner join condition_exclusions\n on patients.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , med_claim_exclusions.concept_name as exclusion_reason\n from patients\n inner join med_claim_exclusions\n on patients.patient_id = med_claim_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from patients\n inner join observation_exclusions\n on patients.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from patients\n inner join procedure_exclusions\n on patients.patient_id = procedure_exclusions.patient_id\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom patients_with_frailty", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_hospice_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_hospice_palliative"], "alias": "_int_shared_exclusions_hospice_palliative", "checksum": {"name": "sha256", "checksum": "f1bfe290ff54fbfdaea6c4272887d140cc960e09b7e336caf7a7ffb53e7d2e14"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_hospice_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using hospice or palliative services for the reporting for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_hospice_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.139329, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR EXCLUSIONS:\r\nPatient was provided hospice services any time during the measurement period: G9687\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'hospice encounter'\r\n , 'hospice care ambulatory'\r\n , 'hospice diagnosis'\r\n , 'palliative care encounter'\r\n , 'palliative care diagnosis'\r\n , 'palliative care intervention'\r\n )\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }} \r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n \r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'hospice_palliative' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatient was provided hospice services any time during the measurement period: G9687\n*/\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),exclusion_codes as (\n\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'hospice encounter'\n , 'hospice care ambulatory'\n , 'hospice diagnosis'\n , 'palliative care encounter'\n , 'palliative care diagnosis'\n , 'palliative care intervention'\n )\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition \n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n \n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'hospice_palliative' as exclusion_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_institutional_snp", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_institutional_snp"], "alias": "_int_shared_exclusions_institutional_snp", "checksum": {"name": "sha256", "checksum": "03caa2b62da546757a1b900c660c7f8a0f23287be4b454f03667d0617b28c01f"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_institutional_snp", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients staying in an institution for the reporting for entire patient population. \n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_institutional_snp", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.1423285, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n patients in institutional special needs plans (snp)\r\n or residing in long term care\r\n\r\n while referencing this model, patients greater or equal than 66 years of age should be taken\r\n\r\n filtering out age from this model has been stripped out as different measures calculate age varingly\r\n\r\n future enhancement: group claims into encounters\r\n*/\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patients.patient_id\r\n , coalesce(\r\n medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n ) as exclusion_date\r\n , 'institutional or long term care' as exclusion_reason\r\n from patients\r\n inner join medical_claim\r\n on patients.patient_id = medical_claim.patient_id\r\n where place_of_service_code in ('32', '33', '34', '54', '56')\r\n and {{ datediff('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'institutional_snp' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "compiled": true, "compiled_code": "\n\n/*\n patients in institutional special needs plans (snp)\n or residing in long term care\n\n while referencing this model, patients greater or equal than 66 years of age should be taken\n\n filtering out age from this model has been stripped out as different measures calculate age varingly\n\n future enhancement: group claims into encounters\n*/\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n),patients as (\n\n select\n patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, exclusions as (\n\n select\n patients.patient_id\n , coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) as exclusion_date\n , 'institutional or long term care' as exclusion_reason\n from patients\n inner join medical_claim\n on patients.patient_id = medical_claim.patient_id\n where place_of_service_code in ('32', '33', '34', '54', '56')\n and datediff(\n day,\n medical_claim.claim_start_date,\n medical_claim.claim_end_date\n ) >= 90\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'institutional_snp' as exclusion_type\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__condition": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__condition.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__condition", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "83b38f12430d4d586bce68f972fd1c2ba390d1ea178782670bfd513f5f8610e9"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_condition", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2736568, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__encounter", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__encounter"], "alias": "_stg_encounter", "checksum": {"name": "sha256", "checksum": "a3443484db1043881df846fd9f70a819d815afd999ea5c56eb82a9f3e360072b"}, "config": {"enabled": true, "alias": "_stg_encounter", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_encounter", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.277659, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__lab_result": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__lab_result"], "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "ad96153c6aca551e49b0e78f873a704e2b6fd76c2181a3dfb5cf34238b80221f"}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging lab results from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_lab_result", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.308079, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__medication": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__medication.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__medication", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__medication"], "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "4495dfb2b1f1f38347ad84085b8c196f1bd82f6cd23dca409d63aea68ba04032"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medication", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.281672, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , prescribing_date \r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , prescribing_date \r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as prescribing_date \r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__observation.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__observation", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__observation"], "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "510b931bca7c0ce78fbe5ae342ea19fac117305e04aacbaff85a2994aaf674f6"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_observation", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2863524, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , observation_date\r\n , result\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , observation_date\r\n , result\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__patient.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__patient", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "34acce40b2eeb227e56056c3e339265f96561013b169cabc3c9e5657936d4d43"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_patient", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2913816, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__procedure", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__procedure"], "alias": "_stg_procedure", "checksum": {"name": "sha256", "checksum": "62de434fe15e7aef39abb3b5fb5941f5140f730cd5b2f62293918121f99c2701"}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_procedure", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2953887, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_medical_claim", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "0924c34bacda1b808985a33ec5c31a7363f8604e7e5344756691ee3207beb122"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medical_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.2989893, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , place_of_service_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , place_of_service_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_end_date\r\n , cast(null as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(null as {{ dbt.type_string() }} ) as hcpcs_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_pharmacy_claim"], "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "813cb6e8aa1b64da07582544c522b3b7aa14efc7860754e6ff74d0d929115ec3"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_pharmacy_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.303102, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_augmented", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\final\\readmissions__encounter_augmented.sql", "original_file_path": "models\\readmissions\\final\\readmissions__encounter_augmented.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_augmented", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__encounter_augmented"], "alias": "encounter_augmented", "checksum": {"name": "sha256", "checksum": "a74fad427b28b6a97be138cfa36320c4ee92d97a9fb353c60db1049cbfa92a49"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "encounter_augmented", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3390205, "relation_name": "dev_thuxuan.readmissions.encounter_augmented", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all encounters from the stg_encounter model\r\n-- and we augment them with extra fields\r\n-- that are relevant for readmission measures\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n {{ dbt.datediff(\"aa.admit_date\", \"aa.discharge_date\",\"day\") }} as length_of_stay,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as index_admission_flag,\r\n case\r\n when cc.encounter_id is not null then 1\r\n\t else 0\r\n end as planned_flag,\r\n dd.specialty_cohort,\r\n case\r\n when aa.discharge_disposition_code = '20' then 1\r\n\t else 0\r\n end as died_flag,\r\n ee.diagnosis_ccs,\r\n ee.disqualified_encounter_flag,\r\n ee.missing_admit_date_flag,\r\n ee.missing_discharge_date_flag,\r\n ee.admit_after_discharge_flag,\r\n ee.missing_discharge_disposition_code_flag,\r\n ee.invalid_discharge_disposition_code_flag,\r\n ee.missing_primary_diagnosis_flag,\r\n ee.invalid_primary_diagnosis_code_flag,\r\n ee.no_diagnosis_ccs_flag,\r\n ee.overlaps_with_another_encounter_flag,\r\n ee.missing_ms_drg_flag,\r\n ee.invalid_ms_drg_flag,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('readmissions__index_admission') }} bb\r\n on aa.encounter_id = bb.encounter_id\r\n left join {{ ref('readmissions__planned_encounter') }} cc\r\n on aa.encounter_id = cc.encounter_id \r\n left join {{ ref('readmissions__encounter_specialty_cohort') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n left join {{ ref('readmissions__encounter_data_quality') }} ee\r\n on aa.encounter_id = ee.encounter_id", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_admission", "package": null, "version": null}, {"name": "readmissions__planned_encounter", "package": null, "version": null}, {"name": "readmissions__encounter_specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_data_quality", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_data_quality"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n datediff(\n day,\n aa.admit_date,\n aa.discharge_date\n ) as length_of_stay,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as index_admission_flag,\n case\n when cc.encounter_id is not null then 1\n\t else 0\n end as planned_flag,\n dd.specialty_cohort,\n case\n when aa.discharge_disposition_code = '20' then 1\n\t else 0\n end as died_flag,\n ee.diagnosis_ccs,\n ee.disqualified_encounter_flag,\n ee.missing_admit_date_flag,\n ee.missing_discharge_date_flag,\n ee.admit_after_discharge_flag,\n ee.missing_discharge_disposition_code_flag,\n ee.invalid_discharge_disposition_code_flag,\n ee.missing_primary_diagnosis_flag,\n ee.invalid_primary_diagnosis_code_flag,\n ee.no_diagnosis_ccs_flag,\n ee.overlaps_with_another_encounter_flag,\n ee.missing_ms_drg_flag,\n ee.invalid_ms_drg_flag,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom\n dev_thuxuan.readmissions._int_encounter aa\n left join dev_thuxuan.readmissions._int_index_admission bb\n on aa.encounter_id = bb.encounter_id\n left join dev_thuxuan.readmissions._int_planned_encounter cc\n on aa.encounter_id = cc.encounter_id \n left join dev_thuxuan.readmissions._int_encounter_specialty_cohort dd\n on aa.encounter_id = dd.encounter_id\n left join dev_thuxuan.readmissions._int_encounter_data_quality ee\n on aa.encounter_id = ee.encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__readmission_summary": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__readmission_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\final\\readmissions__readmission_summary.sql", "original_file_path": "models\\readmissions\\final\\readmissions__readmission_summary.sql", "unique_id": "model.the_tuva_project.readmissions__readmission_summary", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__readmission_summary"], "alias": "readmission_summary", "checksum": {"name": "sha256", "checksum": "e6637fd7ecf32a70431475e54250a0e77de311d0acfa8ce58062888772be52f6"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "readmission_summary", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3552568, "relation_name": "dev_thuxuan.readmissions.readmission_summary", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here calculate days to readmission for encounters\r\n-- that had a readmission and create readmission flags\r\n\r\n\r\n-- We create the encounter_sequence integer count\r\n-- which keeps track of what number of encounter each\r\n-- encounter is for a given patient\r\nwith encounter_sequence as (\r\nselect\r\n *,\r\n row_number() over(\r\n partition by patient_id order by admit_date, discharge_date\r\n ) as encounter_seq\r\nfrom {{ ref('readmissions__encounter_augmented') }}\r\nwhere disqualified_encounter_flag = 0\r\n),\r\n\r\n\r\nreadmission_calc as (\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n aa.length_of_stay,\r\n aa.index_admission_flag,\r\n aa.planned_flag,\r\n aa.specialty_cohort,\r\n aa.died_flag,\r\n aa.diagnosis_ccs,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as had_readmission_flag,\r\n {{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }} as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }}) <= 30 then 1\r\n\t else 0\r\n end as readmit_30_flag,\r\n case\r\n when\r\n\t (({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\", \"day\") }}) <= 30) and (bb.planned_flag = 0) then 1\r\n\t else 0\r\n end as unplanned_readmit_30_flag,\r\n bb.encounter_id as readmission_encounter_id,\r\n bb.admit_date as readmission_admit_date,\r\n bb.discharge_date as readmission_discharge_date,\r\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\r\n bb.facility_npi as readmission_facility,\r\n bb.ms_drg_code as readmission_ms_drg,\r\n bb.length_of_stay as readmission_length_of_stay,\r\n bb.index_admission_flag as readmission_index_admission_flag,\r\n bb.planned_flag as readmission_planned_flag,\r\n bb.specialty_cohort as readmission_specialty_cohort,\r\n bb.died_flag as readmission_died_flag,\r\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n encounter_sequence aa\r\n left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\nselect *\r\nfrom readmission_calc", "language": "sql", "refs": [{"name": "readmissions__encounter_augmented", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "compiled": true, "compiled_code": "\n\n-- Here calculate days to readmission for encounters\n-- that had a readmission and create readmission flags\n\n\n-- We create the encounter_sequence integer count\n-- which keeps track of what number of encounter each\n-- encounter is for a given patient\nwith encounter_sequence as (\nselect\n *,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom dev_thuxuan.readmissions.encounter_augmented\nwhere disqualified_encounter_flag = 0\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.length_of_stay,\n aa.index_admission_flag,\n aa.planned_flag,\n aa.specialty_cohort,\n aa.died_flag,\n aa.diagnosis_ccs,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as had_readmission_flag,\n datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n ) as days_to_readmit,\n case\n when (datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30 then 1\n\t else 0\n end as readmit_30_flag,\n case\n when\n\t ((datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30) and (bb.planned_flag = 0) then 1\n\t else 0\n end as unplanned_readmit_30_flag,\n bb.encounter_id as readmission_encounter_id,\n bb.admit_date as readmission_admit_date,\n bb.discharge_date as readmission_discharge_date,\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\n bb.facility_npi as readmission_facility,\n bb.ms_drg_code as readmission_ms_drg,\n bb.length_of_stay as readmission_length_of_stay,\n bb.index_admission_flag as readmission_index_admission_flag,\n bb.planned_flag as readmission_planned_flag,\n bb.specialty_cohort as readmission_specialty_cohort,\n bb.died_flag as readmission_died_flag,\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom\n encounter_sequence aa\n left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\nselect *\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__encounter", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter"], "alias": "_int_encounter", "checksum": {"name": "sha256", "checksum": "2987ab00297e4cfd0b5b334082bee5fb074ef3d8057837b0c53d7bae3f4641d0"}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.399435, "relation_name": "dev_thuxuan.readmissions._int_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Staging model for the input layer:\r\n-- stg_encounter input layer model.\r\n-- This contains one row for every unique encounter in the dataset.\r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }}) as encounter_id,\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id,\r\n cast(encounter_start_date as date) as admit_date,\r\n cast(encounter_end_date as date) as discharge_date,\r\n cast(discharge_disposition_code as {{ dbt.type_string() }}) as discharge_disposition_code,\r\n cast(facility_npi as {{ dbt.type_string() }}) as facility_npi,\r\n cast(ms_drg_code as {{ dbt.type_string() }}) as ms_drg_code,\r\n cast(paid_amount as numeric) as paid_amount,\r\n cast(primary_diagnosis_code as {{ dbt.type_string() }}) as primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "refs": [{"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'\n)-- Staging model for the input layer:\n-- stg_encounter input layer model.\n-- This contains one row for every unique encounter in the dataset.\n\nselect\n cast(encounter_id as TEXT) as encounter_id,\n cast(patient_id as TEXT) as patient_id,\n cast(encounter_start_date as date) as admit_date,\n cast(encounter_end_date as date) as discharge_date,\n cast(discharge_disposition_code as TEXT) as discharge_disposition_code,\n cast(facility_npi as TEXT) as facility_npi,\n cast(ms_drg_code as TEXT) as ms_drg_code,\n cast(paid_amount as numeric) as paid_amount,\n cast(primary_diagnosis_code as TEXT) as primary_diagnosis_code,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom __dbt__cte__readmissions__stg_core__encounter", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__encounter", "sql": " __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_data_quality", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_data_quality"], "alias": "_int_encounter_data_quality", "checksum": {"name": "sha256", "checksum": "85bf70dcffff48c401c303e894eff2d2e1da14d93417696f3e14fd59a3dfe9f0"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_data_quality", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3602479, "relation_name": "dev_thuxuan.readmissions._int_encounter_data_quality", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all encounters from the stg_encounter table\r\n-- with data quality flags that may disqualify them from\r\n-- being used for readmission measures \r\n\r\n\r\n-- Flag several potential data quality issues\r\n-- with all encounters.\r\n-- Every encounter_id from the stg_encounter model\r\n-- will be here. This CTE should have the same\r\n-- number of rows as the stg_encounter model, i.e.,\r\n-- there is a one to one correspondence between the\r\n-- rows in stg_encounter and this CTE.\r\nwith encounter_data_quality_issues as (\r\nselect\r\n aa.encounter_id,\r\n case\r\n when aa.admit_date is null then 1\r\n\telse 0\r\n end as missing_admit_date_flag,\r\n case\r\n when aa.discharge_date is null then 1\r\n\telse 0\r\n end as missing_discharge_date_flag,\r\n case\r\n when aa.admit_date > aa.discharge_date then 1\r\n\telse 0\r\n end as admit_after_discharge_flag,\r\n case\r\n when aa.discharge_disposition_code is null then 1\r\n\telse 0\r\n end as missing_discharge_disposition_code_flag,\r\n case\r\n when\r\n\t (aa.discharge_disposition_code is not null)\r\n\t and\r\n\t (bb.discharge_disposition_code is null) then 1\r\n\telse 0\r\n end as invalid_discharge_disposition_code_flag,\r\n case\r\n when aa.primary_diagnosis_code is null then 1\r\n else 0\r\n end as missing_primary_diagnosis_flag,\r\n case\r\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\r\n\telse 0\r\n end as invalid_primary_diagnosis_code_flag,\r\n case\r\n when aa.ccs_diagnosis_category is null then 1\r\n\telse 0\r\n end as no_diagnosis_ccs_flag,\r\n aa.ccs_diagnosis_category as diagnosis_ccs,\r\n case\r\n when aa.encounter_id in (select distinct encounter_id_A\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\t or\r\n\t aa.encounter_id in (select distinct encounter_id_B\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\tthen 1\r\n\telse 0\r\n end as overlaps_with_another_encounter_flag,\r\n case\r\n when aa.ms_drg_code is null then 1\r\n\telse 0\r\n end as missing_ms_drg_flag,\r\n case\r\n when cc.ms_drg_code is null then 1\r\n\telse 0\r\n end as invalid_ms_drg_flag\r\n\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} aa\r\n left join {{ ref('terminology__discharge_disposition') }} bb\r\n on aa.discharge_disposition_code = bb.discharge_disposition_code\r\n left join {{ ref('terminology__ms_drg') }} cc\r\n on aa.ms_drg_code = cc.ms_drg_code\r\n),\r\n\r\n\r\n-- Here we add a disqualified_encounter_flag.\r\n-- This disqualified_encounter_flag = 1\r\n-- when any of the critical data quality flags\r\n-- from the above CTE are equal to 1.\r\nall_data_quality_flags as (\r\nselect\r\n encounter_id,\r\n diagnosis_ccs,\r\n case\r\n when\r\n\t (missing_admit_date_flag = 1)\r\n\t or\r\n\t (missing_discharge_date_flag = 1)\r\n\t or\r\n\t (admit_after_discharge_flag = 1)\r\n\t or\r\n\t (missing_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (invalid_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (missing_primary_diagnosis_flag = 1)\r\n\t or\r\n\t (invalid_primary_diagnosis_code_flag = 1)\r\n\t or\r\n\t (no_diagnosis_ccs_flag = 1)\r\n\t or\r\n\t (overlaps_with_another_encounter_flag = 1)\r\n\t or\r\n\t (missing_ms_drg_flag = 1)\r\n\t or\r\n\t (invalid_ms_drg_flag = 1)\r\n\t then 1\r\n\telse 0\r\n end as disqualified_encounter_flag,\r\n missing_admit_date_flag,\r\n missing_discharge_date_flag,\r\n admit_after_discharge_flag,\r\n missing_discharge_disposition_code_flag,\r\n invalid_discharge_disposition_code_flag,\r\n missing_primary_diagnosis_flag,\r\n invalid_primary_diagnosis_code_flag,\r\n no_diagnosis_ccs_flag,\r\n overlaps_with_another_encounter_flag,\r\n missing_ms_drg_flag,\r\n invalid_ms_drg_flag\r\nfrom encounter_data_quality_issues\r\n) \r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_data_quality_flags", "language": "sql", "refs": [{"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter table\n-- with data quality flags that may disqualify them from\n-- being used for readmission measures \n\n\n-- Flag several potential data quality issues\n-- with all encounters.\n-- Every encounter_id from the stg_encounter model\n-- will be here. This CTE should have the same\n-- number of rows as the stg_encounter model, i.e.,\n-- there is a one to one correspondence between the\n-- rows in stg_encounter and this CTE.\nwith encounter_data_quality_issues as (\nselect\n aa.encounter_id,\n case\n when aa.admit_date is null then 1\n\telse 0\n end as missing_admit_date_flag,\n case\n when aa.discharge_date is null then 1\n\telse 0\n end as missing_discharge_date_flag,\n case\n when aa.admit_date > aa.discharge_date then 1\n\telse 0\n end as admit_after_discharge_flag,\n case\n when aa.discharge_disposition_code is null then 1\n\telse 0\n end as missing_discharge_disposition_code_flag,\n case\n when\n\t (aa.discharge_disposition_code is not null)\n\t and\n\t (bb.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when aa.primary_diagnosis_code is null then 1\n else 0\n end as missing_primary_diagnosis_flag,\n case\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when aa.ccs_diagnosis_category is null then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n aa.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from dev_thuxuan.readmissions._int_encounter_overlap )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from dev_thuxuan.readmissions._int_encounter_overlap )\n\tthen 1\n\telse 0\n end as overlaps_with_another_encounter_flag,\n case\n when aa.ms_drg_code is null then 1\n\telse 0\n end as missing_ms_drg_flag,\n case\n when cc.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs aa\n left join dev_thuxuan.terminology.discharge_disposition bb\n on aa.discharge_disposition_code = bb.discharge_disposition_code\n left join dev_thuxuan.terminology.ms_drg cc\n on aa.ms_drg_code = cc.ms_drg_code\n),\n\n\n-- Here we add a disqualified_encounter_flag.\n-- This disqualified_encounter_flag = 1\n-- when any of the critical data quality flags\n-- from the above CTE are equal to 1.\nall_data_quality_flags as (\nselect\n encounter_id,\n diagnosis_ccs,\n case\n when\n\t (missing_admit_date_flag = 1)\n\t or\n\t (missing_discharge_date_flag = 1)\n\t or\n\t (admit_after_discharge_flag = 1)\n\t or\n\t (missing_discharge_disposition_code_flag = 1)\n\t or\n\t (invalid_discharge_disposition_code_flag = 1)\n\t or\n\t (missing_primary_diagnosis_flag = 1)\n\t or\n\t (invalid_primary_diagnosis_code_flag = 1)\n\t or\n\t (no_diagnosis_ccs_flag = 1)\n\t or\n\t (overlaps_with_another_encounter_flag = 1)\n\t or\n\t (missing_ms_drg_flag = 1)\n\t or\n\t (invalid_ms_drg_flag = 1)\n\t then 1\n\telse 0\n end as disqualified_encounter_flag,\n missing_admit_date_flag,\n missing_discharge_date_flag,\n admit_after_discharge_flag,\n missing_discharge_disposition_code_flag,\n invalid_discharge_disposition_code_flag,\n missing_primary_diagnosis_flag,\n invalid_primary_diagnosis_code_flag,\n no_diagnosis_ccs_flag,\n overlaps_with_another_encounter_flag,\n missing_ms_drg_flag,\n invalid_ms_drg_flag\nfrom encounter_data_quality_issues\n) \n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_overlap", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_overlap.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_overlap", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_overlap"], "alias": "_int_encounter_overlap", "checksum": {"name": "sha256", "checksum": "f962709bed5f4396f7956a8658c9f97ea39e81b7ab403a706e0bc323fe61f253"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_overlap", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.363252, "relation_name": "dev_thuxuan.readmissions._int_encounter_overlap", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we give a list of all pairs of encounters\r\n-- that have some date overlap.\r\n\r\n\r\nwith encounters_with_row_num as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over (\r\n partition by patient_id order by encounter_id\r\n\t) as row_num\r\nfrom {{ ref('readmissions__encounter') }}\r\n),\r\n\r\n\r\ncartesian as (\r\nselect\r\n aa.encounter_id as encounter_id_A,\r\n bb.encounter_id as encounter_id_B,\r\n aa.patient_id,\r\n aa.admit_date as Ai,\r\n aa.discharge_date as Af,\r\n bb.admit_date as Bi,\r\n bb.discharge_date as Bf,\r\n case\r\n when (aa.admit_date between bb.admit_date and bb.discharge_date) or (aa.discharge_date between bb.admit_date and bb.discharge_date) or\r\n (bb.admit_date between aa.admit_date and aa.discharge_date) or (bb.discharge_date between aa.admit_date and aa.discharge_date)\r\n then 1\r\n else 0\r\n end as overlap\r\n from encounters_with_row_num aa\r\n left join encounters_with_row_num bb\r\n on aa.patient_id = bb.patient_id and aa.row_num < bb.row_num\r\n),\r\n\r\n\r\noverlapping_pairs\r\nas\r\n(\r\n select\r\n patient_id,\r\n encounter_id_A,\r\n\tencounter_id_B\r\n from cartesian\r\n where overlap = 1\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom overlapping_pairs", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "compiled": true, "compiled_code": "\n\n-- Here we give a list of all pairs of encounters\n-- that have some date overlap.\n\n\nwith encounters_with_row_num as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over (\n partition by patient_id order by encounter_id\n\t) as row_num\nfrom dev_thuxuan.readmissions._int_encounter\n),\n\n\ncartesian as (\nselect\n aa.encounter_id as encounter_id_A,\n bb.encounter_id as encounter_id_B,\n aa.patient_id,\n aa.admit_date as Ai,\n aa.discharge_date as Af,\n bb.admit_date as Bi,\n bb.discharge_date as Bf,\n case\n when (aa.admit_date between bb.admit_date and bb.discharge_date) or (aa.discharge_date between bb.admit_date and bb.discharge_date) or\n (bb.admit_date between aa.admit_date and aa.discharge_date) or (bb.discharge_date between aa.admit_date and aa.discharge_date)\n then 1\n else 0\n end as overlap\n from encounters_with_row_num aa\n left join encounters_with_row_num bb\n on aa.patient_id = bb.patient_id and aa.row_num < bb.row_num\n),\n\n\noverlapping_pairs\nas\n(\n select\n patient_id,\n encounter_id_A,\n\tencounter_id_B\n from cartesian\n where overlap = 1\n)\n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_specialty_cohort", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_specialty_cohort"], "alias": "_int_encounter_specialty_cohort", "checksum": {"name": "sha256", "checksum": "28c65aded20c36a73d5fa59261d9b4042b2839b17242ddd308df2c7975a43b48"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_specialty_cohort", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3679783, "relation_name": "dev_thuxuan.readmissions._int_encounter_specialty_cohort", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list the specialty cohort for each encounter that has\r\n-- an associated specialty cohort.\r\n-- There are 5 possible specialty cohorts:\r\n-- [1] Medicine\r\n-- [2] Surgery/Gynecology\r\n-- [3] Cardiology\r\n-- [4] Cardiovascular\r\n-- [5] Neurology\r\n-- An encounter that has an ICD-10-PCS procedure code or a\r\n-- CCS procedure category that corresponds to the\r\n-- 'Surgery/Gynecology' cohort will always be in that cohort.\r\n-- For encounters that are not in the 'Surgery/Gynecology' cohort,\r\n-- we then check to see if they are in one of the other 4 cohorts.\r\n\r\n--ranking to eventually assign a cohort to encounters in multiple cohorts\r\nwith cohort_ranks as (\r\n select 'Surgery/Gynecology' as cohort, 1 as c_rank\r\n union all\r\n select 'Cardiorespiratory' as cohort, 2 as c_rank\r\n union all\r\n select 'Cardiovascular' as cohort, 3 as c_rank\r\n union all\r\n select 'Neurology' as cohort, 4 as c_rank\r\n union all\r\n select 'Medicine' as cohort, 5 as c_rank\r\n)\r\n\r\n\r\n--get all encounter ids in any procedure or diagnosis based cohorts\r\n, all_encounter_cohorts as (\r\n\r\n --encounter ids in procedure based cohorts\r\n select proc.encounter_id, 1 as c_rank\r\n from {{ ref('readmissions__procedure_ccs') }} proc\r\n left join {{ ref('readmissions__surgery_gynecology_cohort') }} sgc\r\n on proc.procedure_code = sgc.icd_10_pcs\r\n left join {{ ref('readmissions__specialty_cohort') }} sgsc\r\n on proc.ccs_procedure_category = sgsc.ccs and sgsc.specialty_cohort = 'Surgery/Gynecology'\r\n where sgc.icd_10_pcs is not null or sgsc.ccs is not null\r\n\r\n union all\r\n\r\n --encounter ids in diagnosis based cohorts\r\n select diag.encounter_id, cohort_ranks.c_rank\r\n from {{ ref('readmissions__encounter_with_ccs') }} diag\r\n inner join {{ ref('readmissions__specialty_cohort') }} sc\r\n on diag.ccs_diagnosis_category = sc.ccs and sc.procedure_or_diagnosis = 'Diagnosis'\r\n inner join cohort_ranks\r\n on sc.specialty_cohort = cohort_ranks.cohort\r\n)\r\n\r\n\r\n-- getting one cohort per encounter\r\n, main_encounter_cohort as (\r\n select encounter_id, min(c_rank) as main_c_rank\r\n from all_encounter_cohorts\r\n group by encounter_id\r\n\r\n)\r\n\r\n\r\n--getting all encounters, with labeled cohorts, if no cohort cohort is \"medicine\"\r\nselect enc.encounter_id, coalesce(cohort_ranks.cohort, 'Medicine') as specialty_cohort, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join main_encounter_cohort mec\r\n on enc.encounter_id = mec.encounter_id\r\nleft join cohort_ranks\r\n on mec.main_c_rank = cohort_ranks.c_rank", "language": "sql", "refs": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__surgery_gynecology_cohort", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "compiled": true, "compiled_code": "\n\n-- Here we list the specialty cohort for each encounter that has\n-- an associated specialty cohort.\n-- There are 5 possible specialty cohorts:\n-- [1] Medicine\n-- [2] Surgery/Gynecology\n-- [3] Cardiology\n-- [4] Cardiovascular\n-- [5] Neurology\n-- An encounter that has an ICD-10-PCS procedure code or a\n-- CCS procedure category that corresponds to the\n-- 'Surgery/Gynecology' cohort will always be in that cohort.\n-- For encounters that are not in the 'Surgery/Gynecology' cohort,\n-- we then check to see if they are in one of the other 4 cohorts.\n\n--ranking to eventually assign a cohort to encounters in multiple cohorts\nwith cohort_ranks as (\n select 'Surgery/Gynecology' as cohort, 1 as c_rank\n union all\n select 'Cardiorespiratory' as cohort, 2 as c_rank\n union all\n select 'Cardiovascular' as cohort, 3 as c_rank\n union all\n select 'Neurology' as cohort, 4 as c_rank\n union all\n select 'Medicine' as cohort, 5 as c_rank\n)\n\n\n--get all encounter ids in any procedure or diagnosis based cohorts\n, all_encounter_cohorts as (\n\n --encounter ids in procedure based cohorts\n select proc.encounter_id, 1 as c_rank\n from dev_thuxuan.readmissions._int_procedure_ccs proc\n left join dev_thuxuan.readmissions._value_set_surgery_gynecology_cohort sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join dev_thuxuan.readmissions._value_set_specialty_cohort sgsc\n on proc.ccs_procedure_category = sgsc.ccs and sgsc.specialty_cohort = 'Surgery/Gynecology'\n where sgc.icd_10_pcs is not null or sgsc.ccs is not null\n\n union all\n\n --encounter ids in diagnosis based cohorts\n select diag.encounter_id, cohort_ranks.c_rank\n from dev_thuxuan.readmissions._int_encounter_with_ccs diag\n inner join dev_thuxuan.readmissions._value_set_specialty_cohort sc\n on diag.ccs_diagnosis_category = sc.ccs and sc.procedure_or_diagnosis = 'Diagnosis'\n inner join cohort_ranks\n on sc.specialty_cohort = cohort_ranks.cohort\n)\n\n\n-- getting one cohort per encounter\n, main_encounter_cohort as (\n select encounter_id, min(c_rank) as main_c_rank\n from all_encounter_cohorts\n group by encounter_id\n\n)\n\n\n--getting all encounters, with labeled cohorts, if no cohort cohort is \"medicine\"\nselect enc.encounter_id, coalesce(cohort_ranks.cohort, 'Medicine') as specialty_cohort, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter enc\nleft join main_encounter_cohort mec\n on enc.encounter_id = mec.encounter_id\nleft join cohort_ranks\n on mec.main_c_rank = cohort_ranks.c_rank", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_with_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_with_ccs"], "alias": "_int_encounter_with_ccs", "checksum": {"name": "sha256", "checksum": "2f83bbfad722eac401d7efcd91792a7369b1ad1b20c1e29d16318c9de3caf85f"}, "config": {"enabled": true, "alias": "_int_encounter_with_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_with_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.370974, "relation_name": "dev_thuxuan.readmissions._int_encounter_with_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we add a CCS diagnosis category to\r\n-- every encounter that we can add a CCS diagnosis category to.\r\n-- The CCS diagnosis category is found using\r\n-- the encounter's primary diagnosis code.\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n aa.primary_diagnosis_code,\r\n\r\n case\r\n when bb.icd_10_cm is not null then 1\r\n else 0\r\n end as valid_primary_diagnosis_code_flag,\r\n\r\n cc.ccs_diagnosis_category,\r\n\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('terminology__icd_10_cm') }} bb\r\n on aa.primary_diagnosis_code = bb.icd_10_cm\r\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\r\n on aa.primary_diagnosis_code = cc.icd_10_cm", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "readmissions__icd_10_cm_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "compiled": true, "compiled_code": "\n\n-- Here we add a CCS diagnosis category to\n-- every encounter that we can add a CCS diagnosis category to.\n-- The CCS diagnosis category is found using\n-- the encounter's primary diagnosis code.\n\n\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.primary_diagnosis_code,\n\n case\n when bb.icd_10_cm is not null then 1\n else 0\n end as valid_primary_diagnosis_code_flag,\n\n cc.ccs_diagnosis_category,\n\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\n\nfrom\n dev_thuxuan.readmissions._int_encounter aa\n left join dev_thuxuan.terminology.icd_10_cm bb\n on aa.primary_diagnosis_code = bb.icd_10_cm\n left join dev_thuxuan.readmissions._value_set_icd_10_cm_to_ccs cc\n on aa.primary_diagnosis_code = cc.icd_10_cm", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__exclusion": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__exclusion", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__exclusion.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__exclusion.sql", "unique_id": "model.the_tuva_project.readmissions__exclusion", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__exclusion"], "alias": "_int_exclusion", "checksum": {"name": "sha256", "checksum": "b31e6649264b98b4fe7df0754f44c05dc3c88992718a139f0df3942b3920e93d"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_exclusion", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3739755, "relation_name": "dev_thuxuan.readmissions._int_exclusion", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that are excluded\r\n-- from being index admissions because they\r\n-- belong to one of these categories:\r\n-- [1] Medical Treatment of Cancer\r\n-- [2] Rehabilitation\r\n-- [3] Psychiatric\r\n\r\n\r\n-- encounter_ids for encounters that should be\r\n-- excluded because they belong to one of the\r\n-- exclusion categories\r\nwith exclusions as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }}\r\nwhere\r\n(ccs_diagnosis_category is not null)\r\nand\r\n(\r\nccs_diagnosis_category in\r\n (select distinct ccs_diagnosis_category\r\n from {{ ref('readmissions__exclusion_ccs_diagnosis_category') }} )\r\n)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [{"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__exclusion_ccs_diagnosis_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__exclusion.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that are excluded\n-- from being index admissions because they\n-- belong to one of these categories:\n-- [1] Medical Treatment of Cancer\n-- [2] Rehabilitation\n-- [3] Psychiatric\n\n\n-- encounter_ids for encounters that should be\n-- excluded because they belong to one of the\n-- exclusion categories\nwith exclusions as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs\nwhere\n(ccs_diagnosis_category is not null)\nand\n(\nccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from dev_thuxuan.readmissions._value_set_exclusion_ccs_diagnosis_category )\n)\n)\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_admission": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_admission", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_admission.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_admission.sql", "unique_id": "model.the_tuva_project.readmissions__index_admission", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_admission"], "alias": "_int_index_admission", "checksum": {"name": "sha256", "checksum": "dcb38723afc9f460fa4a604542fc958d1594b88e866be06132a22b1d40007e62"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_admission", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3769748, "relation_name": "dev_thuxuan.readmissions._int_index_admission", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all index admissions for the hospital wide readmissions\r\n-- measure.\r\n-- These represent encounter_ids that meet the requirements to be an\r\n-- index admission for the HWR measure.\r\n-- These are the requirements for a hospitalization to be an index admission\r\n-- for the HWR measure:\r\n--\r\n-- Time Requirement: The discharge data must be at least 30 days\r\n-- earlier than the last dischareg date available\r\n-- in the dataset.\r\n-- \r\n-- Discharge Requirements: The patient must not be discharged to another\r\n-- acute care hospital; the patient must not have\r\n-- left against medical advice; and the patient\r\n-- must be alive at discharge.\r\n--\r\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\r\n-- (exclusions) diagnosis category we know the encounter was\r\n-- for medical treatment of cancer, rehabilitation,\r\n-- or psychiatric reasons.\r\n\r\n\r\n\r\nselect distinct a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\ninner join {{ ref('readmissions__index_time_requirement') }} b\r\n on a.encounter_id = b.encounter_id\r\ninner join {{ ref('readmissions__index_discharge_requirement') }} c\r\n on a.encounter_id = c.encounter_id\r\nleft join {{ ref('readmissions__exclusion') }} d\r\n on a.encounter_id = d.encounter_id\r\nwhere d.encounter_id is null", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_time_requirement", "package": null, "version": null}, {"name": "readmissions__index_discharge_requirement", "package": null, "version": null}, {"name": "readmissions__exclusion", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__exclusion"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all index admissions for the hospital wide readmissions\n-- measure.\n-- These represent encounter_ids that meet the requirements to be an\n-- index admission for the HWR measure.\n-- These are the requirements for a hospitalization to be an index admission\n-- for the HWR measure:\n--\n-- Time Requirement: The discharge data must be at least 30 days\n-- earlier than the last dischareg date available\n-- in the dataset.\n-- \n-- Discharge Requirements: The patient must not be discharged to another\n-- acute care hospital; the patient must not have\n-- left against medical advice; and the patient\n-- must be alive at discharge.\n--\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\n-- (exclusions) diagnosis category we know the encounter was\n-- for medical treatment of cancer, rehabilitation,\n-- or psychiatric reasons.\n\n\n\nselect distinct a.encounter_id, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter a\ninner join dev_thuxuan.readmissions._int_index_time_requirement b\n on a.encounter_id = b.encounter_id\ninner join dev_thuxuan.readmissions._int_index_discharge_requirement c\n on a.encounter_id = c.encounter_id\nleft join dev_thuxuan.readmissions._int_exclusion d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_discharge_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_discharge_requirement"], "alias": "_int_index_discharge_requirement", "checksum": {"name": "sha256", "checksum": "2b8b5e8b5553070da0cf0285073fbda99ccb81f78793989007f335d90c90351a"}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_discharge_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3799818, "relation_name": "dev_thuxuan.readmissions._int_index_discharge_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the discharge_disposition_code requirements to be an\r\n-- index admission:\r\n-- *** Must NOT be discharged to another acute care hospital\r\n-- *** Must NOT have left against medical advice\r\n-- *** Patient must be alive at discharge\r\n\r\n\r\n\r\nwith all_invalid_discharges as (\r\nselect encounter_id\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_disposition_code in (\r\n '02' -- Patient discharged/transferred to other short term general hospital for inpatient care.\r\n ,'07' -- Patient left against medical advice\r\n ,'20' -- Patient died\r\n )\r\n)\r\n\r\n-- All discharges that meet the discharge_disposition_code\r\n-- requirements to be an index admission\r\nselect a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\nleft join all_invalid_discharges b\r\n on a.encounter_id = b.encounter_id\r\nwhere b.encounter_id is null", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the discharge_disposition_code requirements to be an\n-- index admission:\n-- *** Must NOT be discharged to another acute care hospital\n-- *** Must NOT have left against medical advice\n-- *** Patient must be alive at discharge\n\n\n\nwith all_invalid_discharges as (\nselect encounter_id\nfrom dev_thuxuan.readmissions._int_encounter\nwhere discharge_disposition_code in (\n '02' -- Patient discharged/transferred to other short term general hospital for inpatient care.\n ,'07' -- Patient left against medical advice\n ,'20' -- Patient died\n )\n)\n\n-- All discharges that meet the discharge_disposition_code\n-- requirements to be an index admission\nselect a.encounter_id, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter a\nleft join all_invalid_discharges b\n on a.encounter_id = b.encounter_id\nwhere b.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_time_requirement": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_time_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_time_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_time_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_time_requirement"], "alias": "_int_index_time_requirement", "checksum": {"name": "sha256", "checksum": "fdcb889f1dfb18eac9c6391357319f305df38687d14351a70eed3b4ef5181853"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_time_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3826983, "relation_name": "dev_thuxuan.readmissions._int_index_time_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the time requirement to be an index admission:\r\n-- The discharge date must be at least 30 days\r\n-- earlier than the last discharge date available\r\n-- in the dataset.\r\n\r\n\r\n\r\nselect encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_date <= (select max(discharge_date)\r\n from {{ ref('readmissions__encounter') }} ) - 30", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the time requirement to be an index admission:\n-- The discharge date must be at least 30 days\n-- earlier than the last discharge date available\n-- in the dataset.\n\n\n\nselect encounter_id, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter\nwhere discharge_date <= (select max(discharge_date)\n from dev_thuxuan.readmissions._int_encounter ) - 30", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__planned_encounter": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__planned_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__planned_encounter.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "unique_id": "model.the_tuva_project.readmissions__planned_encounter", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__planned_encounter"], "alias": "_int_planned_encounter", "checksum": {"name": "sha256", "checksum": "ae9c261fad8644fad894b8d6b87a15aeeb2688a7776f75dd635d172fc0e025d1"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_planned_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.3867624, "relation_name": "dev_thuxuan.readmissions._int_planned_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids for all encounters\r\n-- that are planned.\r\n\r\n\r\n-- encounter_ids for encounters that we know\r\n-- are planned because they had a procedure category\r\n-- that is only present for planned encounters \r\nwith always_planned_px as (\r\nselect distinct pccs.encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pccs\r\ninner join {{ ref('readmissions__always_planned_ccs_procedure_category') }} apc\r\n on pccs.ccs_procedure_category = apc.ccs_procedure_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that we know\r\n-- are planned because they had a diagnosis category\r\n-- that is only present for planned encounters\r\nalways_planned_dx as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} dccs\r\ninner join {{ ref('readmissions__always_planned_ccs_diagnosis_category') }} apd\r\n on dccs.ccs_diagnosis_category = apd.ccs_diagnosis_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on one of their CCS procedure categories.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_ccs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pccs\r\ninner join {{ ref('readmissions__potentially_planned_ccs_procedure_category') }} pcs\r\n on pccs.ccs_procedure_category = pcs.ccs_procedure_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on their ICD-10-PCS procedure codes.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_icd_10_pcs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pcs\r\ninner join {{ ref('readmissions__potentially_planned_icd_10_pcs') }} pps\r\n on pcs.procedure_code = pps.icd_10_pcs\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are acute based\r\n-- on their primary diagnosis code or their CCS diagnosis category\r\nacute_encounters as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} dccs\r\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\r\n on dccs.primary_diagnosis_code = adi.icd_10_cm\r\nleft join {{ ref('readmissions__acute_diagnosis_ccs') }} adc\r\n on dccs.ccs_diagnosis_category = adc.ccs_diagnosis_category\r\nwhere adi.icd_10_cm is not null or adc.ccs_diagnosis_category is not null\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are:\r\n-- [1] potentially planned, based on one of\r\n-- their CCS procedure categories or\r\n-- their ICD-10-PCS procedure codes\r\n-- [2] not acute, based on their primary diagnosis code\r\n-- or their CCS diagnosis category\r\n-- These encounters are therefore confirmed to be planned\r\npotentially_planned_that_are_actually_planned as (\r\nselect distinct ppp.encounter_id\r\nfrom (\r\n select * from potentially_planned_px_ccs\r\n union all\r\n select * from potentially_planned_px_icd_10_pcs) ppp\r\nleft join acute_encounters\r\n on ppp.encounter_id = acute_encounters.encounter_id\r\nwhere acute_encounters.encounter_id is null\r\n\r\n)\r\n\r\n\r\n-- Aggregate of all encounter_ids for planned encounters\r\n\r\nselect * , '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_px\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_dx\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from potentially_planned_that_are_actually_planned", "language": "sql", "refs": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_diagnosis_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_icd_10_cm", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids for all encounters\n-- that are planned.\n\n\n-- encounter_ids for encounters that we know\n-- are planned because they had a procedure category\n-- that is only present for planned encounters \nwith always_planned_px as (\nselect distinct pccs.encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pccs\ninner join dev_thuxuan.readmissions._value_set_always_planned_ccs_procedure_category apc\n on pccs.ccs_procedure_category = apc.ccs_procedure_category\n),\n\n\n-- encounter_ids for encounters that we know\n-- are planned because they had a diagnosis category\n-- that is only present for planned encounters\nalways_planned_dx as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs dccs\ninner join dev_thuxuan.readmissions._value_set_always_planned_ccs_diagnosis_category apd\n on dccs.ccs_diagnosis_category = apd.ccs_diagnosis_category\n),\n\n\n-- encounter_ids for encounters that are potentially planned\n-- based on one of their CCS procedure categories.\n-- For these encounters to actually be planned, we must further\n-- require that they are NOT acute encounters\npotentially_planned_px_ccs as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pccs\ninner join dev_thuxuan.readmissions._value_set_potentially_planned_ccs_procedure_category pcs\n on pccs.ccs_procedure_category = pcs.ccs_procedure_category\n),\n\n\n-- encounter_ids for encounters that are potentially planned\n-- based on their ICD-10-PCS procedure codes.\n-- For these encounters to actually be planned, we must further\n-- require that they are NOT acute encounters\npotentially_planned_px_icd_10_pcs as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pcs\ninner join dev_thuxuan.readmissions._value_set_potentially_planned_icd_10_pcs pps\n on pcs.procedure_code = pps.icd_10_pcs\n),\n\n\n-- encounter_ids for encounters that are acute based\n-- on their primary diagnosis code or their CCS diagnosis category\nacute_encounters as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs dccs\nleft join dev_thuxuan.readmissions._value_set_acute_diagnosis_icd_10_cm adi\n on dccs.primary_diagnosis_code = adi.icd_10_cm\nleft join dev_thuxuan.readmissions._value_set_acute_diagnosis_ccs adc\n on dccs.ccs_diagnosis_category = adc.ccs_diagnosis_category\nwhere adi.icd_10_cm is not null or adc.ccs_diagnosis_category is not null\n),\n\n\n-- encounter_ids for encounters that are:\n-- [1] potentially planned, based on one of\n-- their CCS procedure categories or\n-- their ICD-10-PCS procedure codes\n-- [2] not acute, based on their primary diagnosis code\n-- or their CCS diagnosis category\n-- These encounters are therefore confirmed to be planned\npotentially_planned_that_are_actually_planned as (\nselect distinct ppp.encounter_id\nfrom (\n select * from potentially_planned_px_ccs\n union all\n select * from potentially_planned_px_icd_10_pcs) ppp\nleft join acute_encounters\n on ppp.encounter_id = acute_encounters.encounter_id\nwhere acute_encounters.encounter_id is null\n\n)\n\n\n-- Aggregate of all encounter_ids for planned encounters\n\nselect * , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__procedure_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__procedure_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__procedure_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__procedure_ccs"], "alias": "_int_procedure_ccs", "checksum": {"name": "sha256", "checksum": "559e894edcdd88758b66a520f1ab0234d405d137e47ebb782ce681282fe746fa"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_procedure_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.389813, "relation_name": "dev_thuxuan.readmissions._int_procedure_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we map every procedure code to its corresponding\r\n-- CCS procedure category.\r\n-- This model may list more than one CCS procedure category\r\n-- per encounter_id because different procedures associated with the\r\n-- encounter (different rows on the stg_procedure model) may have\r\n-- different associated CCS procedure categories.\r\n\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.normalized_code as procedure_code,\r\n case\r\n when bb.icd_10_pcs is null then 0\r\n\telse 1\r\n end as valid_icd_10_pcs_flag,\r\n cc.ccs_procedure_category,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__stg_core__procedure') }} aa\r\n left join {{ ref('terminology__icd_10_pcs') }} bb\r\n on aa.normalized_code = bb.icd_10_pcs\r\n left join {{ ref('readmissions__icd_10_pcs_to_ccs') }} cc\r\n on aa.normalized_code = cc.icd_10_pcs\r\nwhere aa.normalized_code_type = 'icd-10-pcs'", "language": "sql", "refs": [{"name": "readmissions__stg_core__procedure", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__icd_10_pcs_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)-- Here we map every procedure code to its corresponding\n-- CCS procedure category.\n-- This model may list more than one CCS procedure category\n-- per encounter_id because different procedures associated with the\n-- encounter (different rows on the stg_procedure model) may have\n-- different associated CCS procedure categories.\n\n\n\nselect\n aa.encounter_id,\n aa.normalized_code as procedure_code,\n case\n when bb.icd_10_pcs is null then 0\n\telse 1\n end as valid_icd_10_pcs_flag,\n cc.ccs_procedure_category,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom\n __dbt__cte__readmissions__stg_core__procedure aa\n left join dev_thuxuan.terminology.icd_10_pcs bb\n on aa.normalized_code = bb.icd_10_pcs\n left join dev_thuxuan.readmissions._value_set_icd_10_pcs_to_ccs cc\n on aa.normalized_code = cc.icd_10_pcs\nwhere aa.normalized_code_type = 'icd-10-pcs'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__procedure", "sql": " __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__readmission_crude": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__readmission_crude", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__readmission_crude.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "unique_id": "model.the_tuva_project.readmissions__readmission_crude", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__readmission_crude"], "alias": "_int_readmission_crude", "checksum": {"name": "sha256", "checksum": "dd90b7f771f4984ab0228ce5dee79ee271adea2f92db1129773474d2f413d53d"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_readmission_crude", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.394804, "relation_name": "dev_thuxuan.readmissions._int_readmission_crude", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we calculate readmissions using all encounters\r\n-- that have valid admit and discharge dates and no overlap.\r\n-- This is meant to give a crude sense of the readmission\r\n-- rate without taking into account all the CMS HWR logic.\r\n\r\n\r\nwith encounter_info as (\r\nselect\r\n enc.encounter_id,\r\n enc.patient_id,\r\n enc.admit_date,\r\n enc.discharge_date\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_a\r\n on enc.encounter_id = over_a.encounter_id_A\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_b\r\n on enc.encounter_id = over_b.encounter_id_B\r\nwhere\r\n admit_date is not null\r\n and\r\n discharge_date is not null\r\n and\r\n admit_date <= discharge_date\r\nand over_a.encounter_id_A is null and over_b.encounter_id_B is null\r\n ),\r\n\r\n\r\nencounter_sequence as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over(\r\n partition by patient_id order by admit_date, discharge_date\r\n ) as encounter_seq\r\nfrom encounter_info\r\n),\r\n\r\n\r\nreadmission_calc as (\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\telse 0\r\n end as had_readmission_flag,\r\n bb.admit_date - aa.discharge_date as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"bb.admit_date\", \"aa.discharge_date\", \"day\") }}) <= 30 then 1\r\n\telse 0\r\n end as readmit_30_flag\r\nfrom encounter_sequence aa left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom readmission_calc", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "compiled": true, "compiled_code": "\n\n-- Here we calculate readmissions using all encounters\n-- that have valid admit and discharge dates and no overlap.\n-- This is meant to give a crude sense of the readmission\n-- rate without taking into account all the CMS HWR logic.\n\n\nwith encounter_info as (\nselect\n enc.encounter_id,\n enc.patient_id,\n enc.admit_date,\n enc.discharge_date\nfrom dev_thuxuan.readmissions._int_encounter enc\nleft join dev_thuxuan.readmissions._int_encounter_overlap over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join dev_thuxuan.readmissions._int_encounter_overlap over_b\n on enc.encounter_id = over_b.encounter_id_B\nwhere\n admit_date is not null\n and\n discharge_date is not null\n and\n admit_date <= discharge_date\nand over_a.encounter_id_A is null and over_b.encounter_id_B is null\n ),\n\n\nencounter_sequence as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom encounter_info\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n case\n when bb.encounter_id is not null then 1\n\telse 0\n end as had_readmission_flag,\n bb.admit_date - aa.discharge_date as days_to_readmit,\n case\n when (datediff(\n day,\n bb.admit_date,\n aa.discharge_date\n )) <= 30 then 1\n\telse 0\n end as readmit_30_flag\nfrom encounter_sequence aa left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\n\n\nselect *, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__condition.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "ec76f237ade2d63b8123d7636b63abf4f719704011867479a89807a378a168b7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.4005237, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, condition_rank\r\n, normalized_code_type\r\n, claim_id\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__encounter.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__encounter", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__encounter"], "alias": "readmissions__stg_core__encounter", "checksum": {"name": "sha256", "checksum": "a95114e102c8d84943cf24d3f6ba53d56fe01f21842728423d2cc1558a9edc6e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.402517, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id,\r\n patient_id,\r\n encounter_start_date,\r\n encounter_end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n ms_drg_code,\r\n paid_amount,\r\n primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\nwhere encounter_type = 'acute inpatient'", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__procedure.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "9d7956301a9813bb6becf26522ccf9532e24dcc9cd6041cd537dd15db6227fc6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715349086.4045198, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, normalized_code_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "seed.the_tuva_project.terminology__admit_source": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__admit_source", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_source.csv", "original_file_path": "seeds\\terminology\\terminology__admit_source.csv", "unique_id": "seed.the_tuva_project.terminology__admit_source", "fqn": ["the_tuva_project", "terminology", "terminology__admit_source"], "alias": "admit_source", "checksum": {"name": "sha256", "checksum": "7068c87e74a237a6908ab4e7709afe8cfca181ad74d3e91ff9955926dc0e92ff"}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_source.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_source.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "admit_source", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.2932343, "relation_name": "dev_thuxuan.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__admit_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__admit_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_type.csv", "original_file_path": "seeds\\terminology\\terminology__admit_type.csv", "unique_id": "seed.the_tuva_project.terminology__admit_type", "fqn": ["the_tuva_project", "terminology", "terminology__admit_type"], "alias": "admit_type", "checksum": {"name": "sha256", "checksum": "8fd4b52317db368c0e056c2d0682234f2ba7017161f67dcc055b33738608f14c"}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','admit_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "admit_type", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.2999644, "relation_name": "dev_thuxuan.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ansi_fips_state": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ansi_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ansi_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ansi_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ansi_fips_state"], "alias": "ansi_fips_state", "checksum": {"name": "sha256", "checksum": "8b9ed6a3c0deef5889027408e19e785820305639d8185cbc6ff0a660266633d5"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ansi_fips_state.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ansi_fips_state.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ansi_fips_state", "tags": ["terminology", "medicare_cclf_connector"], "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.365014, "relation_name": "dev_thuxuan.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__apr_drg": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__apr_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__apr_drg.csv", "original_file_path": "seeds\\terminology\\terminology__apr_drg.csv", "unique_id": "seed.the_tuva_project.terminology__apr_drg", "fqn": ["the_tuva_project", "terminology", "terminology__apr_drg"], "alias": "apr_drg", "checksum": {"name": "sha256", "checksum": "09eb60b322cc83936cee0e221fdb694a6ab8e3dd8016c275885e126b58cb55b6"}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "medical_surgical": "varchar", "mdc_code": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','apr_drg.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','apr_drg.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "apr_drg", "tags": ["terminology", "data_profiling"], "column_types": {"apr_drg_code": "varchar", "medical_surgical": "varchar", "mdc_code": "varchar", "apr_drg_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.54562, "relation_name": "dev_thuxuan.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__bill_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__bill_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__bill_type.csv", "original_file_path": "seeds\\terminology\\terminology__bill_type.csv", "unique_id": "seed.the_tuva_project.terminology__bill_type", "fqn": ["the_tuva_project", "terminology", "terminology__bill_type"], "alias": "bill_type", "checksum": {"name": "sha256", "checksum": "398d806848f4a65fafccb3c4ad84b18f90ca269945d0121c4b81fe1b923d1627"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','bill_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','bill_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "bill_type", "tags": ["terminology", "data_profiling"], "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3146427, "relation_name": "dev_thuxuan.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__calendar": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__calendar", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__calendar.csv", "original_file_path": "seeds\\terminology\\terminology__calendar.csv", "unique_id": "seed.the_tuva_project.terminology__calendar", "fqn": ["the_tuva_project", "terminology", "terminology__calendar"], "alias": "calendar", "checksum": {"name": "sha256", "checksum": "e0e2dcef31be96e75c148c0c957eb818f563c04e71a5e7faefc8057598198671"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','calendar.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "calendar", "tags": ["terminology", "pmpm"], "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.323414, "relation_name": "dev_thuxuan.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__claim_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__claim_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__claim_type.csv", "original_file_path": "seeds\\terminology\\terminology__claim_type.csv", "unique_id": "seed.the_tuva_project.terminology__claim_type", "fqn": ["the_tuva_project", "terminology", "terminology__claim_type"], "alias": "claim_type", "checksum": {"name": "sha256", "checksum": "5e72668475091f682d6782ae0d708213ddb0a1c5c1f4e3c457132e739ceb7cb5"}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','claim_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','claim_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "claim_type", "tags": ["terminology", "data_profiling"], "column_types": {"claim_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.329412, "relation_name": "dev_thuxuan.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__code_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__code_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__code_type.csv", "original_file_path": "seeds\\terminology\\terminology__code_type.csv", "unique_id": "seed.the_tuva_project.terminology__code_type", "fqn": ["the_tuva_project", "terminology", "terminology__code_type"], "alias": "code_type", "checksum": {"name": "sha256", "checksum": "3a94151ece0a448f49b110851a7dd224fdd59207faa27d61aebe5fd5d39c51b4"}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','code_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','code_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "code_type", "tags": ["terminology", "data_profiling"], "column_types": {"code_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3347085, "relation_name": "dev_thuxuan.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__discharge_disposition": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__discharge_disposition", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__discharge_disposition.csv", "original_file_path": "seeds\\terminology\\terminology__discharge_disposition.csv", "unique_id": "seed.the_tuva_project.terminology__discharge_disposition", "fqn": ["the_tuva_project", "terminology", "terminology__discharge_disposition"], "alias": "discharge_disposition", "checksum": {"name": "sha256", "checksum": "a76af528d7f867c651a809fdc4147595eb3a4e67f813b03f856f76f86a0b585c"}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','discharge_disposition.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','discharge_disposition.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "discharge_disposition", "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3407078, "relation_name": "dev_thuxuan.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__encounter_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__encounter_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__encounter_type.csv", "original_file_path": "seeds\\terminology\\terminology__encounter_type.csv", "unique_id": "seed.the_tuva_project.terminology__encounter_type", "fqn": ["the_tuva_project", "terminology", "terminology__encounter_type"], "alias": "encounter_type", "checksum": {"name": "sha256", "checksum": "a8d2626a7aa8401d6b2c32eed1226abd92f4e3967986c9ba66006e68cfbd927d"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"encounter_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','encounter_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','encounter_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "encounter_type", "tags": ["terminology", "claims_preprocessing"], "column_types": {"encounter_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.345715, "relation_name": "dev_thuxuan.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ethnicity": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ethnicity", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ethnicity.csv", "original_file_path": "seeds\\terminology\\terminology__ethnicity.csv", "unique_id": "seed.the_tuva_project.terminology__ethnicity", "fqn": ["the_tuva_project", "terminology", "terminology__ethnicity"], "alias": "ethnicity", "checksum": {"name": "sha256", "checksum": "bcfd53e2a625f5953eddc7252d70dadd8a688413415a52484c604d7233d52dd6"}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ethnicity.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ethnicity.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ethnicity", "tags": "terminology", "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3523512, "relation_name": "dev_thuxuan.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__fips_county": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__fips_county", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__fips_county.csv", "original_file_path": "seeds\\terminology\\terminology__fips_county.csv", "unique_id": "seed.the_tuva_project.terminology__fips_county", "fqn": ["the_tuva_project", "terminology", "terminology__fips_county"], "alias": "fips_county", "checksum": {"name": "sha256", "checksum": "206c5df28096e19cfc225b0cc29b1aed721a971d84007ace9f9a839dac378080"}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','fips_county.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','fips_county.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "fips_county", "tags": "terminology", "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3584201, "relation_name": "dev_thuxuan.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__gender": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__gender", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__gender.csv", "original_file_path": "seeds\\terminology\\terminology__gender.csv", "unique_id": "seed.the_tuva_project.terminology__gender", "fqn": ["the_tuva_project", "terminology", "terminology__gender"], "alias": "gender", "checksum": {"name": "sha256", "checksum": "de9feaea8b66f7ba74845ee5fc156cdd22e8e4533de13ca76d71ac495da358ff"}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"gender": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','gender.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','gender.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "gender", "tags": ["terminology", "data_profiling"], "column_types": {"gender": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.372115, "relation_name": "dev_thuxuan.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__hcpcs_level_2", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__hcpcs_level_2.csv", "original_file_path": "seeds\\terminology\\terminology__hcpcs_level_2.csv", "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2", "fqn": ["the_tuva_project", "terminology", "terminology__hcpcs_level_2"], "alias": "hcpcs_level_2", "checksum": {"name": "sha256", "checksum": "7c204c5d21b38f16be4dfdea1167634ccb992fac1b91699e94fc4180dd902d09"}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','hcpcs_level_2.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','hcpcs_level_2.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "hcpcs_level_2", "tags": "terminology", "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.379107, "relation_name": "dev_thuxuan.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_cm": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_cm"], "alias": "icd_10_cm", "checksum": {"name": "sha256", "checksum": "26bd81ab956f24c68160aadcef4bb75551ffb125b0ecadf437f6eb0e343099fb"}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "header_flag": "varchar", "short_description": "varchar", "long_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_cm.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_10_cm": "varchar", "header_flag": "varchar", "short_description": "varchar", "long_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3877394, "relation_name": "dev_thuxuan.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_pcs": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_pcs"], "alias": "icd_10_pcs", "checksum": {"name": "sha256", "checksum": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_10_pcs.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions"], "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.392739, "relation_name": "dev_thuxuan.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_cm": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_9_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_cm"], "alias": "icd_9_cm", "checksum": {"name": "sha256", "checksum": "ed4c7e9c312522e20df88cb21837ea0953be63016bbd49c48a44f215e55353db"}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_cm.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_9_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4003592, "relation_name": "dev_thuxuan.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_pcs": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_9_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_pcs"], "alias": "icd_9_pcs", "checksum": {"name": "sha256", "checksum": "97258446a8c069119ada9e71632dd8a3f73135968cfdb38ba09109003915b525"}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','icd_9_pcs.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_9_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4064064, "relation_name": "dev_thuxuan.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__loinc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__loinc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc.csv", "original_file_path": "seeds\\terminology\\terminology__loinc.csv", "unique_id": "seed.the_tuva_project.terminology__loinc", "fqn": ["the_tuva_project", "terminology", "terminology__loinc"], "alias": "loinc", "checksum": {"name": "sha256", "checksum": "374101e8b4e4fd5038c5bcae0dca2e5fcf2992883068619e2cbadad7ea3a8e7b"}, "config": {"enabled": true, "alias": "loinc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4277859, "relation_name": "dev_thuxuan.terminology.loinc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__loinc_deprecated_mapping", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc_deprecated_mapping.csv", "original_file_path": "seeds\\terminology\\terminology__loinc_deprecated_mapping.csv", "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping", "fqn": ["the_tuva_project", "terminology", "terminology__loinc_deprecated_mapping"], "alias": "loinc_deprecated_mapping", "checksum": {"name": "sha256", "checksum": "eecd52c3944bc1abd373c557a286ee386438733c6daf2fbb844e86623f7af119"}, "config": {"enabled": true, "alias": "loinc_deprecated_mapping", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc_deprecated_mapping", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.438566, "relation_name": "dev_thuxuan.terminology.loinc_deprecated_mapping", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__mdc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__mdc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__mdc.csv", "original_file_path": "seeds\\terminology\\terminology__mdc.csv", "unique_id": "seed.the_tuva_project.terminology__mdc", "fqn": ["the_tuva_project", "terminology", "terminology__mdc"], "alias": "mdc", "checksum": {"name": "sha256", "checksum": "ff8bd52323887788765f3602e13e6083ecebee26d5b9466d118f531d46a445e3"}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mdc_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','mdc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','mdc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "mdc", "tags": "terminology", "column_types": {"mdc_code": "varchar", "mdc_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4435759, "relation_name": "dev_thuxuan.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_dual_eligibility", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_dual_eligibility.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_dual_eligibility.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_dual_eligibility"], "alias": "medicare_dual_eligibility", "checksum": {"name": "sha256", "checksum": "520243cb81b0f298c80fe446ea6c3d7b5f78d66d8caa6594e028073045210091"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_dual_eligibility", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4513872, "relation_name": "dev_thuxuan.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_orec": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_orec", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_orec.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_orec.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_orec", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_orec"], "alias": "medicare_orec", "checksum": {"name": "sha256", "checksum": "91af2feb419d4ab1b82f88a165db27a2ded30c3e3b221081dc0bebee6c9c44ed"}, "config": {"enabled": true, "alias": "medicare_orec", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_orec.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_orec.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_orec", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4573946, "relation_name": "dev_thuxuan.terminology.medicare_orec", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_status": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_status", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_status.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_status.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_status", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_status"], "alias": "medicare_status", "checksum": {"name": "sha256", "checksum": "c9d34774cf96cec7e8b301c8a965bdf320c0a03e65ffb96ba745ac3f161a2656"}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_status.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','medicare_status.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_status", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4691882, "relation_name": "dev_thuxuan.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ms_drg": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ms_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ms_drg.csv", "original_file_path": "seeds\\terminology\\terminology__ms_drg.csv", "unique_id": "seed.the_tuva_project.terminology__ms_drg", "fqn": ["the_tuva_project", "terminology", "terminology__ms_drg"], "alias": "ms_drg", "checksum": {"name": "sha256", "checksum": "d551fa50b60ab14efddee46089274d432d11570f3216db9aa6868074ace94ca2"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ms_drg.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ms_drg.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ms_drg", "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4771776, "relation_name": "dev_thuxuan.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ndc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ndc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ndc.csv", "original_file_path": "seeds\\terminology\\terminology__ndc.csv", "unique_id": "seed.the_tuva_project.terminology__ndc", "fqn": ["the_tuva_project", "terminology", "terminology__ndc"], "alias": "ndc", "checksum": {"name": "sha256", "checksum": "d53a75e4c3a87004c8cb4b4bf2368eada76e2ce9e60ad2d330420327d8fd30f2"}, "config": {"enabled": true, "alias": "ndc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ndc": "varchar", "rxcui": "varchar", "rxnorm_description": "varchar(3000)", "fda_description": "varchar(3000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ndc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "This file collects all ndcs collected by the fda and rxnorm, and compiles them into one list. The file is maintained by [CodeRX](https://coderx.io/) in partnership with Tuva Health.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ndc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ndc", "tags": ["terminology"], "column_types": {"ndc": "varchar", "rxcui": "varchar", "rxnorm_description": "varchar(3000)", "fda_description": "varchar(3000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4848506, "relation_name": "dev_thuxuan.terminology.ndc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__other_provider_taxonomy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__other_provider_taxonomy.csv", "original_file_path": "seeds\\terminology\\terminology__other_provider_taxonomy.csv", "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy", "fqn": ["the_tuva_project", "terminology", "terminology__other_provider_taxonomy"], "alias": "other_provider_taxonomy", "checksum": {"name": "sha256", "checksum": "ea344ae188db60f0f75e52a39114af49b7828fe050d3f761db03d4d07039cccf"}, "config": {"enabled": true, "alias": "other_provider_taxonomy", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "other_provider_taxonomy", "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4928844, "relation_name": "dev_thuxuan.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__payer_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__payer_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__payer_type.csv", "original_file_path": "seeds\\terminology\\terminology__payer_type.csv", "unique_id": "seed.the_tuva_project.terminology__payer_type", "fqn": ["the_tuva_project", "terminology", "terminology__payer_type"], "alias": "payer_type", "checksum": {"name": "sha256", "checksum": "282a78d9af16774f2afddfd20b98c6b5cb9fedb632a5dea1a887f0e15bafade0"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','payer_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','payer_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "payer_type", "tags": ["terminology", "data_profiling"], "column_types": {"payer_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.497883, "relation_name": "dev_thuxuan.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__place_of_service": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__place_of_service", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__place_of_service.csv", "original_file_path": "seeds\\terminology\\terminology__place_of_service.csv", "unique_id": "seed.the_tuva_project.terminology__place_of_service", "fqn": ["the_tuva_project", "terminology", "terminology__place_of_service"], "alias": "place_of_service", "checksum": {"name": "sha256", "checksum": "73979f823fbd58b0591864b102c9fbaea4459a05cc2aa4dcd3231c6a33c7ebb7"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','place_of_service.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','place_of_service.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "place_of_service", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5036597, "relation_name": "dev_thuxuan.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__present_on_admission": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__present_on_admission", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__present_on_admission.csv", "original_file_path": "seeds\\terminology\\terminology__present_on_admission.csv", "unique_id": "seed.the_tuva_project.terminology__present_on_admission", "fqn": ["the_tuva_project", "terminology", "terminology__present_on_admission"], "alias": "present_on_admission", "checksum": {"name": "sha256", "checksum": "1f17dd2ef1ccf1f8cb156ac0d4be3cf5e7e96b56bfcb97b5113d0de8aabace48"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "present_on_admit_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','present_on_admission.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','present_on_admission.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "present_on_admission", "tags": ["terminology", "data_profiling", "claims_preprocessing"], "column_types": {"present_on_admit_code": "varchar", "present_on_admit_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5106897, "relation_name": "dev_thuxuan.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__provider": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__provider", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__provider.csv", "original_file_path": "seeds\\terminology\\terminology__provider.csv", "unique_id": "seed.the_tuva_project.terminology__provider", "fqn": ["the_tuva_project", "terminology", "terminology__provider"], "alias": "provider", "checksum": {"name": "sha256", "checksum": "f88950a046cf237eda0f4b60cd8284961c4b9c59742960a8e63f7305fe89ed05"}, "config": {"enabled": true, "alias": "provider", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_provider_data/0_8_1','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_provider_data/0_8_1','provider.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "provider", "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.525075, "relation_name": "dev_thuxuan.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__race": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__race", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__race.csv", "original_file_path": "seeds\\terminology\\terminology__race.csv", "unique_id": "seed.the_tuva_project.terminology__race", "fqn": ["the_tuva_project", "terminology", "terminology__race"], "alias": "race", "checksum": {"name": "sha256", "checksum": "bcfd53e2a625f5953eddc7252d70dadd8a688413415a52484c604d7233d52dd6"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','race.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','race.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "race", "tags": ["terminology", "data_profiling"], "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.531517, "relation_name": "dev_thuxuan.terminology.race", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__revenue_center": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__revenue_center", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__revenue_center.csv", "original_file_path": "seeds\\terminology\\terminology__revenue_center.csv", "unique_id": "seed.the_tuva_project.terminology__revenue_center", "fqn": ["the_tuva_project", "terminology", "terminology__revenue_center"], "alias": "revenue_center", "checksum": {"name": "sha256", "checksum": "58bde54ea73aaaa50a0342bb8a28da19fe865ca82d3997c3297c9ad616ca9eb1"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','revenue_center.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','revenue_center.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "revenue_center", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5385363, "relation_name": "dev_thuxuan.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__rxnorm_to_atc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__rxnorm_to_atc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__rxnorm_to_atc.csv", "original_file_path": "seeds\\terminology\\terminology__rxnorm_to_atc.csv", "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc", "fqn": ["the_tuva_project", "terminology", "terminology__rxnorm_to_atc"], "alias": "rxnorm_to_atc", "checksum": {"name": "sha256", "checksum": "0c22d1d9c1cb2f26fb0a1f860a412abbc5a6f6946c473083651f4bf38bac73ca"}, "config": {"enabled": true, "alias": "rxnorm_to_atc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"rxcui": "varchar", "rxnorm_description": "varchar(3000)", "atc_1_name": "varchar", "atc_2_name": "varchar", "atc_3_name": "varchar", "atc_4_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','rxnorm_to_atc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "This file maps atc classes to rxcui. The file is maintained by [CodeRX](https://coderx.io/) in partnership with Tuva Health.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','rxnorm_to_atc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "rxnorm_to_atc", "tags": ["terminology"], "column_types": {"rxcui": "varchar", "rxnorm_description": "varchar(3000)", "atc_1_name": "varchar", "atc_2_name": "varchar", "atc_3_name": "varchar", "atc_4_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.3080938, "relation_name": "dev_thuxuan.terminology.rxnorm_to_atc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__snomed_icd_10_map": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__snomed_icd_10_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__snomed_icd_10_map.csv", "original_file_path": "seeds\\terminology\\terminology__snomed_icd_10_map.csv", "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map", "fqn": ["the_tuva_project", "terminology", "terminology__snomed_icd_10_map"], "alias": "snomed_icd_10_map", "checksum": {"name": "sha256", "checksum": "a9e5ce05b4fe9149571f87cfe6a77ef63f0f697da4f7e31a537bdc83927ee593"}, "config": {"enabled": true, "alias": "snomed_icd_10_map", "schema": "terminology", "database": null, "tags": ["terminology", "hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "varchar", "effective_time": "varchar", "active": "varchar", "module_id": "varchar", "ref_set_id": "varchar", "referenced_component_id": "varchar", "referenced_component_name": "varchar", "map_group": "varchar", "map_priority": "varchar", "map_rule": "varchar(500)", "map_advice": "varchar(500)", "map_target": "varchar", "map_target_name": "varchar", "correlation_id": "varchar", "map_category_id": "varchar", "map_category_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','snomed_icd_10_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "hcc_suspecting"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','snomed_icd_10_map.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "snomed_icd_10_map", "tags": ["terminology", "hcc_suspecting"], "column_types": {"id": "varchar", "effective_time": "varchar", "active": "varchar", "module_id": "varchar", "ref_set_id": "varchar", "referenced_component_id": "varchar", "referenced_component_name": "varchar", "map_group": "varchar", "map_priority": "varchar", "map_rule": "varchar(500)", "map_advice": "varchar(500)", "map_target": "varchar", "map_target_name": "varchar", "correlation_id": "varchar", "map_category_id": "varchar", "map_category_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5604117, "relation_name": "dev_thuxuan.terminology.snomed_icd_10_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ssa_fips_state": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ssa_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ssa_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ssa_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ssa_fips_state"], "alias": "ssa_fips_state", "checksum": {"name": "sha256", "checksum": "79a3093e6af928b718e6ac895e2b0f94fecd19d083227846626cd88ddea299f7"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ssa_fips_state.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0_8_1','ssa_fips_state.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ssa_fips_state", "tags": "terminology", "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.4623852, "relation_name": "dev_thuxuan.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_body_systems", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_body_systems"], "alias": "_value_set_dxccsr_v2023_1_body_systems", "checksum": {"name": "sha256", "checksum": "7697bf1b376e5db2c79b42edf944e29332b40b534eeaf0f379ff17439b4fb440"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"body_system": "varchar", "ccsr_parent_category": "varchar", "parent_category_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing descriptions of the top level categories used in the CCSR condition mapper.\nThis was manually exctracted from the User Guide PDF included with the DXCCSR SAS program.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true, "column_types": {"body_system": "varchar", "ccsr_parent_category": "varchar", "parent_category_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5671854, "relation_name": "dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_cleaned_map"], "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "cce1c4661615e89299e601fb26d3e3060b140864507858e5d0e8b61ea9b70c12"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the DXCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README. For each ICD-10-CM code, the table contains up to six CCSR category codes and a default CCSR category code.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5827937, "relation_name": "dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__prccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__prccsr_v2023_1_cleaned_map"], "alias": "_value_set_prccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "fd84423264c0174b1fc1e2ba23f1ac7957ef4fa7aaefcb2c45932f587b59fedf"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the PRCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_prccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.5918157, "relation_name": "dev_thuxuan.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__cms_chronic_conditions_hierarchy"], "alias": "_value_set_cms_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "3328c63a1bcb8d0813bb98a61739cb69306aa2726082b042baa377c4fb761302"}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"condition_id": "varchar", "condition": "varchar", "condition_column_name": "varchar", "chronic_condition_type": "varchar", "condition_category": "varchar", "additional_logic": "varchar", "claims_qualification": "varchar(1024)", "inclusion_type": "varchar", "code_system": "varchar", "code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\cms_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "schema": "chronic_conditions", "alias": "_value_set_cms_chronic_conditions_hierarchy", "tags": ["cms_chronic_conditions", "chronic_conditions"], "enabled": true, "column_types": {"condition_id": "varchar", "condition": "varchar", "condition_column_name": "varchar", "chronic_condition_type": "varchar", "condition_category": "varchar", "additional_logic": "varchar", "claims_qualification": "varchar(1024)", "inclusion_type": "varchar", "code_system": "varchar", "code": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6033704, "relation_name": "dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__tuva_chronic_conditions_hierarchy"], "alias": "_value_set_tuva_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "b379c992888d52f3b13270d7e804e5c5d0d1314d1039123674e6122884c37ce3"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"condition_family": "varchar", "condition": "varchar", "icd_10_cm_code": "varchar", "icd_10_cm_description": "varchar", "condition_column_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "A list of the diagnoses codes and their long and short names along with grouping logic classifying each code into a condition group and a condition family group.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\tuva_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "schema": "chronic_conditions", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "enabled": true, "column_types": {"condition_family": "varchar", "condition": "varchar", "icd_10_cm_code": "varchar", "icd_10_cm_description": "varchar", "condition_column_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6123705, "relation_name": "dev_thuxuan.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.clinical_concepts": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "clinical_concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\clinical_concepts.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\clinical_concepts.csv", "unique_id": "seed.the_tuva_project.clinical_concepts", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "clinical_concepts"], "alias": "clinical_concepts", "checksum": {"name": "sha256", "checksum": "28904352227711d78b2ffd3f5b674269b3f16f92e5eba2a8f83b8749500ea30d"}, "config": {"enabled": true, "alias": "clinical_concepts", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_id": "varchar", "concept_name": "varchar", "status": "varchar", "concept_oid": "varchar", "last_update_date": "date", "last_update_note": "varchar", "concept_type": "varchar", "content_source": "varchar(3000)", "external_source_detail": "varchar(3000)", "concept_scope": "varchar(3000)", "value_set_search_notes": "varchar(3000)", "code": "varchar", "code_description": "varchar", "coding_system_id": "varchar", "coding_system_version": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "clinical_concepts", "tags": "clinical_concept_library", "column_types": {"concept_id": "varchar", "concept_name": "varchar", "status": "varchar", "concept_oid": "varchar", "last_update_date": "date", "last_update_note": "varchar", "concept_type": "varchar", "content_source": "varchar(3000)", "external_source_detail": "varchar(3000)", "concept_scope": "varchar(3000)", "value_set_search_notes": "varchar(3000)", "code": "varchar", "code_description": "varchar", "coding_system_id": "varchar", "coding_system_version": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6257567, "relation_name": "dev_thuxuan.clinical_concept_library.clinical_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.coding_systems": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "coding_systems", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\coding_systems.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\coding_systems.csv", "unique_id": "seed.the_tuva_project.coding_systems", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "coding_systems"], "alias": "coding_systems", "checksum": {"name": "sha256", "checksum": "2468b8aad4f2ee3fe8043f55d2cfde2203aefb7fa7d959b9e63d138361bdafae"}, "config": {"enabled": true, "alias": "coding_systems", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coding_system_id": "varchar", "coding_system_name": "varchar", "coding_system_uri": "varchar", "coding_system_oid": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_coding_systems.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_coding_systems.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "coding_systems", "tags": "clinical_concept_library", "column_types": {"coding_system_id": "varchar", "coding_system_name": "varchar", "coding_system_uri": "varchar", "coding_system_oid": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.643566, "relation_name": "dev_thuxuan.clinical_concept_library.coding_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.value_set_members": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "value_set_members", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\value_set_members.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\value_set_members.csv", "unique_id": "seed.the_tuva_project.value_set_members", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "value_set_members"], "alias": "value_set_members", "checksum": {"name": "sha256", "checksum": "066f2f31496a1d94f83040789f89b512753bda8edc902a24a183ddadfcc305df"}, "config": {"enabled": true, "alias": "value_set_members", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"value_set_member_id": "varchar", "concept_id": "varchar", "status": "varchar", "last_update_date": "date", "last_update_note": "varchar", "code": "varchar", "code_description": "varchar(2000)", "coding_system_id": "varchar", "coding_system_version": "varchar", "include_descendants": "varchar", "comment": "varchar(2000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_value_set_members.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','tuva_value_set_members.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "value_set_members", "tags": "clinical_concept_library", "column_types": {"value_set_member_id": "varchar", "concept_id": "varchar", "status": "varchar", "last_update_date": "date", "last_update_note": "varchar", "code": "varchar", "code_description": "varchar(2000)", "coding_system_id": "varchar", "coding_system_version": "varchar", "include_descendants": "varchar", "comment": "varchar(2000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6365721, "relation_name": "dev_thuxuan.clinical_concept_library.value_set_members", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__adjustment_rates", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__adjustment_rates"], "alias": "_value_set_adjustment_rates", "checksum": {"name": "sha256", "checksum": "51bc7577f57c9638cdc72ca40f108301756eb831a01345b7763c38bfbb869b4a"}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "payment_year": "varchar", "normalization_factor": "varchar", "ma_coding_pattern_adjustment": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_adjustment_rates", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "payment_year": "varchar", "normalization_factor": "varchar", "ma_coding_pattern_adjustment": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6513157, "relation_name": "dev_thuxuan.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__cpt_hcpcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__cpt_hcpcs"], "alias": "_value_set_cpt_hcpcs", "checksum": {"name": "sha256", "checksum": "511389c6e0558d00efb8c3cae2123a46f97e616d26bdf7b8a331670f857b1ac8"}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cpt_hcpcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "CPT/HCPCS encounter filtering included list by payment year. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cpt_hcpcs.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_cpt_hcpcs", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6583197, "relation_name": "dev_thuxuan.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__demographic_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__demographic_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__demographic_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__demographic_factors"], "alias": "_value_set_demographic_factors", "checksum": {"name": "sha256", "checksum": "b3bbcb21143941da7dc41c5ca2f68d4cbe180920e344ea1dded30722b7193c84"}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "plan_segment": "varchar", "gender": "varchar", "age_group": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_demographic_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "plan_segment": "varchar", "gender": "varchar", "age_group": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6709206, "relation_name": "dev_thuxuan.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disabled_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disabled_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disabled_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disabled_interaction_factors"], "alias": "_value_set_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "b2e6ac06c8ef6087ff21d9aa2b868cdddca29fda8fc8346563c81a56f0e97f2a"}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease and disabled interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disabled_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6799092, "relation_name": "dev_thuxuan.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disease_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_factors"], "alias": "_value_set_disease_factors", "checksum": {"name": "sha256", "checksum": "64c15ace094f384cb6a38b0a0c67a0216f8eb2ef0e00cd8fc7537e9fd1a85f7f"}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "hcc_code": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disease_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "hcc_code": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6905885, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_hierarchy"], "alias": "_value_set_disease_hierarchy", "checksum": {"name": "sha256", "checksum": "48982402067756cdefe3729778775b1868734dacdc88f44407971aa120586468"}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_hierarchy", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.6945915, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_interaction_factors"], "alias": "_value_set_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "a2f6c69a63ed5c43e250b356ea308285effbb38643d732404f8e4277fe649a00"}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disease_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.7073991, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__enrollment_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__enrollment_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__enrollment_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__enrollment_interaction_factors"], "alias": "_value_set_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "8ff088e57fc620bde58a0e1707097011e249e3b2c65f1b1754da0cb6a0c3fa09"}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "gender": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "institutional_status": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_enrollment_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "gender": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "institutional_status": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.7171054, "relation_name": "dev_thuxuan.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__icd_10_cm_mappings", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__icd_10_cm_mappings"], "alias": "_value_set_icd_10_cm_mappings", "checksum": {"name": "sha256", "checksum": "03dda989fc2f10b3741665515d73d2352b52061d605ddf7fef318b53b1a24a57"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar", "cms_hcc_v28": "varchar", "cms_hcc_v28_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_icd_10_cm_mappings", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar", "cms_hcc_v28": "varchar", "cms_hcc_v28_flag": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.725774, "relation_name": "dev_thuxuan.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__payment_hcc_count_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__payment_hcc_count_factors"], "alias": "_value_set_payment_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "bf87f7657286107fa26c903a7ed24a2e8d39ca5fbd8869ee778adecb91bb2431"}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "payment_hcc_count": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Payment HCC count factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_payment_hcc_count_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "payment_hcc_count": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.735549, "relation_name": "dev_thuxuan.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.data_quality__test_catalog": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__test_catalog", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\data_quality\\data_quality__test_catalog.csv", "original_file_path": "seeds\\value_sets\\data_quality\\data_quality__test_catalog.csv", "unique_id": "seed.the_tuva_project.data_quality__test_catalog", "fqn": ["the_tuva_project", "value_sets", "data_quality", "data_quality__test_catalog"], "alias": "_value_set_test_catalog", "checksum": {"name": "sha256", "checksum": "39cef0b51c7a0c811782d01c67071b04b89e9ffd55672da9bbae154ada688997"}, "config": {"enabled": true, "alias": "_value_set_test_catalog", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "test_field": "varchar", "claim_type": "varchar", "pipeline_test": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','data_quality_test_catalog.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\data_quality\\data_quality__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','data_quality_test_catalog.csv',compression=true,null_marker=true) }}", "schema": "data_quality", "alias": "_value_set_test_catalog", "tags": ["data_quality", "claims_preprocessing"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "test_field": "varchar", "claim_type": "varchar", "pipeline_test": "integer"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.745549, "relation_name": "dev_thuxuan.data_quality._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__categories": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__categories.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__categories.csv", "unique_id": "seed.the_tuva_project.ed_classification__categories", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__categories"], "alias": "_value_set_categories", "checksum": {"name": "sha256", "checksum": "cf0576acd61cdf96595d8efb636ca9fa6812aa88ea934ab70f7cffe1241f4c2f"}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"classification": "varchar", "classification_name": "varchar", "classification_order": "varchar", "classification_column": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','ed_classification_categories.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A mapping of ED Classifications to human readable names", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','ed_classification_categories.csv',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_categories", "tags": "ed_classification", "enabled": true, "column_types": {"classification": "varchar", "classification_name": "varchar", "classification_order": "varchar", "classification_column": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8153517, "relation_name": "dev_thuxuan.ed_classification._value_set_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "ed_classification", "enabled": true, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.822875, "relation_name": "dev_thuxuan.ed_classification._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__johnston_icd10", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd10"], "alias": "_value_set_johnston_icd10", "checksum": {"name": "sha256", "checksum": "86d77b4087f009aa80ba4a6ea7e1977c1230d6067ef4538b3a5cc0249e65657b"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd10", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd10": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "noner": "varchar", "epct": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd10',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd10": {"name": "icd10", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd10',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_johnston_icd10", "tags": "ed_classification", "enabled": true, "column_types": {"icd10": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "noner": "varchar", "epct": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8479078, "relation_name": "dev_thuxuan.ed_classification._value_set_johnston_icd10", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__johnston_icd9", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd9"], "alias": "_value_set_johnston_icd9", "checksum": {"name": "sha256", "checksum": "77255f5ce0469f045a941b092e3ec84002afb0d3dabfc3d24acb0cfe29d90829"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd9": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "epct": "varchar", "noner": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd9',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd9": {"name": "icd9", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','johnston_icd9',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_johnston_icd9", "tags": "ed_classification", "enabled": true, "column_types": {"icd9": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "epct": "varchar", "noner": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8354003, "relation_name": "dev_thuxuan.ed_classification._value_set_johnston_icd9", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__clinical_concepts": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__clinical_concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__clinical_concepts.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__clinical_concepts.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__clinical_concepts"], "alias": "_value_set_clinical_concepts", "checksum": {"name": "sha256", "checksum": "e130e1696ce203c3c7faec7efadfc972c4e7502553190544a2077b4c2817ac75"}, "config": {"enabled": true, "alias": "_value_set_clinical_concepts", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Value sets for clinical concepts.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_clinical_concepts", "tags": "hcc_suspecting", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8671372, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_clinical_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__hcc_descriptions", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__hcc_descriptions.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__hcc_descriptions.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__hcc_descriptions"], "alias": "_value_set_hcc_descriptions", "checksum": {"name": "sha256", "checksum": "7e7ac940d8a7da977e3e33e93d6690af3d6b36c8791fb14a10f06beb8f3f779f"}, "config": {"enabled": true, "alias": "_value_set_hcc_descriptions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hcc_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_hcc_descriptions", "tags": "hcc_suspecting", "enabled": true, "column_types": {"hcc_code": "varchar", "hcc_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8731368, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__icd_10_cm_mappings", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__icd_10_cm_mappings.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__icd_10_cm_mappings.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__icd_10_cm_mappings"], "alias": "_value_set_icd_10_cm_mappings", "checksum": {"name": "sha256", "checksum": "2d5d504da80762d6e23c1d61b5ba3ad0d50ab964d5dd914af92570aa536104a9"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"diagnosis_code": "varchar", "cms_hcc_esrd_v21": "varchar", "cms_hcc_esrd_v24": "varchar", "cms_hcc_v22": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v28": "varchar", "rx_hcc_v05": "varchar", "rx_hcc_v08": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_icd_10_cm_mappings", "tags": "hcc_suspecting", "enabled": true, "column_types": {"diagnosis_code": "varchar", "cms_hcc_esrd_v21": "varchar", "cms_hcc_esrd_v24": "varchar", "cms_hcc_v22": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v28": "varchar", "rx_hcc_v05": "varchar", "rx_hcc_v08": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.8838818, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__concepts": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__concepts.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__concepts.csv", "unique_id": "seed.the_tuva_project.quality_measures__concepts", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__concepts"], "alias": "_value_set_concepts", "checksum": {"name": "sha256", "checksum": "327c96bdd4582e91ea0c6f7f2b9641eba1e3973dab46402760c175af6e3987a8"}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "measure_id": "varchar", "measure_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_concepts.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_concepts", "tags": "quality_measures", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "measure_id": "varchar", "measure_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.891883, "relation_name": "dev_thuxuan.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__measures": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__measures", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__measures.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__measures.csv", "unique_id": "seed.the_tuva_project.quality_measures__measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__measures"], "alias": "_value_set_measures", "checksum": {"name": "sha256", "checksum": "ffba1ed18ece6d32fe634f279e2833b355b51c66691ef06db717ee4ebb257992"}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "varchar", "name": "varchar", "description": "varchar", "version": "varchar", "steward": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_measures.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_measures.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_measures", "tags": "quality_measures", "enabled": true, "column_types": {"id": "varchar", "name": "varchar", "description": "varchar", "version": "varchar", "steward": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9003894, "relation_name": "dev_thuxuan.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__value_sets": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__value_sets", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__value_sets.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__value_sets.csv", "unique_id": "seed.the_tuva_project.quality_measures__value_sets", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__value_sets"], "alias": "_value_set_codes", "checksum": {"name": "sha256", "checksum": "e130e1696ce203c3c7faec7efadfc972c4e7502553190544a2077b4c2817ac75"}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_value_set_codes.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','quality_measures_value_set_codes.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_codes", "tags": "quality_measures", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.907412, "relation_name": "dev_thuxuan.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__acute_diagnosis_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_ccs"], "alias": "_value_set_acute_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "e947ff0e7faffc92d8c129ee41271241fb9e43c5f3249f18403fe20faa9be669"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_acute_diagnosis_ccs", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.913397, "relation_name": "dev_thuxuan.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__acute_diagnosis_icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_icd_10_cm"], "alias": "_value_set_acute_diagnosis_icd_10_cm", "checksum": {"name": "sha256", "checksum": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_acute_diagnosis_icd_10_cm", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.920075, "relation_name": "dev_thuxuan.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__always_planned_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_diagnosis_category"], "alias": "_value_set_always_planned_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "1bfbe31c1b65d38e97936d54fa477faf6b189e69e7659499bce52ab8e85fa82e"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9247847, "relation_name": "dev_thuxuan.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__always_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_procedure_category"], "alias": "_value_set_always_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "cfb84522da7baa39ff06dd37fbab4677b01ef87969039775a9708f70353a99b3"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.928797, "relation_name": "dev_thuxuan.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__exclusion_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__exclusion_ccs_diagnosis_category"], "alias": "_value_set_exclusion_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "ed6c92b04b1d9b79a34ed80022e4192f2394510f57fd0b4121a8e31a30198d70"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_exclusion_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9364924, "relation_name": "dev_thuxuan.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9434905, "relation_name": "dev_thuxuan.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__icd_10_pcs_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_pcs_to_ccs"], "alias": "_value_set_icd_10_pcs_to_ccs", "checksum": {"name": "sha256", "checksum": "b152259e1a13057a37cf15ae765f61c7c9559340b5469fa93909ad910929fd0e"}, "config": {"enabled": true, "alias": "_value_set_icd_10_pcs_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_pcs_to_ccs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.951263, "relation_name": "dev_thuxuan.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__potentially_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_ccs_procedure_category"], "alias": "_value_set_potentially_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "d46cf571e714e7ddb997c7be419b496c51d9e7ce0342d72be61d06fc0bf55669"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_potentially_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9572778, "relation_name": "dev_thuxuan.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__potentially_planned_icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_icd_10_pcs"], "alias": "_value_set_potentially_planned_icd_10_pcs", "checksum": {"name": "sha256", "checksum": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_potentially_planned_icd_10_pcs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9632783, "relation_name": "dev_thuxuan.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__specialty_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__specialty_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__specialty_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__specialty_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__specialty_cohort"], "alias": "_value_set_specialty_cohort", "checksum": {"name": "sha256", "checksum": "c1d715929a890fd44e1d5ad4aa89785523f221ce8f5ae8765c11a0e524426a45"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','specialty_cohort.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','specialty_cohort.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_specialty_cohort", "tags": "readmissions", "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9709852, "relation_name": "dev_thuxuan.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__surgery_gynecology_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__surgery_gynecology_cohort"], "alias": "_value_set_surgery_gynecology_cohort", "checksum": {"name": "sha256", "checksum": "ba95843249cbc3167b4887251bf4efbecb2418fe086791e2c428d5748b0e4167"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_surgery_gynecology_cohort", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9779825, "relation_name": "dev_thuxuan.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__service_categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\service_categories\\service_category__service_categories.csv", "original_file_path": "seeds\\value_sets\\service_categories\\service_category__service_categories.csv", "unique_id": "seed.the_tuva_project.service_category__service_categories", "fqn": ["the_tuva_project", "value_sets", "service_categories", "service_category__service_categories"], "alias": "_value_set_service_categories", "checksum": {"name": "sha256", "checksum": "07a3a74f961c5a75143dbd6a0da9c8db46985bc07021c8ad351627b10faa6659"}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "claims_preprocessing", "database": null, "tags": ["service_category", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"service_category_1": "varchar", "service_category_2": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','service_category_service_categories.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["service_category", "claims_preprocessing"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\service_categories\\service_categories_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0_8_1','service_category_service_categories.csv',compression=true,null_marker=true) }}", "schema": "claims_preprocessing", "alias": "_value_set_service_categories", "tags": ["service_category", "claims_preprocessing"], "enabled": true, "column_types": {"service_category_1": "varchar", "service_category_2": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715349084.9836745, "relation_name": "dev_thuxuan.claims_preprocessing._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd9_icd9"], "alias": "unique_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349084.8549254, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd9 as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd9\nwhere icd9 is not null\ngroup by icd9\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd9_icd9"], "alias": "not_null_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349084.8559284, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd9\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd9\nwhere icd9 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd10_icd10"], "alias": "unique_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349084.8569283, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd10 as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd10\nwhere icd10 is not null\ngroup by icd10\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd10_icd10"], "alias": "not_null_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349084.8579283, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd10\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd10\nwhere icd10 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "fqn": ["the_tuva_project", "ccsr", "not_null_ccsr__singular_condition_category_claim_id"], "alias": "not_null_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349085.0151124, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b", "fqn": ["the_tuva_project", "ccsr", "unique_ccsr__singular_condition_category_claim_id"], "alias": "unique_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349085.017219, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n claim_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ccsr.singular_condition_category\nwhere claim_id is not null\ngroup by claim_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1715349085.0850394, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1715349085.086037, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id"], "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1715349085.0880263, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id"], "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1715349085.089032, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_condition"], "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1715349085.0900292, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_"], "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1715349085.0910358, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || claim_id || start_date || condition) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere (patient_id || claim_id || start_date || condition) is not null\ngroup by (patient_id || claim_id || start_date || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id"], "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1715349085.0920284, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id"], "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1715349085.0940375, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_condition"], "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1715349085.0950377, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id"], "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1715349085.0960302, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id"], "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1715349085.0970318, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition"], "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1715349085.0986264, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_"], "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1715349085.099633, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id"], "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1715349085.1087246, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id"], "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1715349085.1097255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_condition"], "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1715349085.1107242, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_"], "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1715349085.1117463, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Opioid Use Disorder (OUD)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_"], "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1715349085.1514697, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || condition) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere (patient_id || '_' || condition) is not null\ngroup by (patient_id || '_' || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1715349085.1534784, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1715349085.154475, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('normalized_input__medical_claim')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_normalized_input__medical_claim__claim_id_claim_line_number_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46.sql", "original_file_path": "models\\claims_preprocessing\\claims_preprocessing_models.yml", "unique_id": "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f", "fqn": ["the_tuva_project", "claims_preprocessing", "unique_normalized_input__medical_claim__claim_id_claim_line_number_"], "alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46"}, "created_at": 1715349085.4892647, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46\") }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\claims_preprocessing_models.yml\\unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (claim_id||'-'||claim_line_number) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere (claim_id||'-'||claim_line_number) is not null\ngroup by (claim_id||'-'||claim_line_number)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.normalized_input__medical_claim", "attached_node": "model.the_tuva_project.normalized_input__medical_claim"}, "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__patient_risk_scores')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__patient_risk_scores_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__patient_risk_scores_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__patient_risk_scores_patient_id"], "alias": "unique_cms_hcc__patient_risk_scores_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.5688434, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc.patient_risk_scores\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores", "attached_node": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id||'-'||model_version)", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_demographic_factors__patient_id_model_version_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors__patient_id_model_version_"], "alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87"}, "created_at": 1715349085.570856, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87\") }}", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id||'-'||model_version) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc._int_demographic_factors\nwhere (patient_id||'-'||model_version) is not null\ngroup by (patient_id||'-'||model_version)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.cms_hcc__int_demographic_factors", "attached_node": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_eligible_conditions_condition_code", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_eligible_conditions_condition_code"], "alias": "not_null_cms_hcc__int_eligible_conditions_condition_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.571841, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_code\nfrom dev_thuxuan.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions", "attached_node": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_members_patient_id"], "alias": "not_null_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.5728564, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_members_patient_id"], "alias": "unique_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.574855, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc._int_members\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "condition_id", "model": "{{ get_where_subquery(ref('core__condition')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__condition_condition_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__condition_condition_id.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0", "fqn": ["the_tuva_project", "core", "unique_core__condition_condition_id"], "alias": "unique_core__condition_condition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.7400234, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__condition_condition_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n condition_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.condition\nwhere condition_id is not null\ngroup by condition_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_id", "file_key_name": "models.core__condition", "attached_node": "model.the_tuva_project.core__condition"}, "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('core__medical_claim')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__medical_claim__claim_id_claim_line_number_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__medical_claim__claim_id_claim_line_number_.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0", "fqn": ["the_tuva_project", "core", "unique_core__medical_claim__claim_id_claim_line_number_"], "alias": "unique_core__medical_claim__claim_id_claim_line_number_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.7410233, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__medical_claim__claim_id_claim_line_number_.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (claim_id||'-'||claim_line_number) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.medical_claim\nwhere (claim_id||'-'||claim_line_number) is not null\ngroup by (claim_id||'-'||claim_line_number)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.core__medical_claim", "attached_node": "model.the_tuva_project.core__medical_claim"}, "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(ref('core__procedure')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__procedure_procedure_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__procedure_procedure_id.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5", "fqn": ["the_tuva_project", "core", "unique_core__procedure_procedure_id"], "alias": "unique_core__procedure_procedure_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.7430234, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__procedure_procedure_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n procedure_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.procedure\nwhere procedure_id is not null\ngroup by procedure_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "procedure_id", "file_key_name": "models.core__procedure", "attached_node": "model.the_tuva_project.core__procedure"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_summary_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_summary_source_table"], "alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10"}, "created_at": 1715349085.853526, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_summary\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_summary_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_summary_test_category"], "alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477"}, "created_at": 1715349085.8545249, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_summary\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": {"test_metadata": {"name": "claims_preprocessing_pipeline_checks", "kwargs": {"model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_", "resource_type": "test", "package_name": "the_tuva_project", "path": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_"], "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c"}, "created_at": 1715349085.856549, "relation_name": null, "raw_code": "{{ test_claims_preprocessing_pipeline_checks(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.test_claims_preprocessing_pipeline_checks", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c.sql", "compiled": true, "compiled_code": "\n\n select *\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where pipeline_test = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_source_table"], "alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08"}, "created_at": 1715349085.8605504, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_test_category"], "alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80"}, "created_at": 1715349085.861538, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_test_name"], "alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049"}, "created_at": 1715349085.8625546, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__412833294baa145f20c48137d8814886.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_source_table"], "alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886"}, "created_at": 1715349085.8635561, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__412833294baa145f20c48137d8814886\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__412833294baa145f20c48137d8814886.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_test_category"], "alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367"}, "created_at": 1715349085.8650358, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_test_name"], "alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49"}, "created_at": 1715349085.866061, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "use_case", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_use_case", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims_preprocessing_use_case_use_case.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_use_case"], "alias": "not_null_data_quality__claims_preprocessing_use_case_use_case", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.8680856, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims_preprocessing_use_case_use_case.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect use_case\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere use_case is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "use_case", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_source_table"], "alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37"}, "created_at": 1715349085.8691425, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims_preprocessing_use_case_test_name.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_test_name"], "alias": "not_null_data_quality__claims_preprocessing_use_case_test_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715349085.8701365, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims_preprocessing_use_case_test_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month || '_' || plan)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "original_file_path": "models\\financial_pmpm\\financial_pmpm_models.yml", "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_"], "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf"}, "created_at": 1715349085.965246, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf\") }}", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || year_month || '_' || plan) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.financial_pmpm.pmpm_prep\nwhere (patient_id || '_' || year_month || '_' || plan) is not null\ngroup by (patient_id || '_' || year_month || '_' || plan)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep", "attached_node": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__condition')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__condition_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__condition_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__condition_patient_id"], "alias": "not_null_quality_measures__stg_core__condition_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3090858, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__condition_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__condition\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition", "attached_node": "model.the_tuva_project.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__encounter_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__encounter_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__encounter_patient_id"], "alias": "not_null_quality_measures__stg_core__encounter_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.310103, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__encounter_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__encounter\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter", "attached_node": "model.the_tuva_project.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__medication_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__medication_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__medication_patient_id"], "alias": "not_null_quality_measures__stg_core__medication_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3121195, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__medication_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__medication\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication", "attached_node": "model.the_tuva_project.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__observation_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__observation_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__observation_patient_id"], "alias": "not_null_quality_measures__stg_core__observation_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3130834, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__observation_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__observation\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation", "attached_node": "model.the_tuva_project.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_patient_id"], "alias": "not_null_quality_measures__stg_core__patient_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3146727, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_sex", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_sex.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_sex"], "alias": "not_null_quality_measures__stg_core__patient_sex", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3167667, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select sex\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere sex is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male", "unknown"], "column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b", "fqn": ["the_tuva_project", "quality_measures", "accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown"], "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae"}, "created_at": 1715349086.3187597, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae.sql", "compiled": true, "compiled_code": "\n \n \n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),all_values as (\n\n select\n sex as value_field,\n count(*) as n_records\n\n from __dbt__cte__quality_measures__stg_core__patient\n group by sex\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'female','male','unknown'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_birth_date", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_birth_date.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_birth_date"], "alias": "not_null_quality_measures__stg_core__patient_birth_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.3227663, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_birth_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select birth_date\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere birth_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__procedure_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__procedure_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__procedure_patient_id"], "alias": "not_null_quality_measures__stg_core__procedure_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715349086.324354, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__procedure_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__procedure\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-10 13:57:27.457245+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure", "attached_node": "model.the_tuva_project.quality_measures__stg_core__procedure"}}, "sources": {}, "macros": {"macro.input_layer.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\generate_schema_name.sql", "original_file_path": "../macros\\generate_schema_name.sql", "unique_id": "macro.input_layer.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\r\n {%- set default_schema = target.schema -%}\r\n {%- if custom_schema_name is not none -%}\r\n {{ custom_schema_name | trim }}\r\n {%- else -%}\r\n {{ default_schema }}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.318191, "supported_languages": null}, "macro.input_layer.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3201892, "supported_languages": null}, "macro.input_layer.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.bigquery__try_to_cast_date", "macro_sql": "{%- macro bigquery__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n safe_cast( date( {{ column_name }} ) as date )\r\n {%- else -%}\r\n safe_cast( {{ column_name }} as date )\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3211908, "supported_languages": null}, "macro.input_layer.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.default__try_to_cast_date", "macro_sql": "{%- macro default__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3211908, "supported_languages": null}, "macro.input_layer.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.postgres__try_to_cast_date", "macro_sql": "{%- macro postgres__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}[0-9]{2}[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{2}/[0-9]{2}/[0-9]{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3211908, "supported_languages": null}, "macro.input_layer.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.redshift__try_to_cast_date", "macro_sql": "{%- macro redshift__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}\\\\d{2}\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{2}/\\\\d{2}/\\\\d{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2} \\\\d{2}:\\\\d{2}:\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.32219, "supported_languages": null}, "macro.input_layer.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.snowflake__try_to_cast_date", "macro_sql": "{%- macro snowflake__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3231907, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"name": "snowflake__create_table_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {% set compiled_code = get_select_subquery(compiled_code) %}\n {% endif %}\n {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from (\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery", "macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.338698, "supported_languages": null}, "macro.dbt_snowflake.get_column_comment_sql": {"name": "get_column_comment_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_column_comment_sql", "macro_sql": "{% macro get_column_comment_sql(column_name, column_dict) -%}\n {% if (column_name|upper in column_dict) -%}\n {% set matched_column = column_name|upper -%}\n {% elif (column_name|lower in column_dict) -%}\n {% set matched_column = column_name|lower -%}\n {% elif (column_name in column_dict) -%}\n {% set matched_column = column_name -%}\n {% else -%}\n {% set matched_column = None -%}\n {% endif -%}\n {% if matched_column -%}\n {{ adapter.quote(column_name) }} COMMENT $${{ column_dict[matched_column]['description'] | replace('$', '[$]') }}$$\n {%- else -%}\n {{ adapter.quote(column_name) }} COMMENT $$$$\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3396974, "supported_languages": null}, "macro.dbt_snowflake.get_persist_docs_column_list": {"name": "get_persist_docs_column_list", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_persist_docs_column_list", "macro_sql": "{% macro get_persist_docs_column_list(model_columns, query_columns) %}\n(\n {% for column_name in query_columns %}\n {{ get_column_comment_sql(column_name, model_columns) }}\n {{- \", \" if not loop.last else \"\" }}\n {% endfor %}\n)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3396974, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag": {"name": "snowflake__create_view_as_with_temp_flag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro_sql": "{% macro snowflake__create_view_as_with_temp_flag(relation, sql, is_temporary=False) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} {% if is_temporary -%}\n temporary\n {%- endif %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list", "macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3416967, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as": {"name": "snowflake__create_view_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as", "macro_sql": "{% macro snowflake__create_view_as(relation, sql) -%}\n {{ snowflake__create_view_as_with_temp_flag(relation, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3416967, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_columns_in_relation": {"name": "snowflake__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_columns_in_relation", "macro_sql": "{% macro snowflake__get_columns_in_relation(relation) -%}\n {%- set sql -%}\n describe table {{ relation }}\n {%- endset -%}\n {%- set result = run_query(sql) -%}\n\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many columns in relation {{ relation }}! dbt can only get\n information about relations with fewer than {{ maximum }} columns.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% set columns = [] %}\n {% for row in result %}\n {% do columns.append(api.Column.from_description(row['name'], row['type'])) %}\n {% endfor %}\n {% do return(columns) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3426971, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_schemas": {"name": "snowflake__list_schemas", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_schemas", "macro_sql": "{% macro snowflake__list_schemas(database) -%}\n {# 10k limit from here: https://docs.snowflake.net/manuals/sql-reference/sql/show-schemas.html#usage-notes #}\n {% set maximum = 10000 %}\n {% set sql -%}\n show terse schemas in database {{ database }}\n limit {{ maximum }}\n {%- endset %}\n {% set result = run_query(sql) %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in database {{ database }}! dbt can only get\n information about databases with fewer than {{ maximum }} schemas.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {{ return(result) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3426971, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"name": "snowflake__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many objects in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.343697, "supported_languages": null}, "macro.dbt_snowflake.snowflake__check_schema_exists": {"name": "snowflake__check_schema_exists", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__check_schema_exists", "macro_sql": "{% macro snowflake__check_schema_exists(information_schema, schema) -%}\n {% call statement('check_schema_exists', fetch_result=True) -%}\n select count(*)\n from {{ information_schema }}.schemata\n where upper(schema_name) = upper('{{ schema }}')\n and upper(catalog_name) = upper('{{ information_schema.database }}')\n {%- endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.344697, "supported_languages": null}, "macro.dbt_snowflake.snowflake__rename_relation": {"name": "snowflake__rename_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__rename_relation", "macro_sql": "{% macro snowflake__rename_relation(from_relation, to_relation) -%}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ to_relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.344697, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_type": {"name": "snowflake__alter_column_type", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_column_type", "macro_sql": "{% macro snowflake__alter_column_type(relation, column_name, new_column_type) -%}\n {% call statement('alter_column_type') %}\n alter table {{ relation }} alter {{ adapter.quote(column_name) }} set data type {{ new_column_type }};\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.344697, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_comment": {"name": "snowflake__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_relation_comment", "macro_sql": "{% macro snowflake__alter_relation_comment(relation, relation_comment) -%}\n comment on {{ relation.type }} {{ relation }} IS $${{ relation_comment | replace('$', '[$]') }}$$;\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.344697, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_comment": {"name": "snowflake__alter_column_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_column_comment", "macro_sql": "{% macro snowflake__alter_column_comment(relation, column_dict) -%}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n alter {{ relation.type }} {{ relation }} alter\n {% for column_name in existing_columns if (column_name in existing_columns) or (column_name|lower in existing_columns) %}\n {{ get_column_comment_sql(column_name, column_dict) }} {{- ',' if not loop.last else ';' }}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3456972, "supported_languages": null}, "macro.dbt_snowflake.get_current_query_tag": {"name": "get_current_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_current_query_tag", "macro_sql": "{% macro get_current_query_tag() -%}\n {{ return(run_query(\"show parameters like 'query_tag' in session\").rows[0]['value']) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3456972, "supported_languages": null}, "macro.dbt_snowflake.set_query_tag": {"name": "set_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.set_query_tag", "macro_sql": "{% macro set_query_tag() -%}\n {{ return(adapter.dispatch('set_query_tag', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__set_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3466973, "supported_languages": null}, "macro.dbt_snowflake.snowflake__set_query_tag": {"name": "snowflake__set_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__set_query_tag", "macro_sql": "{% macro snowflake__set_query_tag() -%}\n {% set new_query_tag = config.get('query_tag') %}\n {% if new_query_tag %}\n {% set original_query_tag = get_current_query_tag() %}\n {{ log(\"Setting query_tag to '\" ~ new_query_tag ~ \"'. Will reset to '\" ~ original_query_tag ~ \"' after materialization.\") }}\n {% do run_query(\"alter session set query_tag = '{}'\".format(new_query_tag)) %}\n {{ return(original_query_tag)}}\n {% endif %}\n {{ return(none)}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_current_query_tag", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3466973, "supported_languages": null}, "macro.dbt_snowflake.unset_query_tag": {"name": "unset_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.unset_query_tag", "macro_sql": "{% macro unset_query_tag(original_query_tag) -%}\n {{ return(adapter.dispatch('unset_query_tag', 'dbt')(original_query_tag)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3466973, "supported_languages": null}, "macro.dbt_snowflake.snowflake__unset_query_tag": {"name": "snowflake__unset_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__unset_query_tag", "macro_sql": "{% macro snowflake__unset_query_tag(original_query_tag) -%}\n {% set new_query_tag = config.get('query_tag') %}\n {% if new_query_tag %}\n {% if original_query_tag %}\n {{ log(\"Resetting query_tag to '\" ~ original_query_tag ~ \"'.\") }}\n {% do run_query(\"alter session set query_tag = '{}'\".format(original_query_tag)) %}\n {% else %}\n {{ log(\"No original query_tag, unsetting parameter.\") }}\n {% do run_query(\"alter session unset query_tag\") %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3482008, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns": {"name": "snowflake__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns", "macro_sql": "{% macro snowflake__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {% for column in add_columns %}\n {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n {% endif %}\n\n {% if remove_columns %}\n\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {% for column in remove_columns %}\n {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3492079, "supported_languages": null}, "macro.dbt_snowflake.snowflake_dml_explicit_transaction": {"name": "snowflake_dml_explicit_transaction", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake_dml_explicit_transaction", "macro_sql": "{% macro snowflake_dml_explicit_transaction(dml) %}\n {#\n Use this macro to wrap all INSERT, MERGE, UPDATE, DELETE, and TRUNCATE\n statements before passing them into run_query(), or calling in the 'main' statement\n of a materialization\n #}\n {% set dml_transaction -%}\n begin;\n {{ dml }};\n commit;\n {%- endset %}\n\n {% do return(dml_transaction) %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3492079, "supported_languages": null}, "macro.dbt_snowflake.snowflake__truncate_relation": {"name": "snowflake__truncate_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__truncate_relation", "macro_sql": "{% macro snowflake__truncate_relation(relation) -%}\n {% set truncate_dml %}\n truncate table {{ relation }}\n {% endset %}\n {% call statement('truncate_relation') -%}\n {{ snowflake_dml_explicit_transaction(truncate_dml) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3502162, "supported_languages": null}, "macro.dbt_snowflake.snowflake__copy_grants": {"name": "snowflake__copy_grants", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\apply_grants.sql", "original_file_path": "macros\\apply_grants.sql", "unique_id": "macro.dbt_snowflake.snowflake__copy_grants", "macro_sql": "{% macro snowflake__copy_grants() %}\n {% set copy_grants = config.get('copy_grants', False) %}\n {{ return(copy_grants) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3502162, "supported_languages": null}, "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement": {"name": "snowflake__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\apply_grants.sql", "original_file_path": "macros\\apply_grants.sql", "unique_id": "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro snowflake__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(False) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3502162, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_catalog": {"name": "snowflake__get_catalog", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_catalog", "macro_sql": "{% macro snowflake__get_catalog(information_schema, schemas) -%}\n {% set query %}\n with tables as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n table_type as \"table_type\",\n comment as \"table_comment\",\n\n -- note: this is the _role_ that owns the table\n table_owner as \"table_owner\",\n\n 'Clustering Key' as \"stats:clustering_key:label\",\n clustering_key as \"stats:clustering_key:value\",\n 'The key used to cluster this table' as \"stats:clustering_key:description\",\n (clustering_key is not null) as \"stats:clustering_key:include\",\n\n 'Row Count' as \"stats:row_count:label\",\n row_count as \"stats:row_count:value\",\n 'An approximate count of rows in this table' as \"stats:row_count:description\",\n (row_count is not null) as \"stats:row_count:include\",\n\n 'Approximate Size' as \"stats:bytes:label\",\n bytes as \"stats:bytes:value\",\n 'Approximate size of the table as reported by Snowflake' as \"stats:bytes:description\",\n (bytes is not null) as \"stats:bytes:include\",\n\n 'Last Modified' as \"stats:last_modified:label\",\n to_varchar(convert_timezone('UTC', last_altered), 'yyyy-mm-dd HH24:MI'||'UTC') as \"stats:last_modified:value\",\n 'The timestamp for last update/change' as \"stats:last_modified:description\",\n (last_altered is not null and table_type='BASE TABLE') as \"stats:last_modified:include\"\n\n from {{ information_schema }}.tables\n\n ),\n\n columns as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n\n column_name as \"column_name\",\n ordinal_position as \"column_index\",\n data_type as \"column_type\",\n comment as \"column_comment\"\n\n from {{ information_schema }}.columns\n )\n\n select *\n from tables\n join columns using (\"table_database\", \"table_schema\", \"table_name\")\n where (\n {%- for schema in schemas -%}\n upper(\"table_schema\") = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n order by \"column_index\"\n {%- endset -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3512197, "supported_languages": null}, "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type": {"name": "dbt_snowflake_get_tmp_relation_type", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type", "macro_sql": "{% macro dbt_snowflake_get_tmp_relation_type(strategy, unique_key, language) %}\n{%- set tmp_relation_type = config.get('tmp_relation_type') -%}\n /* {#\n High-level principles:\n If we are running multiple statements (DELETE + INSERT),\n and we want to guarantee identical inputs to both statements,\n then we must first save the model query results as a temporary table\n (which presumably comes with a performance cost).\n If we are running a single statement (MERGE or INSERT alone),\n we _may_ save the model query definition as a view instead,\n for (presumably) faster overall incremental processing.\n\n Low-level specifics:\n If an invalid option is specified, then we will raise an\n excpetion with corresponding message.\n\n Languages other than SQL (like Python) will use a temporary table.\n With the default strategy of merge, the user may choose between a temporary\n table and view (defaulting to view).\n\n The append strategy can use a view because it will run a single INSERT statement.\n\n When unique_key is none, the delete+insert strategy can use a view beacuse a\n single INSERT statement is run with no DELETES as part of the statement.\n Otherwise, play it safe by using a temporary table.\n #} */\n\n {% if language == \"python\" and tmp_relation_type is not none %}\n {% do exceptions.raise_compiler_error(\n \"Python models currently only support 'table' for tmp_relation_type but \"\n ~ tmp_relation_type ~ \" was specified.\"\n ) %}\n {% endif %}\n\n {% if strategy == \"delete+insert\" and tmp_relation_type is not none and tmp_relation_type != \"table\" and unique_key is not none %}\n {% do exceptions.raise_compiler_error(\n \"In order to maintain consistent results when `unique_key` is not none,\n the `delete+insert` strategy only supports `table` for `tmp_relation_type` but \"\n ~ tmp_relation_type ~ \" was specified.\"\n )\n %}\n {% endif %}\n\n {% if language != \"sql\" %}\n {{ return(\"table\") }}\n {% elif tmp_relation_type == \"table\" %}\n {{ return(\"table\") }}\n {% elif tmp_relation_type == \"view\" %}\n {{ return(\"view\") }}\n {% elif strategy in (\"default\", \"merge\", \"append\") %}\n {{ return(\"view\") }}\n {% elif strategy == \"delete+insert\" and unique_key is none %}\n {{ return(\"view\") }}\n {% else %}\n {{ return(\"table\") }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3542204, "supported_languages": null}, "macro.dbt_snowflake.materialization_incremental_snowflake": {"name": "materialization_incremental_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.materialization_incremental_snowflake", "macro_sql": "{% materialization incremental, adapter='snowflake', supported_languages=['sql', 'python'] -%}\n\n {% set original_query_tag = set_query_tag() %}\n\n {#-- Set vars --#}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] -%}\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n\n {#-- The temp relation will be a view (faster) or temp table, depending on upsert/merge strategy --#}\n {%- set unique_key = config.get('unique_key') -%}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set tmp_relation_type = dbt_snowflake_get_tmp_relation_type(incremental_strategy, unique_key, language) %}\n {% set tmp_relation = make_temp_relation(this).incorporate(type=tmp_relation_type) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- Can't overwrite a view with a table - we must drop --#}\n {{ log(\"Dropping relation \" ~ target_relation ~ \" because it is a view and this model is a table.\") }}\n {% do adapter.drop_relation(existing_relation) %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n {% elif full_refresh_mode %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {#-- Create the temp relation, either as a view or as a temp table --#}\n {% if tmp_relation_type == 'view' %}\n {%- call statement('create_tmp_relation') -%}\n {{ snowflake__create_view_as_with_temp_flag(tmp_relation, compiled_code, True) }}\n {%- endcall -%}\n {% else %}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ create_table_as(True, tmp_relation, compiled_code, language) }}\n {%- endcall -%}\n {% endif %}\n\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': tmp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n\n {%- call statement('main') -%}\n {{ strategy_sql_macro_func(strategy_arg_dict) }}\n {%- endcall -%}\n {% endif %}\n\n {% do drop_relation_if_exists(tmp_relation) %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = target_relation.incorporate(type='table') %}\n\n {% set should_revoke =\n should_revoke(existing_relation.is_table, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type", "macro.dbt.make_temp_relation", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro.dbt.process_schema_changes", "macro.dbt.drop_relation_if_exists", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3592186, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.snowflake__get_incremental_default_sql": {"name": "snowflake__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_incremental_default_sql", "macro_sql": "{% macro snowflake__get_incremental_default_sql(arg_dict) %}\n {{ return(get_incremental_merge_sql(arg_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3592186, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_merge_sql": {"name": "snowflake__get_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_merge_sql", "macro_sql": "{% macro snowflake__get_merge_sql(target, source_sql, unique_key, dest_columns, incremental_predicates) -%}\n\n {#\n Workaround for Snowflake not being happy with a merge on a constant-false predicate.\n When no unique_key is provided, this macro will do a regular insert. If a unique_key\n is provided, then this macro will do a proper merge instead.\n #}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute='name')) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set dml -%}\n {%- if unique_key is none -%}\n\n {{ sql_header if sql_header is not none }}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source_sql }}\n )\n\n {%- else -%}\n\n {{ default__get_merge_sql(target, source_sql, unique_key, dest_columns, incremental_predicates) }}\n\n {%- endif -%}\n {%- endset -%}\n\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.default__get_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3612196, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql": {"name": "snowflake__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql", "macro_sql": "{% macro snowflake__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) %}\n {% set dml = default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) %}\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3612196, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_merge_sql": {"name": "snowflake__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_merge_sql", "macro_sql": "{% macro snowflake__snapshot_merge_sql(target, source, insert_cols) %}\n {% set dml = default__snapshot_merge_sql(target, source, insert_cols) %}\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3612196, "supported_languages": null}, "macro.dbt_snowflake.snowflake__load_csv_rows": {"name": "snowflake__load_csv_rows", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\seed.sql", "original_file_path": "macros\\materializations\\seed.sql", "unique_id": "macro.dbt_snowflake.snowflake__load_csv_rows", "macro_sql": "{% macro snowflake__load_csv_rows(model, agate_table) %}\n {% set batch_size = get_batch_size() %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query('BEGIN', auto_begin=False) %}\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n {% do adapter.add_query('COMMIT', auto_begin=False) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3632193, "supported_languages": null}, "macro.dbt_snowflake.materialization_seed_snowflake": {"name": "materialization_seed_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\seed.sql", "original_file_path": "macros\\materializations\\seed.sql", "unique_id": "macro.dbt_snowflake.materialization_seed_snowflake", "macro_sql": "{% materialization seed, adapter='snowflake' %}\n {% set original_query_tag = set_query_tag() %}\n\n {% set relations = materialization_seed_default() %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return(relations) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_seed_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3647223, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_snapshot_snowflake": {"name": "materialization_snapshot_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshot.sql", "unique_id": "macro.dbt_snowflake.materialization_snapshot_snowflake", "macro_sql": "{% materialization snapshot, adapter='snowflake' %}\n {% set original_query_tag = set_query_tag() %}\n {% set relations = materialization_snapshot_default() %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return(relations) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_snapshot_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3647223, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_table_snowflake": {"name": "materialization_table_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.materialization_table_snowflake", "macro_sql": "{% materialization table, adapter='snowflake', supported_languages=['sql', 'python']%}\n\n {% set original_query_tag = set_query_tag() %}\n\n {%- set identifier = model['alias'] -%}\n {%- set language = model['language'] -%}\n\n {% set grant_config = config.get('grants') %}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#-- Drop the relation if it was a view to \"convert\" it in a table. This may lead to\n -- downtime, but it should be a relatively infrequent occurrence #}\n {% if old_relation is not none and not old_relation.is_table %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ drop_relation_if_exists(old_relation) }}\n {% endif %}\n\n {% call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3677292, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation, temporary=False) %}\n{{ compiled_code }}\ndef materialize(session, df, target_relation):\n # make sure pandas exists\n import importlib.util\n package_name = 'pandas'\n if importlib.util.find_spec(package_name):\n import pandas\n if isinstance(df, pandas.core.frame.DataFrame):\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n {% set target_relation_name = resolve_model_name(target_relation) %}\n df.write.mode(\"overwrite\").save_as_table('{{ target_relation_name }}', create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3677292, "supported_languages": null}, "macro.dbt_snowflake.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.py_script_comment", "macro_sql": "{% macro py_script_comment()%}\n# To run this in snowsight, you need to select entry point to be main\n# And you may have to modify the return type to text to get the result back\n# def main(session):\n# dbt = dbtObj(session.table)\n# df = model(dbt, session)\n# return df.collect()\n\n# to run this in local notebook, you need to create a session following examples https://github.com/Snowflake-Labs/sfguide-getting-started-snowpark-python\n# then you can do the following to run model\n# dbt = dbtObj(session.table)\n# df = model(dbt, session)\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3687296, "supported_languages": null}, "macro.dbt_snowflake.materialization_test_snowflake": {"name": "materialization_test_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\test.sql", "original_file_path": "macros\\materializations\\test.sql", "unique_id": "macro.dbt_snowflake.materialization_test_snowflake", "macro_sql": "{%- materialization test, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set relations = materialization_test_default() %}\n {% do unset_query_tag(original_query_tag) %}\n {{ return(relations) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3687296, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"name": "materialization_view_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\view.sql", "original_file_path": "macros\\materializations\\view.sql", "unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.create_or_replace_view", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3697307, "supported_languages": ["sql"]}, "macro.dbt_snowflake.snowflake__array_construct": {"name": "snowflake__array_construct", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt_snowflake.snowflake__array_construct", "macro_sql": "{% macro snowflake__array_construct(inputs, data_type) -%}\n array_construct( {{ inputs|join(' , ') }} )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3697307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__bool_or": {"name": "snowflake__bool_or", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt_snowflake.snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n\n boolor_agg({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3697307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__escape_single_quotes": {"name": "snowflake__escape_single_quotes", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt_snowflake.snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37073, "supported_languages": null}, "macro.dbt_snowflake.snowflake__right": {"name": "snowflake__right", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt_snowflake.snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37073, "supported_languages": null}, "macro.dbt_snowflake.snowflake__safe_cast": {"name": "snowflake__safe_cast", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt_snowflake.snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37073, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp": {"name": "snowflake__current_timestamp", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp", "macro_sql": "{% macro snowflake__current_timestamp() -%}\n convert_timezone('UTC', current_timestamp())\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37073, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_string_as_time": {"name": "snowflake__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_string_as_time", "macro_sql": "{% macro snowflake__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"to_timestamp_ntz('\" ~ timestamp ~ \"')\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3717299, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_get_time": {"name": "snowflake__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_get_time", "macro_sql": "{% macro snowflake__snapshot_get_time() -%}\n to_timestamp_ntz({{ current_timestamp() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3717299, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_backcompat": {"name": "snowflake__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_backcompat", "macro_sql": "{% macro snowflake__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3717299, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat": {"name": "snowflake__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro snowflake__current_timestamp_in_utc_backcompat() %}\n convert_timezone('UTC', {{ snowflake__current_timestamp_backcompat() }})::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_backcompat", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3717299, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.373729, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.373729, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.373729, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3747296, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3747296, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3747296, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3747296, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3757296, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3757296, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3757296, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3767295, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3767295, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3777297, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3777297, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37873, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37873, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.37973, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.382236, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.382236, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.383239, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.383239, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql) %}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.383239, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.383239, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3842392, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3852398, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3852398, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3852398, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.386239, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3872392, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3872392, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3882425, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3892584, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3902428, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3902428, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3902428, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.391243, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.391243, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.393242, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.393242, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.393242, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3942423, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3942423, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3942423, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3942423, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3952425, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3952425, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3952425, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3962426, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3962426, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3972428, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3972428, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3972428, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.3982425, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4017513, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4017513, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4017513, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4027524, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4027524, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.403752, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.403752, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.403752, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.403752, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4047518, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4047518, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4047518, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4057524, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4057524, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4067526, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4067526, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4067526, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4077523, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4077523, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4077523, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4077523, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4087524, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4087524, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4087524, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4087524, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4097521, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4097521, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4097521, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_snowflake.snowflake__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4097521, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4117515, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4137518, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.414752, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.415255, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.41727, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4182732, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4182732, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\accepted_values.sql", "original_file_path": "macros\\generic_test_sql\\accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4192636, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\not_null.sql", "original_file_path": "macros\\generic_test_sql\\not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4192636, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\relationships.sql", "original_file_path": "macros\\generic_test_sql\\relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4202635, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\unique.sql", "original_file_path": "macros\\generic_test_sql\\unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4202635, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4212632, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4212632, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4222634, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4222634, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4232633, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4232633, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4232633, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4242635, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4242635, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4252634, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4262633, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4262633, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4262633, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4272633, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4272633, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.429263, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.429263, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4302633, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.431263, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.431263, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4386127, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4386127, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4446132, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.446613, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.446613, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4491253, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4491253, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4501307, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4551303, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4571302, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4581313, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4591305, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.461131, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.461131, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.461131, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.461131, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4621313, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4621313, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4621313, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4631324, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4631324, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4631324, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4631324, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4646387, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4646387, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4656448, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4656448, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4666505, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(model['columns'])) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4676511, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4686506, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4686506, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4696507, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4696507, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4706507, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4716504, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4716504, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select\n {% for column in model['columns'] %}\n {{ column }}{{ \", \" if not loop.last }}\n {% endfor %}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4716504, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\table.sql", "original_file_path": "macros\\materializations\\models\\table\\table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4746497, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "original_file_path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.47665, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.47765, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.47865, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.47865, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.479649, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\helpers.sql", "original_file_path": "macros\\materializations\\models\\view\\helpers.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4806497, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\helpers.sql", "original_file_path": "macros\\materializations\\models\\view\\helpers.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4806497, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\view.sql", "original_file_path": "macros\\materializations\\models\\view\\view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4851615, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4901602, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.491161, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.492161, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.492161, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493161, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493161, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493829, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493829, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493829, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.493829, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4948332, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4958382, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.4983456, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\seed.sql", "original_file_path": "macros\\materializations\\seeds\\seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5024712, "supported_languages": ["sql"]}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.506444, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.506444, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.506444, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.506444, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5074496, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5074496, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5074496, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.50847, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5093565, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5093565, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5103552, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5163713, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5173743, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5173743, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.521374, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.521374, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.521374, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5223742, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.523374, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.523374, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5253758, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5273745, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5273745, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5283744, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\test.sql", "original_file_path": "macros\\materializations\\tests\\test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5303738, "supported_languages": ["sql"]}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5313737, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5318766, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5338836, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5338836, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5348845, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5358846, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5358846, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5368843, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5368843, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.537884, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.537884, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.537884, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.537884, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5388842, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5388842, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5388842, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5398843, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5398843, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5398843, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5408888, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5408888, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5408888, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5408888, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5418878, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.542887, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.542887, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.542887, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.542887, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5438867, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5438867, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5438867, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5438867, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5438867, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5448866, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5448866, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5448866, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5448866, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.545888, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.545888, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.545888, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5468876, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5468876, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5468876, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5468876, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5478866, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5478866, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.548393, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.548393, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.548393, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.548393, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5493996, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5493996, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5493996, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5493996, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5504062, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5504062, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5514064, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5514064, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.552406, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.552406, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.552406, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.552406, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5534058, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5534058, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5534058, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5534058, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5544057, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5544057, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5554059, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5554059, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5554059, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5564063, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5564063, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.557406, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.557406, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5584056, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5584056, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5594056, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n where {{ column_name }} is not null\n limit 1\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5604055, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.561405, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.561405, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5624058, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5634055, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5649107, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5659175, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5669227, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5669227, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5689225, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.569923, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5729213, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.574922, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5759225, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.576923, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.576923, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5779235, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5779235, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.578923, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5799236, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5799236, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5814288, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.582435, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5834403, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5834403, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5844402, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5864408, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5874393, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5884385, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5884385, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5884385, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.589439, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.589439, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.589439, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.589439, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\slugify.sql", "original_file_path": "macros\\jinja_helpers\\slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5904386, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_ephemeral.sql", "original_file_path": "macros\\jinja_helpers\\_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5914385, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_relation.sql", "original_file_path": "macros\\jinja_helpers\\_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5924382, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5934384, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5934384, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5944383, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5944383, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.snowflake__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5954382, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5954382, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5964386, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5964386, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5964386, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5964386, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.597942, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.597942, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.598946, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.598946, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.5999494, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6009493, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6019492, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6039488, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6049495, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6059492, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6059492, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6069493, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6079493, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6089492, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6099494, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6109493, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6119492, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6129491, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6139488, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6149495, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.615452, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6164563, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6174593, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6174593, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.61846, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.61846, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.61846, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.61846, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6194596, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6194596, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6204593, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6204593, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6214595, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6224594, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6234596, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6234596, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6244595, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6244595, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6254592, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6264594, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.627459, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6284592, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6284592, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6284592, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6294594, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6294594, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.631459, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.633971, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.633971, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.633971, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6369696, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.64197, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6429698, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6459713, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.snowflake__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6469705, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6469705, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6479702, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6484742, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6494925, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6494925, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6494925, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6505165, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6515136, "supported_languages": null}, "macro.the_tuva_project.apply_regex": {"name": "apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.apply_regex", "macro_sql": "{%- macro apply_regex(column_name, regex) -%}\r\n\r\n {{ return(adapter.dispatch('apply_regex')(column_name, regex)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.the_tuva_project.snowflake__apply_regex"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6515136, "supported_languages": null}, "macro.the_tuva_project.default__apply_regex": {"name": "default__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.default__apply_regex", "macro_sql": "{%- macro default__apply_regex(column_name, regex) -%}\r\n\r\n regexp_like({{ column_name }}, '{{ regex}}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6525137, "supported_languages": null}, "macro.the_tuva_project.snowflake__apply_regex": {"name": "snowflake__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.snowflake__apply_regex", "macro_sql": "{%- macro snowflake__apply_regex(column_name, regex) -%}\r\n\r\n regexp_like({{ column_name }}, '{{ regex }}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6525137, "supported_languages": null}, "macro.the_tuva_project.bigquery__apply_regex": {"name": "bigquery__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.bigquery__apply_regex", "macro_sql": "{%- macro bigquery__apply_regex(column_name, regex) -%}\r\n\r\n regexp_contains({{ column_name }}, r'{{ regex }}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6525137, "supported_languages": null}, "macro.the_tuva_project.postgres__apply_regex": {"name": "postgres__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.postgres__apply_regex", "macro_sql": "{%- macro postgres__apply_regex(column_name, regex) -%}\r\n\r\n {{ column_name }} similar to '{{ regex }}'\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6525137, "supported_languages": null}, "macro.the_tuva_project.redshift__apply_regex": {"name": "redshift__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.redshift__apply_regex", "macro_sql": "{%- macro redshift__apply_regex(column_name, regex) -%}\r\n\r\n {{ column_name }} similar to '{{ regex }}'\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6525137, "supported_languages": null}, "macro.the_tuva_project.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\r\n {{ adapter.dispatch('date_part') (datepart, date) }}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6535132, "supported_languages": null}, "macro.the_tuva_project.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\r\n date_part('{{ datepart }}', {{ date }})\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6535132, "supported_languages": null}, "macro.the_tuva_project.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\r\n extract({{ datepart }} from {{ date }})\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6535132, "supported_languages": null}, "macro.the_tuva_project.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\generate_schema_name.sql", "original_file_path": "macros\\generate_schema_name.sql", "unique_id": "macro.the_tuva_project.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\r\n {%- set default_schema = target.schema -%}\r\n {%- if custom_schema_name is not none -%}\r\n {{ custom_schema_name | trim }}\r\n {%- else -%}\r\n {{ default_schema }}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6545134, "supported_languages": null}, "macro.the_tuva_project.load_seed": {"name": "load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.load_seed", "macro_sql": "{% macro load_seed(uri,pattern,compression=false,headers=false,null_marker=false) %}\r\n{{ return(adapter.dispatch('load_seed', 'the_tuva_project')(uri,pattern,compression,headers,null_marker)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.snowflake__load_seed"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.656513, "supported_languages": null}, "macro.the_tuva_project.duckdb__load_seed": {"name": "duckdb__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.duckdb__load_seed", "macro_sql": "{% macro duckdb__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"'\" ~col.name~\"'\" ~ \": \" ~ \"'\"~col.dtype~\"'\") %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',') -%}\r\n{# { log( cols,true) } #}\r\n\r\n{% set sql %}\r\n set s3_access_key_id='AKIA2EPVNTV4FLAEBFGE';\r\n set s3_secret_access_key='TARgblERrFP81Op+52KZW7HrP1Om6ObEDQAUVN2u';\r\n set s3_region='us-east-1';\r\n create or replace table {{this}} as\r\n select\r\n *\r\n from\r\n read_csv('s3://{{ uri }}/{{ pattern }}*',\r\n {% if null_marker == true %} nullstr = '\\N' {% else %} nullstr = '' {% endif %},\r\n header=true,\r\n columns= { {{ cols }} } )\r\n\r\n{% endset %}\r\n\r\n{% call statement('ducksql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('ducksql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\r\n{# debugging { log(results, True) } #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6585128, "supported_languages": null}, "macro.the_tuva_project.redshift__load_seed": {"name": "redshift__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.redshift__load_seed", "macro_sql": "{% macro redshift__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% set sql %}\r\ncopy {{ this }}\r\n from 's3://{{ uri }}/{{ pattern }}'\r\n access_key_id 'AKIA2EPVNTV4FLAEBFGE'\r\n secret_access_key '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'\r\n csv\r\n {% if compression == true %} gzip {% else %} {% endif %}\r\n {% if headers == true %} ignoreheader 1 {% else %} {% endif %}\r\n emptyasnull\r\n region 'us-east-1'\r\n\r\n{% endset %}\r\n\r\n{% call statement('redsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('redsql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\r\n{# debugging { log(results, True) } #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6585128, "supported_languages": null}, "macro.the_tuva_project.snowflake__load_seed": {"name": "snowflake__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.snowflake__load_seed", "macro_sql": "{% macro snowflake__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% set sql %} \r\ncopy into {{ this }}\r\n from s3://{{ uri }}\r\n file_format = (type = CSV\r\n {% if compression == true %} compression = 'GZIP' {% else %} compression = 'none' {% endif %}\r\n {% if headers == true %} skip_header = 1 {% else %} {% endif %}\r\n empty_field_as_null = true\r\n field_optionally_enclosed_by = '\"'\r\n)\r\npattern = '.*\\/{{pattern}}.*';\r\n{% endset %}\r\n{% call statement('snowsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('snowsql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ~ \"/\" ~ pattern ~ \"*\\n rows: \" ~ results['data']|sum(attribute=2),True) }}\r\n{# debugging { log(results, True)} #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.659513, "supported_languages": null}, "macro.the_tuva_project.bigquery__load_seed": {"name": "bigquery__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.bigquery__load_seed", "macro_sql": "{% macro bigquery__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(col.name ~ \" \" ~ col.dtype) %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',') -%}\r\n{# { log( cols,true) } #}\r\n{% set sql %}\r\nload data into {{ this }} ( {{collist|join(',')}} )\r\nfrom files (format = 'csv',\r\n uris = ['gs://{{ uri }}/{{ pattern }}*'],\r\n {% if compression == true %} compression = 'GZIP', {% else %} {% endif %}\r\n {% if headers == true %} skip_leading_rows = 1, {% else %} {% endif %}\r\n {% if null_marker == true %} null_marker = '\\\\N', {% else %} {% endif %}\r\n quote = '\"',\r\n allow_quoted_newlines = True\r\n )\r\n{% endset %}\r\n\r\n{% call statement('bigsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# { log(sql, True) } #}\r\n{% set results = load_result('bigsql') %}\r\n{{ log(\"Loaded data from external gs resource\\n loaded to: \" ~ this ~ \"\\n from: gs://\" ~ uri ~ \"/\" ~ pattern ~ \"*\",True) }}\r\n{# log(results, True) #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6615129, "supported_languages": null}, "macro.the_tuva_project.databricks__load_seed": {"name": "databricks__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.databricks__load_seed", "macro_sql": "{% macro databricks__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% if execute %}\r\n\r\n{%- set s3_path = 's3://' ~ uri ~ '/' -%}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',\\n ') -%}\r\n\r\n{% set sql %}\r\nCOPY INTO {{ this }}\r\nFROM (\r\n SELECT\r\n {{ cols }}\r\n\r\n FROM '{{ s3_path }}'\r\n {% if env_var('AWS_SESSION_TOKEN', False) %}\r\n WITH (\r\n CREDENTIAL (\r\n AWS_ACCESS_KEY = \"{{ env_var('AWS_ACCESS_KEY') }}\",\r\n AWS_SECRET_KEY = \"{{ env_var('AWS_SECRET_KEY') }}\",\r\n AWS_SESSION_TOKEN = \"{{ env_var('AWS_SESSION_TOKEN') }}\"\r\n )\r\n )\r\n {% endif %}\r\n)\r\nFILEFORMAT = CSV\r\nPATTERN = '{{ pattern }}*'\r\nFORMAT_OPTIONS (\r\n {% if headers == true %} 'skipRows' = '1', {% else %} 'skipRows' = '0', {% endif %}\r\n {% if null_marker == true %} 'nullValue' = '\\\\N', {% else %} {% endif %}\r\n 'enforceSchema' = 'true',\r\n 'inferSchema' = 'false',\r\n 'sep' = ','\r\n)\r\nCOPY_OPTIONS (\r\n 'mergeSchema' = 'false',\r\n 'force' = 'true'\r\n)\r\n{% endset %}\r\n\r\n{# check logs/dbt.log for output #}\r\n{{ log(cols, info=False) }}\r\n{{ log('Current model: ' ~ this ~ '\\n', info=False) }}\r\n{{ log('Full s3 path: ' ~ s3_path ~ '\\n', info=False) }}\r\n{{ log(sql, info=False) }}\r\n\r\n{% call statement('databrickssql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% set results = load_result('databrickssql') %}\r\n{% set rows_affected = results['data'][0][0] %}\r\n\r\n{{ log(results, info=False) }}\r\n{{ log(rows_affected, info=False) }}\r\n\r\n{{ log(\"Loaded data from external s3 resource:\", True) }}\r\n{{ log(\" source: \\t\" ~ s3_path ~ pattern, True) }}\r\n{{ log(\" target: \\t\" ~ this | replace('`',''), True) }}\r\n{{ log(\" rows: \\t\\033[92m\" ~ rows_affected ~ \"\\033[0m\", True) }}\r\n\r\n{% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6647038, "supported_languages": null}, "macro.the_tuva_project.default__load_seed": {"name": "default__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.default__load_seed", "macro_sql": "{% macro default__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% if execute %}\r\n{% do log('No adapter found, seed not loaded',info = True) %}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6647038, "supported_languages": null}, "macro.the_tuva_project.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6667366, "supported_languages": null}, "macro.the_tuva_project.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.bigquery__try_to_cast_date", "macro_sql": "{%- macro bigquery__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n safe_cast( date( {{ column_name }} ) as date )\r\n {%- else -%}\r\n safe_cast( {{ column_name }} as date )\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6667366, "supported_languages": null}, "macro.the_tuva_project.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.default__try_to_cast_date", "macro_sql": "{%- macro default__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6667366, "supported_languages": null}, "macro.the_tuva_project.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.postgres__try_to_cast_date", "macro_sql": "{%- macro postgres__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}[0-9]{2}[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{2}/[0-9]{2}/[0-9]{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.667737, "supported_languages": null}, "macro.the_tuva_project.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.redshift__try_to_cast_date", "macro_sql": "{%- macro redshift__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}\\\\d{2}\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{2}/\\\\d{2}/\\\\d{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2} \\\\d{2}:\\\\d{2}:\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.667737, "supported_languages": null}, "macro.the_tuva_project.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.snowflake__try_to_cast_date", "macro_sql": "{%- macro snowflake__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6687362, "supported_languages": null}, "macro.the_tuva_project.eligibility_denominator_invalid_values": {"name": "eligibility_denominator_invalid_values", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\eligibility_denominator_invalid_values.sql", "original_file_path": "macros\\data_quality\\eligibility_denominator_invalid_values.sql", "unique_id": "macro.the_tuva_project.eligibility_denominator_invalid_values", "macro_sql": "{% macro eligibility_denominator_invalid_values(relation) %}\r\n{%- set sql_statement -%}\r\n select test_field\r\n from {{ ref('data_quality__test_catalog') }}\r\n where source_table = 'normalized_input__eligibility'\r\n and test_category = 'invalid_values'\r\n{%- endset -%}\r\n\r\n{%- set results = run_query(sql_statement) -%}\r\n\r\n{%- if execute -%}\r\n{%- set results_list = results.columns[0].values() -%}\r\n{%- else -%}\r\n{%- set results_list = [] -%}\r\n{%- endif -%}\r\n\r\n {%- for test_field in results_list -%}\r\n select\r\n cat.test_name\r\n , count(distinct rel.patient_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ relation }} as rel\r\n left join {{ ref('data_quality__test_catalog') }} as cat\r\n on cat.test_category = 'invalid_values'\r\n and cat.source_table = 'normalized_input__eligibility'\r\n and cat.test_field = '{{ test_field }}'\r\n where rel.{{ test_field }} is not null\r\n group by cat.test_name\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6697369, "supported_languages": null}, "macro.the_tuva_project.eligibility_missing_column_check": {"name": "eligibility_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\eligibility_missing_column_check.sql", "original_file_path": "macros\\data_quality\\eligibility_missing_column_check.sql", "unique_id": "macro.the_tuva_project.eligibility_missing_column_check", "macro_sql": "{% macro eligibility_missing_column_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n patient_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6697369, "supported_languages": null}, "macro.the_tuva_project.medical_claim_date_check": {"name": "medical_claim_date_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_date_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_date_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_date_check", "macro_sql": "{% macro medical_claim_date_check(relation, column_list, claim_type=false) %}\r\n {%- for column_item in column_list -%}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }} as rel\r\n left join {{ ref('terminology__calendar') }} as cal\r\n on rel.{{ column_item }} = cal.full_date\r\n where cal.full_date is null\r\n and rel.{{ column_item }} is not null\r\n {% if claim_type -%}\r\n and rel.claim_type = '{{ claim_type }}'\r\n {% endif -%}\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.670738, "supported_languages": null}, "macro.the_tuva_project.medical_claim_denominator_invalid_values": {"name": "medical_claim_denominator_invalid_values", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_denominator_invalid_values.sql", "original_file_path": "macros\\data_quality\\medical_claim_denominator_invalid_values.sql", "unique_id": "macro.the_tuva_project.medical_claim_denominator_invalid_values", "macro_sql": "{% macro medical_claim_denominator_invalid_values(relation) %}\r\n{%- set sql_statement -%}\r\n select test_field\r\n from {{ ref('data_quality__test_catalog') }}\r\n where source_table = 'normalized_input__medical_claim'\r\n and test_category = 'invalid_values'\r\n{%- endset -%}\r\n\r\n{%- set results = run_query(sql_statement) -%}\r\n\r\n{%- if execute -%}\r\n{%- set results_list = results.columns[0].values() -%}\r\n{%- else -%}\r\n{%- set results_list = [] -%}\r\n{%- endif -%}\r\n\r\n {%- for test_field in results_list -%}\r\n select\r\n cat.test_name\r\n , count(distinct rel.claim_id||rel.data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ relation }} as rel\r\n left join {{ ref('data_quality__test_catalog') }} as cat\r\n on cat.test_category = 'invalid_values'\r\n and cat.source_table = 'normalized_input__medical_claim'\r\n and cat.test_field = '{{ test_field }}'\r\n where rel.{{ test_field }} is not null\r\n group by cat.test_name\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6727371, "supported_languages": null}, "macro.the_tuva_project.medical_claim_header_duplicate_check": {"name": "medical_claim_header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_header_duplicate_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_header_duplicate_check", "macro_sql": "{% macro medical_claim_header_duplicate_check(relation, column_list, claim_type) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n , count(distinct {{ column_item }}) as duplicate_count\r\n from {{ relation }}\r\n where claim_type = '{{ claim_type }}'\r\n group by\r\n claim_id\r\n , data_source\r\n having count(distinct {{ column_item }}) > 1\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6727371, "supported_languages": null}, "macro.the_tuva_project.medical_claim_missing_column_check": {"name": "medical_claim_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_missing_column_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_missing_column_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_missing_column_check", "macro_sql": "{% macro medical_claim_missing_column_check(relation, column_list, claim_type) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n and claim_type = '{{ claim_type }}'\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6737368, "supported_languages": null}, "macro.the_tuva_project.pharmacy_claim_header_duplicate_check": {"name": "pharmacy_claim_header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\pharmacy_claim_header_duplicate_check.sql", "original_file_path": "macros\\data_quality\\pharmacy_claim_header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.pharmacy_claim_header_duplicate_check", "macro_sql": "{% macro pharmacy_claim_header_duplicate_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n , count(distinct {{ column_item }}) as duplicate_count\r\n from {{ relation }}\r\n group by claim_id, data_source\r\n having count(distinct {{ column_item }}) > 1\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6737368, "supported_languages": null}, "macro.the_tuva_project.pharmacy_claim_missing_column_check": {"name": "pharmacy_claim_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\pharmacy_claim_missing_column_check.sql", "original_file_path": "macros\\data_quality\\pharmacy_claim_missing_column_check.sql", "unique_id": "macro.the_tuva_project.pharmacy_claim_missing_column_check", "macro_sql": "{% macro pharmacy_claim_missing_column_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6747372, "supported_languages": null}, "macro.the_tuva_project.test_claims_preprocessing_pipeline_checks": {"name": "test_claims_preprocessing_pipeline_checks", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\tests\\claims_preprocessing_pipeline_checks.sql", "original_file_path": "macros\\tests\\claims_preprocessing_pipeline_checks.sql", "unique_id": "macro.the_tuva_project.test_claims_preprocessing_pipeline_checks", "macro_sql": "{% test claims_preprocessing_pipeline_checks(model) %}\r\n\r\n select *\r\n from {{ ref('data_quality__claims_preprocessing_test_detail' )}}\r\n where pipeline_test = 1\r\n\r\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715349080.6747372, "supported_languages": null}}, "docs": {"doc.input_layer.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "input_layer", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.input_layer.__overview__", "block_contents": "# \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is difficult to analyze - we're working to change that. The Tuva Project is an open source knowledge base, code base, and community for healthcare data people.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/)\r\nWe're writing the open book on how to transform and analyze healthcare data.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://github.com/tuva-health)\r\nWe're translating knowledge into precise code that anyone can run on their healthcare data.\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nWe're building a community we're healthcare data people can ask questions and share knowledge about healthcare data."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [{"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_factors_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "original_file_path": "snapshots\\cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_factors_snapshot", "cms_hcc__patient_risk_factors_snapshot"], "alias": "patient_risk_factors_snapshot", "checksum": {"name": "sha256", "checksum": "93de4ccb7b0962ce79e9d1b54e8b3ce626ab0fc1757a0a8a7583c350fd5f1c3e"}, "config": {"enabled": false, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715349083.656318, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_factors_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"patient_risk_factors_snapshot\"\r\n , \"tags\": \"cms_hcc\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||model_version||payment_year||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [{"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_scores_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "cms_hcc\\cms_hcc__patient_risk_scores_snapshot.sql", "original_file_path": "snapshots\\cms_hcc\\cms_hcc__patient_risk_scores_snapshot.sql", "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_scores_snapshot", "cms_hcc__patient_risk_scores_snapshot"], "alias": "patient_risk_scores_snapshot", "checksum": {"name": "sha256", "checksum": "0341ef994d38335ca5a8a59a7c8acdb47696f43200dd33027fcdc2093ed44ed8"}, "config": {"enabled": false, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||payment_year||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715349083.664713, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||payment_year||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_scores_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"patient_risk_scores_snapshot\"\r\n , \"tags\": \"cms_hcc\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||payment_year||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\r\n\r\n", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": [{"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_counts_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_counts_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_counts_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_counts_snapshot", "quality_measures__summary_counts_snapshot"], "alias": "summary_counts_snapshot", "checksum": {"name": "sha256", "checksum": "7d70c425e79217b6b2af25984cc5901a5a70e2cd1d16eee9e6f5af049c719978"}, "config": {"enabled": false, "alias": "summary_counts_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715349083.670722, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.quality_measures.summary_counts_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_counts_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_counts') }}\r\n\r\n", "language": "sql", "refs": [{"name": "quality_measures__summary_counts", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": [{"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_long_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_long_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_long_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_long_snapshot", "quality_measures__summary_long_snapshot"], "alias": "summary_long_snapshot", "checksum": {"name": "sha256", "checksum": "4bfc791820a1666cb034b4056c07c14bbed4a0f1303be9230db39500626d9305"}, "config": {"enabled": false, "alias": "summary_long_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715349083.6767223, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.quality_measures.summary_long_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_long_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_long') }}\r\n\r\n", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}]}, "parent_map": {"model.input_layer.condition": [], "model.input_layer.eligibility": ["seed.input_layer.eligibility_seed"], "model.input_layer.encounter": [], "model.input_layer.lab_result": [], "model.input_layer.location": [], "model.input_layer.medical_claim": ["seed.input_layer.medical_claim_seed"], "model.input_layer.medication": [], "model.input_layer.observation": [], "model.input_layer.patient": [], "model.input_layer.pharmacy_claim": ["seed.input_layer.pharmacy_claim_seed"], "model.input_layer.practitioner": [], "model.input_layer.procedure": [], "seed.input_layer.eligibility_seed": [], "seed.input_layer.lab_result_seed": [], "seed.input_layer.medical_claim_seed": [], "seed.input_layer.observation_seed": [], "seed.input_layer.pharmacy_claim_seed": [], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"], "model.the_tuva_project.ccsr__long_procedure_category": ["model.the_tuva_project.ccsr__procedure_category_map", "model.the_tuva_project.ccsr__stg_core__procedure"], "model.the_tuva_project.ccsr__singular_condition_category": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__procedure_category_map": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "model.the_tuva_project.value_set_member_relevant_fields"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": ["model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": ["model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.medical_claim_expanded": ["model.input_layer.medical_claim"], "model.the_tuva_project.acute_inpatient__summary": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__data_quality_summary": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__institutional_claims": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.emergency_department__summary": ["model.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_last_claim_values", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_claims"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.emergency_department__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.emergency_department__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.emergency_department__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.normalized_input__eligibility": ["model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__stg_eligibility"], "model.the_tuva_project.normalized_input__medical_claim": ["model.the_tuva_project.normalized_input__int_admit_source_final", "model.the_tuva_project.normalized_input__int_admit_type_final", "model.the_tuva_project.normalized_input__int_apr_drg_final", "model.the_tuva_project.normalized_input__int_bill_type_final", "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_ms_drg_final", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_final", "model.the_tuva_project.normalized_input__int_procedure_code_final", "model.the_tuva_project.normalized_input__int_procedure_date_final", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "model.the_tuva_project.normalized_input__stg_medical_claim"], "model.the_tuva_project.normalized_input__pharmacy_claim": ["model.the_tuva_project.normalized_input__stg_pharmacy_claim"], "model.the_tuva_project.normalized_input__int_admit_source_final": ["model.the_tuva_project.normalized_input__int_admit_source_voting"], "model.the_tuva_project.normalized_input__int_admit_source_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source"], "model.the_tuva_project.normalized_input__int_admit_type_final": ["model.the_tuva_project.normalized_input__int_admit_type_voting"], "model.the_tuva_project.normalized_input__int_admit_type_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_type"], "model.the_tuva_project.normalized_input__int_apr_drg_final": ["model.the_tuva_project.normalized_input__int_apr_drg_voting"], "model.the_tuva_project.normalized_input__int_apr_drg_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"], "model.the_tuva_project.normalized_input__int_bill_type_final": ["model.the_tuva_project.normalized_input__int_bill_type_voting"], "model.the_tuva_project.normalized_input__int_bill_type_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type"], "model.the_tuva_project.normalized_input__int_diagnosis_code_final": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting"], "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"], "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": ["model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"], "model.the_tuva_project.normalized_input__int_discharge_disposition_final": ["model.the_tuva_project.normalized_input__int_discharge_disposition_voting"], "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__discharge_disposition"], "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": ["model.the_tuva_project.normalized_input__stg_eligibility", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_medical_date_aggregation": ["model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"], "model.the_tuva_project.normalized_input__int_medical_npi_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.normalized_input__int_ms_drg_final": ["model.the_tuva_project.normalized_input__int_ms_drg_voting"], "model.the_tuva_project.normalized_input__int_ms_drg_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.normalized_input__int_place_of_service_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service"], "model.the_tuva_project.normalized_input__int_present_on_admit_final": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting"], "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.normalized_input__int_present_on_admit_voting": ["model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"], "model.the_tuva_project.normalized_input__int_procedure_code_final": ["model.the_tuva_project.normalized_input__int_procedure_code_voting"], "model.the_tuva_project.normalized_input__int_procedure_code_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs"], "model.the_tuva_project.normalized_input__int_procedure_code_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize"], "model.the_tuva_project.normalized_input__int_procedure_date_final": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_date_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_procedure_date_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"], "model.the_tuva_project.normalized_input__int_revenue_center_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.normalized_input__int_undetermined_claim_type": ["model.the_tuva_project.normalized_input__stg_medical_claim"], "model.the_tuva_project.normalized_input__stg_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.normalized_input__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.normalized_input__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.service_category__dq_input_layer_results": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__claim_type", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.value_set_member_relevant_fields": ["seed.the_tuva_project.clinical_concepts", "seed.the_tuva_project.coding_systems", "seed.the_tuva_project.value_set_members"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["model.the_tuva_project.cms_hcc__patient_risk_factors", "seed.the_tuva_project.cms_hcc__adjustment_rates"], "model.the_tuva_project.cms_hcc__int_demographic_factors": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"], "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"], "model.the_tuva_project.cms_hcc__int_disease_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"], "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"], "model.the_tuva_project.cms_hcc__int_eligible_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"], "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"], "model.the_tuva_project.cms_hcc__int_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"], "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"], "model.the_tuva_project.cms_hcc__int_hcc_mapping": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"], "model.the_tuva_project.cms_hcc__int_members": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__condition": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.core__stg_claims_eligibility"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.the_tuva_project.core__location": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.core__stg_claims_medical_claim"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.the_tuva_project.core__patient": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"], "model.the_tuva_project.core__practitioner": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"], "model.the_tuva_project.core__procedure": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"], "model.the_tuva_project.core__stg_claims_condition": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_patient": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.core__stg_claims_practitioner": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_procedure": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_condition": ["model.input_layer.condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.input_layer.encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.input_layer.lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.input_layer.location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.input_layer.medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.input_layer.observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.input_layer.patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.input_layer.practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.input_layer.procedure"], "model.the_tuva_project.data_quality__claims_preprocessing_summary": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_use_case": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_status", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__race"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__claim_type", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__present_on_admission", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.financial_pmpm__pmpm_payer": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.hcc_suspecting__list": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"], "model.the_tuva_project.hcc_suspecting__list_rollup": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__summary": ["model.the_tuva_project.hcc_suspecting__list", "model.the_tuva_project.hcc_suspecting__stg_core__patient"], "model.the_tuva_project.hcc_suspecting__int_all_conditions": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"], "model.the_tuva_project.hcc_suspecting__int_all_medications": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim"], "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_lab_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_medication_suspects": ["model.the_tuva_project.hcc_suspecting__int_all_medications", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_observation_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "model.the_tuva_project.hcc_suspecting__stg_core__observation", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"], "model.the_tuva_project.hcc_suspecting__int_prep_conditions": ["model.the_tuva_project.hcc_suspecting__stg_core__condition", "seed.the_tuva_project.terminology__snomed_icd_10_map"], "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "seed.the_tuva_project.hcc_suspecting__clinical_concepts"], "model.the_tuva_project.hcc_suspecting__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.hcc_suspecting__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.hcc_suspecting__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.hcc_suspecting__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_date_column": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.insights__count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__orphan_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.insights__sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__summary_counts": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__summary_wide": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_cqm236_denominator": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cqm236_exclusions": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_cqm236_long": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_cqm236_numerator": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.quality_measures__int_cqm236__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": [], "model.the_tuva_project.quality_measures__int_nqf0053_denominator": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0053_long": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf0053_numerator": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0059_denominator": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0059_long": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf0059_numerator": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf2372_long": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_medical_claim"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_summary": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.readmissions__readmission_crude": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"], "model.the_tuva_project.readmissions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "seed.the_tuva_project.terminology__admit_source": [], "seed.the_tuva_project.terminology__admit_type": [], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__apr_drg": [], "seed.the_tuva_project.terminology__bill_type": [], "seed.the_tuva_project.terminology__calendar": [], "seed.the_tuva_project.terminology__claim_type": [], "seed.the_tuva_project.terminology__code_type": [], "seed.the_tuva_project.terminology__discharge_disposition": [], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__gender": [], "seed.the_tuva_project.terminology__hcpcs_level_2": [], "seed.the_tuva_project.terminology__icd_10_cm": [], "seed.the_tuva_project.terminology__icd_10_pcs": [], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__medicare_orec": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__ms_drg": [], "seed.the_tuva_project.terminology__ndc": [], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": [], "seed.the_tuva_project.terminology__place_of_service": [], "seed.the_tuva_project.terminology__present_on_admission": [], "seed.the_tuva_project.terminology__provider": [], "seed.the_tuva_project.terminology__race": [], "seed.the_tuva_project.terminology__revenue_center": [], "seed.the_tuva_project.terminology__rxnorm_to_atc": [], "seed.the_tuva_project.terminology__snomed_icd_10_map": [], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": [], "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": [], "seed.the_tuva_project.clinical_concepts": [], "seed.the_tuva_project.coding_systems": [], "seed.the_tuva_project.value_set_members": [], "seed.the_tuva_project.cms_hcc__adjustment_rates": [], "seed.the_tuva_project.cms_hcc__cpt_hcpcs": [], "seed.the_tuva_project.cms_hcc__demographic_factors": [], "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": [], "seed.the_tuva_project.cms_hcc__disease_factors": [], "seed.the_tuva_project.cms_hcc__disease_hierarchy": [], "seed.the_tuva_project.cms_hcc__disease_interaction_factors": [], "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": [], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": [], "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": [], "seed.the_tuva_project.data_quality__test_catalog": [], "seed.the_tuva_project.ed_classification__categories": [], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": [], "seed.the_tuva_project.ed_classification__johnston_icd9": [], "seed.the_tuva_project.hcc_suspecting__clinical_concepts": [], "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": [], "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": [], "seed.the_tuva_project.quality_measures__value_sets": [], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": [], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": [], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": [], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": [], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": [], "seed.the_tuva_project.readmissions__specialty_cohort": [], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": [], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": ["model.the_tuva_project.normalized_input__medical_claim"], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": ["model.the_tuva_project.core__condition"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": ["model.the_tuva_project.core__medical_claim"], "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": ["model.the_tuva_project.core__procedure"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"], "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": ["model.the_tuva_project.quality_measures__stg_core__condition"], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": ["model.the_tuva_project.quality_measures__stg_core__encounter"], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": ["model.the_tuva_project.quality_measures__stg_core__medication"], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": ["model.the_tuva_project.quality_measures__stg_core__observation"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "child_map": {"model.input_layer.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.input_layer.eligibility": ["model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__stg_eligibility"], "model.input_layer.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.input_layer.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.input_layer.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.input_layer.medical_claim": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.medical_claim_expanded", "model.the_tuva_project.normalized_input__stg_medical_claim"], "model.input_layer.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.input_layer.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.input_layer.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.input_layer.pharmacy_claim": ["model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.normalized_input__stg_pharmacy_claim"], "model.input_layer.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.input_layer.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "seed.input_layer.eligibility_seed": ["model.input_layer.eligibility"], "seed.input_layer.lab_result_seed": [], "seed.input_layer.medical_claim_seed": ["model.input_layer.medical_claim"], "seed.input_layer.observation_seed": [], "seed.input_layer.pharmacy_claim_seed": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category"], "model.the_tuva_project.ccsr__long_procedure_category": [], "model.the_tuva_project.ccsr__singular_condition_category": ["test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": ["test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0"], "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": [], "model.the_tuva_project.medical_claim_expanded": [], "model.the_tuva_project.acute_inpatient__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"], "model.the_tuva_project.acute_inpatient__data_quality_summary": [], "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": [], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__institutional_claims": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "model.the_tuva_project.acute_inpatient__encounter_id"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.emergency_department__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__stg_eligibility": [], "model.the_tuva_project.emergency_department__stg_medical_claim": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.emergency_department__stg_service_category": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.normalized_input__eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.emergency_department__stg_eligibility"], "model.the_tuva_project.normalized_input__medical_claim": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f"], "model.the_tuva_project.normalized_input__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "model.the_tuva_project.normalized_input__int_admit_source_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_admit_source_voting": ["model.the_tuva_project.normalized_input__int_admit_source_final"], "model.the_tuva_project.normalized_input__int_admit_type_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_admit_type_voting": ["model.the_tuva_project.normalized_input__int_admit_type_final"], "model.the_tuva_project.normalized_input__int_apr_drg_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_apr_drg_voting": ["model.the_tuva_project.normalized_input__int_apr_drg_final"], "model.the_tuva_project.normalized_input__int_bill_type_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_bill_type_voting": ["model.the_tuva_project.normalized_input__int_bill_type_final"], "model.the_tuva_project.normalized_input__int_diagnosis_code_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting", "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"], "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": ["model.the_tuva_project.normalized_input__int_diagnosis_code_final"], "model.the_tuva_project.normalized_input__int_discharge_disposition_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": ["model.the_tuva_project.normalized_input__int_discharge_disposition_final"], "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": ["model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_medical_date_aggregation": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_medical_npi_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_ms_drg_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_ms_drg_voting": ["model.the_tuva_project.normalized_input__int_ms_drg_final"], "model.the_tuva_project.normalized_input__int_place_of_service_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_present_on_admit_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting", "model.the_tuva_project.normalized_input__int_present_on_admit_voting"], "model.the_tuva_project.normalized_input__int_present_on_admit_voting": ["model.the_tuva_project.normalized_input__int_present_on_admit_final"], "model.the_tuva_project.normalized_input__int_procedure_code_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_procedure_code_normalize": ["model.the_tuva_project.normalized_input__int_procedure_code_voting", "model.the_tuva_project.normalized_input__int_procedure_code_voting", "model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_code_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_final"], "model.the_tuva_project.normalized_input__int_procedure_date_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_procedure_date_normalize": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_date_voting": ["model.the_tuva_project.normalized_input__int_procedure_date_final"], "model.the_tuva_project.normalized_input__int_revenue_center_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_undetermined_claim_type": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"], "model.the_tuva_project.normalized_input__stg_medical_claim": ["model.the_tuva_project.normalized_input__int_admit_source_voting", "model.the_tuva_project.normalized_input__int_admit_type_voting", "model.the_tuva_project.normalized_input__int_apr_drg_voting", "model.the_tuva_project.normalized_input__int_bill_type_voting", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_ms_drg_voting", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__stg_pharmacy_claim": ["model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.service_category__dq_input_layer_results": [], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__dq_input_layer_results"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": [], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": [], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__emergency_department_institutional"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_institutional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.value_set_member_relevant_fields": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"], "model.the_tuva_project.cms_hcc__int_demographic_factors": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors", "model.the_tuva_project.cms_hcc__patient_risk_factors", "model.the_tuva_project.cms_hcc__patient_risk_factors", "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400"], "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_disease_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_eligible_conditions": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc"], "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_hcc_count_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "model.the_tuva_project.cms_hcc__int_hcc_mapping": ["model.the_tuva_project.cms_hcc__int_hcc_hierarchy"], "model.the_tuva_project.cms_hcc__int_members": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.core__condition": ["model.the_tuva_project.ccsr__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.hcc_suspecting__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.financial_pmpm__stg_eligibility"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__lab_result"], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.quality_measures__stg_medical_claim", "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__medication"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.hcc_suspecting__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.core__patient": ["model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "model.the_tuva_project.cms_hcc__stg_core__patient", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.hcc_suspecting__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"], "model.the_tuva_project.core__practitioner": [], "model.the_tuva_project.core__procedure": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.readmissions__stg_core__procedure", "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5"], "model.the_tuva_project.core__stg_claims_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.core__stg_claims_encounter": [], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__location"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_practitioner"], "model.the_tuva_project.core__stg_claims_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.core__stg_claims_practitioner": ["model.the_tuva_project.core__practitioner"], "model.the_tuva_project.core__stg_claims_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.core__stg_clinical_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.the_tuva_project.core__location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.the_tuva_project.core__practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.data_quality__claims_preprocessing_summary": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_encounter", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_procedure", "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result": ["test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9"], "model.the_tuva_project.data_quality__claims_preprocessing_use_case": ["test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.ed_classification__summary": [], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__pmpm_prep", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__orphan_claim_by_claim_type"], "model.the_tuva_project.financial_pmpm__pmpm_payer": [], "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": [], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__pmpm_payer", "model.the_tuva_project.financial_pmpm__pmpm_payer_plan", "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.hcc_suspecting__list": ["model.the_tuva_project.hcc_suspecting__list_rollup", "model.the_tuva_project.hcc_suspecting__summary"], "model.the_tuva_project.hcc_suspecting__list_rollup": [], "model.the_tuva_project.hcc_suspecting__summary": [], "model.the_tuva_project.hcc_suspecting__int_all_conditions": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"], "model.the_tuva_project.hcc_suspecting__int_all_medications": ["model.the_tuva_project.hcc_suspecting__int_medication_suspects"], "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_lab_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_medication_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_observation_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_prep_conditions": ["model.the_tuva_project.hcc_suspecting__int_all_conditions", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": ["model.the_tuva_project.hcc_suspecting__int_lab_suspects"], "model.the_tuva_project.hcc_suspecting__stg_core__condition": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions"], "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": ["model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"], "model.the_tuva_project.hcc_suspecting__stg_core__medication": ["model.the_tuva_project.hcc_suspecting__int_all_medications"], "model.the_tuva_project.hcc_suspecting__stg_core__observation": ["model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "model.the_tuva_project.hcc_suspecting__stg_core__patient": ["model.the_tuva_project.hcc_suspecting__summary"], "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": ["model.the_tuva_project.hcc_suspecting__int_all_medications"], "model.the_tuva_project.insights__count_claim_by_claim_type": [], "model.the_tuva_project.insights__count_claim_by_date_column": [], "model.the_tuva_project.insights__count_claim_by_service_category": [], "model.the_tuva_project.insights__orphan_claim_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_service_category": [], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": [], "model.the_tuva_project.insights__trend_count_claim_by_service_category": [], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": [], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": [], "model.the_tuva_project.quality_measures__summary_counts": [], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__summary_counts", "model.the_tuva_project.quality_measures__summary_wide"], "model.the_tuva_project.quality_measures__summary_wide": [], "model.the_tuva_project.quality_measures__int_cqm236_denominator": ["model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_cqm236_numerator"], "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions"], "model.the_tuva_project.quality_measures__int_cqm236_exclusions": ["model.the_tuva_project.quality_measures__int_cqm236_long"], "model.the_tuva_project.quality_measures__int_cqm236_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_cqm236_numerator": ["model.the_tuva_project.quality_measures__int_cqm236_long"], "model.the_tuva_project.quality_measures__int_cqm236__performance_period": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0053_denominator": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0053_numerator"], "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": ["model.the_tuva_project.quality_measures__int_nqf0053_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0053_long"], "model.the_tuva_project.quality_measures__int_nqf0053_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0053_numerator": ["model.the_tuva_project.quality_measures__int_nqf0053_long"], "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0059_denominator": ["model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf0059_numerator"], "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0059_long"], "model.the_tuva_project.quality_measures__int_nqf0059_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0059_numerator": ["model.the_tuva_project.quality_measures__int_nqf0059_long"], "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf2372_numerator"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__int_nqf2372_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"], "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__readmission_summary"], "model.the_tuva_project.readmissions__readmission_summary": [], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__readmission_crude", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_crude": [], "model.the_tuva_project.readmissions__stg_core__condition": [], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_admit_source_voting"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_admit_type_voting"], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__apr_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_apr_drg_voting", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__bill_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_bill_type_voting", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__calendar": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"], "seed.the_tuva_project.terminology__claim_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__code_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"], "seed.the_tuva_project.terminology__discharge_disposition": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "model.the_tuva_project.readmissions__encounter_data_quality"], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__gender": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__hcpcs_level_2": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__icd_10_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.terminology__icd_10_pcs": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__icd_9_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"], "seed.the_tuva_project.terminology__icd_9_pcs": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize"], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_orec": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_status": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__ms_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_ms_drg_voting", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__ndc": [], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__place_of_service": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__present_on_admission": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"], "seed.the_tuva_project.terminology__provider": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize"], "seed.the_tuva_project.terminology__race": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__revenue_center": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__rxnorm_to_atc": [], "seed.the_tuva_project.terminology__snomed_icd_10_map": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions"], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": ["model.the_tuva_project.ccsr__long_condition_category"], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": ["model.the_tuva_project.ccsr__dx_vertical_pivot"], "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": ["model.the_tuva_project.ccsr__procedure_category_map"], "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": [], "seed.the_tuva_project.clinical_concepts": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.coding_systems": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.value_set_members": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.cms_hcc__adjustment_rates": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "seed.the_tuva_project.cms_hcc__cpt_hcpcs": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "seed.the_tuva_project.cms_hcc__demographic_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"], "seed.the_tuva_project.cms_hcc__disease_factors": ["model.the_tuva_project.cms_hcc__int_disease_factors"], "seed.the_tuva_project.cms_hcc__disease_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_hierarchy"], "seed.the_tuva_project.cms_hcc__disease_interaction_factors": ["model.the_tuva_project.cms_hcc__int_disease_interaction_factors"], "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": ["model.the_tuva_project.cms_hcc__int_hcc_mapping"], "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "seed.the_tuva_project.data_quality__test_catalog": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"], "seed.the_tuva_project.ed_classification__categories": ["model.the_tuva_project.ed_classification__summary"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.hcc_suspecting__clinical_concepts": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"], "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": ["model.the_tuva_project.hcc_suspecting__int_all_conditions", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"], "seed.the_tuva_project.quality_measures__value_sets": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__exclusion"], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": ["model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__specialty_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": [], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": [], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": [], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": [], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": [], "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": [], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": [], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": [], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": [], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": [], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": [], "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": [], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": [], "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": [], "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": [], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": [], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": [], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": [], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": [], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": [], "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": []}, "group_map": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v9.json", "dbt_version": "1.5.0", "generated_at": "2024-05-16T18:33:00.776483Z", "invocation_id": "fb3eb4b0-505e-4191-84ff-ade431f461ad", "env": {}, "project_id": "c67fdb5d91230d67641e7c60c81d655e", "user_id": "c5ffe329-cd24-4f82-be78-c62b00387d3d", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.input_layer.condition": {"database": "tuva", "schema": "input_layer", "name": "condition", "resource_type": "model", "package_name": "input_layer", "path": "condition.sql", "original_file_path": "models\\condition.sql", "unique_id": "model.input_layer.condition", "fqn": ["input_layer", "condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "fd5a2e69238bb9f06a12484e6c46a68707468fa2fd98873a283aca3f0831b6b0"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.542193, "relation_name": "tuva.input_layer.condition", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as condition_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as recorded_date\r\n , cast(null as date) as onset_date\r\n , cast(null as date) as resolved_date\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as condition_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\condition.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as condition_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as recorded_date\n , cast(null as date) as onset_date\n , cast(null as date) as resolved_date\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as condition_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as INT ) as condition_rank\n , cast(null as TEXT ) as present_on_admit_code\n , cast(null as TEXT ) as present_on_admit_description\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.eligibility": {"database": "tuva", "schema": "input_layer", "name": "eligibility", "resource_type": "model", "package_name": "input_layer", "path": "eligibility.sql", "original_file_path": "models\\eligibility.sql", "unique_id": "model.input_layer.eligibility", "fqn": ["input_layer", "eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "661cec35069d9f34735769dad63e9aa7b4cb649c518f33fa3f37260b3e2ad0c0"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The eligibility table includes information about a patient's health insurance coverage and demographics (note: we use the word patient as a synonym for member). Every claims dataset should include some sort of eligibility data, otherwise it's impossible to calculate member months, which are needed to calculate measures like PMPM.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "social_security_number": {"name": "social_security_number", "description": "Patient's social security number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_relation": {"name": "subscriber_relation", "description": "Relationship to the policy holder (self, spouse, dependent, etc)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.4610863, "relation_name": "tuva.input_layer.eligibility", "raw_code": "select\r\n patient_id\r\n , member_id\r\n , subscriber_id\r\n , gender\r\n , race\r\n , birth_date\r\n , death_date\r\n , death_flag\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\n , plan\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , first_name\r\n , last_name\r\n , social_security_number\r\n , subscriber_relation\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , phone\r\n , data_source\r\nfrom {{ ref('eligibility_seed') }}", "language": "sql", "refs": [{"name": "eligibility_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.eligibility_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\eligibility.sql", "compiled": true, "compiled_code": "select\n patient_id\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , subscriber_relation\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom dev_thuxuan._tuva_synthetic.eligibility_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.encounter": {"database": "tuva", "schema": "input_layer", "name": "encounter", "resource_type": "model", "package_name": "input_layer", "path": "encounter.sql", "original_file_path": "models\\encounter.sql", "unique_id": "model.input_layer.encounter", "fqn": ["input_layer", "encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "54f63dfde51bec68e80739b7dc257bd4de6ba5ce304c6ccb847dd5765116ee98"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.552901, "relation_name": "tuva.input_layer.encounter", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , cast(null as date) as encounter_start_date\r\n , cast(null as date) as encounter_end_date\r\n , cast(null as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(null as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(null as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\encounter.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_type\n , cast(null as date) as encounter_start_date\n , cast(null as date) as encounter_end_date\n , cast(null as INT ) as length_of_stay\n , cast(null as TEXT ) as admit_source_code\n , cast(null as TEXT ) as admit_source_description\n , cast(null as TEXT ) as admit_type_code\n , cast(null as TEXT ) as admit_type_description\n , cast(null as TEXT ) as discharge_disposition_code\n , cast(null as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(null as TEXT ) as facility_npi\n , cast(null as TEXT ) as primary_diagnosis_code_type\n , cast(null as TEXT ) as primary_diagnosis_code\n , cast(null as TEXT ) as primary_diagnosis_description\n , cast(null as TEXT ) as ms_drg_code\n , cast(null as TEXT ) as ms_drg_description\n , cast(null as TEXT ) as apr_drg_code\n , cast(null as TEXT ) as apr_drg_description\n , cast(null as numeric(28,6) ) as paid_amount\n , cast(null as numeric(28,6) ) as allowed_amount\n , cast(null as numeric(28,6) ) as charge_amount\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.lab_result": {"database": "tuva", "schema": "input_layer", "name": "lab_result", "resource_type": "model", "package_name": "input_layer", "path": "lab_result.sql", "original_file_path": "models\\lab_result.sql", "unique_id": "model.input_layer.lab_result", "fqn": ["input_layer", "lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "46aef97252e6408feeb23ae4e452e12dbf5f1e5ce40259c7ac62d5ca99694e62"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5640185, "relation_name": "tuva.input_layer.lab_result", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as accession_number\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as source_component\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_component\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as date) as result_date\r\n , cast(null as date) as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_int() }} ) as source_abnormal_flag\r\n , cast(null as {{ dbt.type_int() }} ) as normalized_abnormal_flag\r\n , cast(null as {{ dbt.type_string() }} ) as specimen\r\n , cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\lab_result.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as lab_result_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as accession_number\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as source_component\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as normalized_component\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as result\n , cast(null as date) as result_date\n , cast(null as date) as collection_date\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as INT ) as source_abnormal_flag\n , cast(null as INT ) as normalized_abnormal_flag\n , cast(null as TEXT ) as specimen\n , cast(null as TEXT ) as ordering_practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.location": {"database": "tuva", "schema": "input_layer", "name": "location", "resource_type": "model", "package_name": "input_layer", "path": "location.sql", "original_file_path": "models\\location.sql", "unique_id": "model.input_layer.location", "fqn": ["input_layer", "location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "a3cc89396df2108c97443fd31d5d477be676335833a32273412335cea3846d32"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5696113, "relation_name": "tuva.input_layer.location", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as location_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(null as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\location.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as location_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as name\n , cast(null as TEXT ) as facility_type\n , cast(null as TEXT ) as parent_organization\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.medical_claim": {"database": "tuva", "schema": "input_layer", "name": "medical_claim", "resource_type": "model", "package_name": "input_layer", "path": "medical_claim.sql", "original_file_path": "models\\medical_claim.sql", "unique_id": "model.input_layer.medical_claim", "fqn": ["input_layer", "medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "b8acd6c51e8d818339390054e79658a5c1f43fb1c78c8315fcaafad1a6c905be"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The medical_claim table contains information on healthcare services and supplies provided to patients, billed by providers, and paid for by health insurers. It includes information on the provider who rendered the service, the amount paid for the service by the health insurer, and the underlying reason for the service (i.e. diagnosis).\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.525821, "relation_name": "tuva.input_layer.medical_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\nfrom {{ ref('medical_claim_seed') }}", "language": "sql", "refs": [{"name": "medical_claim_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.medical_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\medical_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom dev_thuxuan._tuva_synthetic.medical_claim_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.medication": {"database": "tuva", "schema": "input_layer", "name": "medication", "resource_type": "model", "package_name": "input_layer", "path": "medication.sql", "original_file_path": "models\\medication.sql", "unique_id": "model.input_layer.medication", "fqn": ["input_layer", "medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "edd84aa9ccae7f9dcb9b35251db51aaf59471621f9d7ddb3839cacba4e44665f"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5775373, "relation_name": "tuva.input_layer.medication", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as medication_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as date) as dispensing_date\r\n , cast(null as date) as prescribing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_description\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_description\r\n , cast(null as {{ dbt.type_string() }} ) as atc_code\r\n , cast(null as {{ dbt.type_string() }} ) as atc_description\r\n , cast(null as {{ dbt.type_string() }} ) as route\r\n , cast(null as {{ dbt.type_string() }} ) as strength\r\n , cast(null as {{ dbt.type_int() }} ) as quantity\r\n , cast(null as {{ dbt.type_string() }} ) as quantity_unit\r\n , cast(null as {{ dbt.type_int() }} ) as days_supply\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\medication.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as medication_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as date) as dispensing_date\n , cast(null as date) as prescribing_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as ndc_code\n , cast(null as TEXT ) as ndc_description\n , cast(null as TEXT ) as rxnorm_code\n , cast(null as TEXT ) as rxnorm_description\n , cast(null as TEXT ) as atc_code\n , cast(null as TEXT ) as atc_description\n , cast(null as TEXT ) as route\n , cast(null as TEXT ) as strength\n , cast(null as INT ) as quantity\n , cast(null as TEXT ) as quantity_unit\n , cast(null as INT ) as days_supply\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.observation": {"database": "tuva", "schema": "input_layer", "name": "observation", "resource_type": "model", "package_name": "input_layer", "path": "observation.sql", "original_file_path": "models\\observation.sql", "unique_id": "model.input_layer.observation", "fqn": ["input_layer", "observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "8e2826bb0302d2bc2414217c29d3c5f23a0cae4a2f360b9f3da32f4cc9265b2b"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5840786, "relation_name": "tuva.input_layer.observation", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as observation_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as panel_id\r\n , cast(null as date) as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as observation_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\observation.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as observation_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as panel_id\n , cast(null as date) as observation_date\n , cast(null as TEXT ) as observation_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as result\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.patient": {"database": "tuva", "schema": "input_layer", "name": "patient", "resource_type": "model", "package_name": "input_layer", "path": "patient.sql", "original_file_path": "models\\patient.sql", "unique_id": "model.input_layer.patient", "fqn": ["input_layer", "patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "9f00210edb56da76d293454989e473d5319a2286eaa72a3811de1c6eaac53711"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5902636, "relation_name": "tuva.input_layer.patient", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as sex\r\n , cast(null as {{ dbt.type_string() }} ) as race\r\n , cast(null as date) as birth_date\r\n , cast(null as date) as death_date\r\n , cast(null as {{ dbt.type_int() }} ) as death_flag\r\n , cast(null as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_string() }} ) as county\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\patient.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as sex\n , cast(null as TEXT ) as race\n , cast(null as date) as birth_date\n , cast(null as date) as death_date\n , cast(null as INT ) as death_flag\n , cast(null as TEXT ) as social_security_number\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as TEXT ) as county\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.pharmacy_claim": {"database": "tuva", "schema": "input_layer", "name": "pharmacy_claim", "resource_type": "model", "package_name": "input_layer", "path": "pharmacy_claim.sql", "original_file_path": "models\\pharmacy_claim.sql", "unique_id": "model.input_layer.pharmacy_claim", "fqn": ["input_layer", "pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a9e35276505dba374dbf183f43276406c21f3ace585c9aa4953b2340abbca4ad"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The pharmacy_claim table includes information about retail and specialty drug prescriptions that have been filled by a patient, billed by a pharmacy, and paid by an insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.535165, "relation_name": "tuva.input_layer.pharmacy_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , prescribing_provider_npi\r\n , dispensing_provider_npi\r\n , dispensing_date\r\n , ndc_code\r\n , quantity\r\n , days_supply\r\n , refills\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , data_source\r\nfrom {{ ref('pharmacy_claim_seed') }}", "language": "sql", "refs": [{"name": "pharmacy_claim_seed", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.pharmacy_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\pharmacy_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom dev_thuxuan._tuva_synthetic.pharmacy_claim_seed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.practitioner": {"database": "tuva", "schema": "input_layer", "name": "practitioner", "resource_type": "model", "package_name": "input_layer", "path": "practitioner.sql", "original_file_path": "models\\practitioner.sql", "unique_id": "model.input_layer.practitioner", "fqn": ["input_layer", "practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "9fe84cd99530a39b3a4dc46666835452ba3737366cdc09319eec8db1e5938446"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.5942802, "relation_name": "tuva.input_layer.practitioner", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(null as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\practitioner.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as practice_affiliation\n , cast(null as TEXT ) as specialty\n , cast(null as TEXT ) as sub_specialty\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.input_layer.procedure": {"database": "tuva", "schema": "input_layer", "name": "procedure", "resource_type": "model", "package_name": "input_layer", "path": "procedure.sql", "original_file_path": "models\\procedure.sql", "unique_id": "model.input_layer.procedure", "fqn": ["input_layer", "procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "e8c500fd5c02e356b37b6ceb88b3ab6709d5ed9bf878f965220f1050631630fa"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": ["input_layer"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#A91A4D"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["input_layer"], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#A91A4D"}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "docs": {"node_color": "#A91A4D"}, "database": "tuva", "schema": "input_layer", "tags": "input_layer"}, "created_at": 1715884192.6029613, "relation_name": "tuva.input_layer.procedure", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as procedure_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\procedure.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as procedure_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as procedure_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as modifier_1\n , cast(null as TEXT ) as modifier_2\n , cast(null as TEXT ) as modifier_3\n , cast(null as TEXT ) as modifier_4\n , cast(null as TEXT ) as modifier_5\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "seed.input_layer.eligibility_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "eligibility_seed", "resource_type": "seed", "package_name": "input_layer", "path": "eligibility_seed.csv", "original_file_path": "../seeds\\eligibility_seed.csv", "unique_id": "seed.input_layer.eligibility_seed", "fqn": ["input_layer", "eligibility_seed"], "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "2549b857a561cbc456ea0c03aeb4f92ad34297a41ae1b59a7a8959234bc910eb"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "subscriber_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "social_security_number": "varchar(255)", "subscriber_relation": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "subscriber_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "social_security_number": "varchar(255)", "subscriber_relation": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1715884192.3405328, "relation_name": "dev_thuxuan._tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.lab_result_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "lab_result_seed", "resource_type": "seed", "package_name": "input_layer", "path": "lab_result_seed.csv", "original_file_path": "../seeds\\lab_result_seed.csv", "unique_id": "seed.input_layer.lab_result_seed", "fqn": ["input_layer", "lab_result_seed"], "alias": "lab_result_seed", "checksum": {"name": "sha256", "checksum": "200211d64758e470275cc23e72be5ea67da2ed0355d3cf7cb950a84f6d121654"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"lab_result_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "accession_number": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "source_component": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "normalized_component": "varchar(255)", "status": "varchar(255)", "result": "varchar(255)", "result_date": "date", "collection_date": "date", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "source_abnormal_flag": "integer", "normalized_abnormal_flag": "integer", "specimen": "varchar(255)", "ordering_practitioner_id": "varchar(255)", "data_source": "varchar(255)", "tuva_last_run": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"lab_result_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "accession_number": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "source_component": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "normalized_component": "varchar(255)", "status": "varchar(255)", "result": "varchar(255)", "result_date": "date", "collection_date": "date", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "source_abnormal_flag": "integer", "normalized_abnormal_flag": "integer", "specimen": "varchar(255)", "ordering_practitioner_id": "varchar(255)", "data_source": "varchar(255)", "tuva_last_run": "varchar(255)"}}, "created_at": 1715884192.3579965, "relation_name": "dev_thuxuan._tuva_synthetic.lab_result_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.medical_claim_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "medical_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "medical_claim_seed.csv", "original_file_path": "../seeds\\medical_claim_seed.csv", "unique_id": "seed.input_layer.medical_claim_seed", "fqn": ["input_layer", "medical_claim_seed"], "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "b4abfdab9f7f5860d89707f27e7785218af75b4d3e66e24e6ec6b6d2307dcc3e"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "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": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "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": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "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": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "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": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}}, "created_at": 1715884192.4238544, "relation_name": "dev_thuxuan._tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.observation_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "observation_seed", "resource_type": "seed", "package_name": "input_layer", "path": "observation_seed.csv", "original_file_path": "../seeds\\observation_seed.csv", "unique_id": "seed.input_layer.observation_seed", "fqn": ["input_layer", "observation_seed"], "alias": "observation_seed", "checksum": {"name": "sha256", "checksum": "e2ac2f9ddeed287c2d9029d95c30b881e8fe06fc3d2877c593c0778f6f25f30a"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"observation_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "panel_id": "varchar(255)", "observation_date": "date", "observation_type": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "result": "varchar(255)", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"observation_id": "varchar(255)", "patient_id": "varchar(255)", "encounter_id": "varchar(255)", "panel_id": "varchar(255)", "observation_date": "date", "observation_type": "varchar(255)", "source_code_type": "varchar(255)", "source_code": "varchar(255)", "source_description": "varchar(255)", "normalized_code_type": "varchar(255)", "normalized_code": "varchar(255)", "normalized_description": "varchar(255)", "result": "varchar(255)", "source_units": "varchar(255)", "normalized_units": "varchar(255)", "source_reference_range_low": "varchar(255)", "source_reference_range_high": "varchar(255)", "normalized_reference_range_low": "varchar(255)", "normalized_reference_range_high": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1715884192.4378946, "relation_name": "dev_thuxuan._tuva_synthetic.observation_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.pharmacy_claim_seed": {"database": "dev_thuxuan", "schema": "_tuva_synthetic", "name": "pharmacy_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds\\pharmacy_claim_seed.csv", "unique_id": "seed.input_layer.pharmacy_claim_seed", "fqn": ["input_layer", "pharmacy_claim_seed"], "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "66096b86d7bd198c82e3c67c5546791e094b980d06ab9379d00e3b58c054dfd0"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}}, "created_at": 1715884192.4479694, "relation_name": "dev_thuxuan._tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ahrq_measures__pqi_denom_long": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__pqi_denom_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\final\\ahrq_measures__pqi_denom_long.sql", "original_file_path": "models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_denom_long.sql", "unique_id": "model.the_tuva_project.ahrq_measures__pqi_denom_long", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "final", "ahrq_measures__pqi_denom_long"], "alias": "pqi_denom_long", "checksum": {"name": "sha256", "checksum": "b6c017f3a97b0c9d3818d8e465a6f9611bfd842ad51a87cbb62e113aa107e753"}, "config": {"enabled": true, "alias": "pqi_denom_long", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Long table that unions the denominator for all the PQI measures.\n", "columns": {"year_number": {"name": "year_number", "description": "the year the patient qualified for the corresponding denominator", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pqi_number": {"name": "pqi_number", "description": "the number of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "pqi_denom_long", "tags": ["ahrq_measures", "pqi"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3194585, "relation_name": "dev_thuxuan.ahrq_measures.pqi_denom_long", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled', var('claims_enabled', var('tuva_marts_enabled', False))) | as_bool\r\n) }}\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 1 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_01_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 3 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_03_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 5 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_05_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 7 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_07_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 8 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_08_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 11 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_11_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 12 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_12_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 14 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_14_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 15 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_15_denom') }} as d\r\n\r\nunion all\r\n\r\nselect\r\n d.year_number\r\n , d.patient_id\r\n , d.data_source\r\n , 16 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_16_denom') }} as d", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_01_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_03_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_05_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_07_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_08_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_11_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_12_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_14_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_15_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_16_denom", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_denom"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_denom_long.sql", "compiled": true, "compiled_code": "\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 1 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_01_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 3 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_03_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 5 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_05_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 7 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_07_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 8 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_08_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 11 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_11_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 12 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_12_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 14 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_14_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 15 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_15_denom as d\n\nunion all\n\nselect\n d.year_number\n , d.patient_id\n , d.data_source\n , 16 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_16_denom as d", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__pqi_exclusion_long": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__pqi_exclusion_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\final\\ahrq_measures__pqi_exclusion_long.sql", "original_file_path": "models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_exclusion_long.sql", "unique_id": "model.the_tuva_project.ahrq_measures__pqi_exclusion_long", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "final", "ahrq_measures__pqi_exclusion_long"], "alias": "pqi_exclusion_long", "checksum": {"name": "sha256", "checksum": "f00bd5296ff94e72c5753ce1a627882acd21c066f6db8eb98b061eae43b81a01"}, "config": {"enabled": true, "alias": "pqi_exclusion_long", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Long table that unions the exclusions for all the PQI measures.\n", "columns": {"data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_number": {"name": "exclusion_number", "description": "for a given encounter and pqi measure, the number of exclusion it qualifies for.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pqi_number": {"name": "pqi_number", "description": "the number of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "pqi_exclusion_long", "tags": ["ahrq_measures", "pqi"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3255045, "relation_name": "dev_thuxuan.ahrq_measures.pqi_exclusion_long", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled', var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))) | as_bool\r\n) }}\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 1 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_01_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 3 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_03_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 5 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_05_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 7 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_07_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 8 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_08_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 11 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_11_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 12 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_12_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 14 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_14_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 15 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_15_exclusions') }} as e\r\n\r\nunion all\r\n\r\nselect\r\n e.data_source\r\n , e.encounter_id\r\n , e.exclusion_reason\r\n , e.exclusion_number\r\n , 16 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_16_exclusions') }} as e", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_01_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_03_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_05_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_07_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_08_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_11_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_12_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_14_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_15_exclusions", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_16_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_exclusion_long.sql", "compiled": true, "compiled_code": "\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 1 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_01_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 3 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_03_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 5 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_05_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 7 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_07_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 8 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_08_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 11 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_11_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 12 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_12_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 14 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_14_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 15 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_15_exclusions as e\n\nunion all\n\nselect\n e.data_source\n , e.encounter_id\n , e.exclusion_reason\n , e.exclusion_number\n , 16 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_16_exclusions as e", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__pqi_num_long": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__pqi_num_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\final\\ahrq_measures__pqi_num_long.sql", "original_file_path": "models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_num_long.sql", "unique_id": "model.the_tuva_project.ahrq_measures__pqi_num_long", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "final", "ahrq_measures__pqi_num_long"], "alias": "pqi_num_long", "checksum": {"name": "sha256", "checksum": "bb92a25d7d5421c0d43d0970a904d9ea954331b38de883c350376b71a4d415f7"}, "config": {"enabled": true, "alias": "pqi_num_long", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Long table that unions the numerator for all the PQI measures.\n", "columns": {"data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_number": {"name": "year_number", "description": "the year the patient qualified for the corresponding numerator", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_number": {"name": "exclusion_number", "description": "for a given encounter and pqi measure, the number of exclusion it qualifies for.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pqi_number": {"name": "pqi_number", "description": "the number of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "pqi_num_long", "tags": ["ahrq_measures", "pqi"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.330142, "relation_name": "dev_thuxuan.ahrq_measures.pqi_num_long", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled', var('claims_enabled', var('tuva_marts_enabled', False))) | as_bool\r\n) }}\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 1 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_01_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 3 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_03_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 5 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_05_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 7 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_07_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 8 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_08_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 11 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_11_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 12 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_12_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 14 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_14_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 15 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_15_num') }} as n\r\n\r\nunion all\r\n\r\nselect\r\n n.data_source\r\n , n.patient_id\r\n , n.year_number\r\n , n.encounter_id\r\n , 16 as pqi_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_16_num') }} as n", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_01_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_03_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_05_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_07_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_08_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_11_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_12_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_14_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_15_num", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_16_num", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__int_pqi_16_num"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_num_long.sql", "compiled": true, "compiled_code": "\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 1 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_01_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 3 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_03_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 5 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_05_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 7 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_07_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 8 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_08_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 11 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_11_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 12 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_12_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 14 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_14_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 15 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_15_num as n\n\nunion all\n\nselect\n n.data_source\n , n.patient_id\n , n.year_number\n , n.encounter_id\n , 16 as pqi_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_16_num as n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__pqi_rate": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__pqi_rate", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\final\\ahrq_measures__pqi_rate.sql", "original_file_path": "models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_rate.sql", "unique_id": "model.the_tuva_project.ahrq_measures__pqi_rate", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "final", "ahrq_measures__pqi_rate"], "alias": "pqi_rate", "checksum": {"name": "sha256", "checksum": "e5b36ecea66536db2dfcb8e1577caaf4e6f63c46783677ed3d4b1dcba8323d23"}, "config": {"enabled": true, "alias": "pqi_rate", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Table that combines numerator and denominator and calculates a rate per 100k\n", "columns": {"data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_number": {"name": "year_number", "description": "the year the patient qualified for the corresponding numerator", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pqi_number": {"name": "pqi_number", "description": "the number of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denom_count": {"name": "denom_count", "description": "the count of patients that qualified for the denominator of the corresponding year and pqi number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_count": {"name": "numerator_count", "description": "the count of patients that qualified for the numerator of the corresponding year and pqi number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rate_per_100_thousand": {"name": "rate_per_100_thousand", "description": "the calculated rate per 100 thousand (numerator divided by denominator, multiplied by 100000)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "pqi_rate", "tags": ["ahrq_measures", "pqi"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3355792, "relation_name": "dev_thuxuan.ahrq_measures.pqi_rate", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled', var('claims_enabled', var('tuva_marts_enabled', False))) | as_bool\r\n )\r\n}}\r\n\r\nwith num as (\r\n select\r\n data_source\r\n , year_number\r\n , pqi_number\r\n , count(encounter_id) as num_count\r\n from {{ ref('ahrq_measures__pqi_num_long') }}\r\n group by\r\n data_source\r\n , year_number\r\n , pqi_number\r\n)\r\n\r\n, denom as (\r\n select\r\n data_source\r\n , year_number\r\n , pqi_number\r\n , count(patient_id) as denom_count\r\n from {{ ref('ahrq_measures__pqi_denom_long') }} as d\r\n group by\r\n data_source\r\n , year_number\r\n , pqi_number\r\n)\r\n\r\nselect\r\n d.data_source\r\n , d.year_number\r\n , d.pqi_number\r\n , d.denom_count\r\n , coalesce(num.num_count, 0) as num_count\r\n , coalesce(num.num_count, 0) / d.denom_count * 100000 as rate_per_100_thousand\r\n , '{{ var('tuva_last_run') }}' as tuva_last_run\r\nfrom denom as d\r\nleft join num\r\n on d.pqi_number = num.pqi_number\r\n and d.year_number = num.year_number\r\n and d.data_source = num.data_source", "language": "sql", "refs": [{"name": "ahrq_measures__pqi_num_long", "package": null, "version": null}, {"name": "ahrq_measures__pqi_denom_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__pqi_num_long", "model.the_tuva_project.ahrq_measures__pqi_denom_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_rate.sql", "compiled": true, "compiled_code": "\n\nwith num as (\n select\n data_source\n , year_number\n , pqi_number\n , count(encounter_id) as num_count\n from dev_thuxuan.ahrq_measures.pqi_num_long\n group by\n data_source\n , year_number\n , pqi_number\n)\n\n, denom as (\n select\n data_source\n , year_number\n , pqi_number\n , count(patient_id) as denom_count\n from dev_thuxuan.ahrq_measures.pqi_denom_long as d\n group by\n data_source\n , year_number\n , pqi_number\n)\n\nselect\n d.data_source\n , d.year_number\n , d.pqi_number\n , d.denom_count\n , coalesce(num.num_count, 0) as num_count\n , coalesce(num.num_count, 0) / d.denom_count * 100000 as rate_per_100_thousand\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom denom as d\nleft join num\n on d.pqi_number = num.pqi_number\n and d.year_number = num.year_number\n and d.data_source = num.data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__pqi_summary": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__pqi_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\final\\ahrq_measures__pqi_summary.sql", "original_file_path": "models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_summary.sql", "unique_id": "model.the_tuva_project.ahrq_measures__pqi_summary", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "final", "ahrq_measures__pqi_summary"], "alias": "pqi_summary", "checksum": {"name": "sha256", "checksum": "ffa639d2e74e3737e204df17a91c91f6f3e082ff9d3a26ee17cad9af625e0c11"}, "config": {"enabled": true, "alias": "pqi_summary", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Summary table for pqi numerators that bring in encounter details for analytics reporting.\n", "columns": {"pqi_number": {"name": "pqi_number", "description": "the number of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pqi_name": {"name": "pqi_name", "description": "the name of the pqi measure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_number": {"name": "year_number", "description": "the year the patient qualified for the corresponding numerator", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed). \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "pqi_summary", "tags": ["ahrq_measures", "pqi"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.344666, "relation_name": "dev_thuxuan.ahrq_measures.pqi_summary", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect p.pqi_number\r\n , m.pqi_name\r\n , e.year_number\r\n , e.encounter_id\r\n , e.data_source\r\n , e.patient_id\r\n , e.facility_npi\r\n , e.ms_drg_code\r\n , e.ms_drg_description\r\n , e.encounter_start_date\r\n , e.encounter_end_date\r\n , e.length_of_stay\r\n , e.paid_amount\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ref('ahrq_measures__pqi_num_long')}} p \r\ninner join {{ref('ahrq_measures__stg_pqi_inpatient_encounter')}} e on p.encounter_id = e.encounter_id\r\nand\r\np.data_source = e.data_source\r\ninner join {{ ref('pqi__measures') }} m on cast(p.pqi_number as {{ dbt.type_string() }}) = m.pqi_number", "language": "sql", "refs": [{"name": "ahrq_measures__pqi_num_long", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.ahrq_measures__pqi_num_long", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\final\\ahrq_measures__pqi_summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select p.pqi_number\n , m.pqi_name\n , e.year_number\n , e.encounter_id\n , e.data_source\n , e.patient_id\n , e.facility_npi\n , e.ms_drg_code\n , e.ms_drg_description\n , e.encounter_start_date\n , e.encounter_end_date\n , e.length_of_stay\n , e.paid_amount\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures.pqi_num_long p \ninner join __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter e on p.encounter_id = e.encounter_id\nand\np.data_source = e.data_source\ninner join dev_thuxuan.ahrq_measures._value_set_pqi_measures m on cast(p.pqi_number as TEXT) = m.pqi_number", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_01_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_01_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_01_denom"], "alias": "_int_pqi_01_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_01_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 01 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_01_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3475869, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_01_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_01_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_01_exclusions"], "alias": "_int_pqi_01_exclusions", "checksum": {"name": "sha256", "checksum": "2e9f248577fcba00f9995c917ab31a4234a6f7b03b6730ae942d34eaf13451d1"}, "config": {"enabled": true, "alias": "_int_pqi_01_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 01 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_01_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3527668, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_01_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_exclusions.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_01_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_01_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_01_num"], "alias": "_int_pqi_01_num", "checksum": {"name": "sha256", "checksum": "98ed1e83fed45bbb2e260ad3d3f0d42d5fd4d3473f837cde820cb6d3a20150dc"}, "config": {"enabled": true, "alias": "_int_pqi_01_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 01 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_01_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.35776, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_01_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as pqi\r\n on e.primary_diagnosis_code = pqi.code\r\n and pqi.value_set_name = 'diabetes_with_short-term_complications_diagnosis_codes'\r\n and pqi.pqi_number = '01'\r\ninner join {{ ref('ahrq_measures__int_pqi_01_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_01_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_01_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_01_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_01_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi\n on e.primary_diagnosis_code = pqi.code\n and pqi.value_set_name = 'diabetes_with_short-term_complications_diagnosis_codes'\n and pqi.pqi_number = '01'\ninner join dev_thuxuan.ahrq_measures._int_pqi_01_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_01_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_03_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_03_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_03_denom"], "alias": "_int_pqi_03_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_03_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 03 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_03_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.362764, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_03_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_03_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_03_exclusions"], "alias": "_int_pqi_03_exclusions", "checksum": {"name": "sha256", "checksum": "2e9f248577fcba00f9995c917ab31a4234a6f7b03b6730ae942d34eaf13451d1"}, "config": {"enabled": true, "alias": "_int_pqi_03_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 03 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_03_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3657641, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_03_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_exclusions.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_03_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_03_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_03_num"], "alias": "_int_pqi_03_num", "checksum": {"name": "sha256", "checksum": "e9c8ac81fe875f54a168e2ed5cc0e5cfc321fb10237c8eb2080c362928cc9612"}, "config": {"enabled": true, "alias": "_int_pqi_03_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 03 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_03_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.370292, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_03_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as pqi\r\n on e.primary_diagnosis_code = pqi.code\r\n and pqi.value_set_name = 'diabetes_with_long-term_complications_diagnosis_codes'\r\n and pqi.pqi_number = '03'\r\ninner join {{ ref('ahrq_measures__int_pqi_03_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_03_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_03_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_03_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_03_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi\n on e.primary_diagnosis_code = pqi.code\n and pqi.value_set_name = 'diabetes_with_long-term_complications_diagnosis_codes'\n and pqi.pqi_number = '03'\ninner join dev_thuxuan.ahrq_measures._int_pqi_03_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_03_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_05_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_05_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_05_denom"], "alias": "_int_pqi_05_denom", "checksum": {"name": "sha256", "checksum": "e84e51259c2bf84c7f30e4778e344c0b6a0548720abf0066b638a9466e2034c1"}, "config": {"enabled": true, "alias": "_int_pqi_05_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 05 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_05_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3733065, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_05_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 40", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 40", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_05_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_05_exclusions"], "alias": "_int_pqi_05_exclusions", "checksum": {"name": "sha256", "checksum": "1b7b4ba4744df260ab24e9c7210a8511570c81910b62a93bbb512fcd3e0d02a3"}, "config": {"enabled": true, "alias": "_int_pqi_05_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 05 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_05_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3762913, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_05_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith resp_an as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'cystic fibrosis' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi\r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'cystic_fibrosis_and_anomalies_of_the_respiratory_system'\r\n and pqi_number = '05'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from resp_an\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n),resp_an as (\n select distinct\n encounter_id\n , data_source\n , 'cystic fibrosis' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi\n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'cystic_fibrosis_and_anomalies_of_the_respiratory_system'\n and pqi_number = '05'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from resp_an\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_05_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_05_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_05_num"], "alias": "_int_pqi_05_num", "checksum": {"name": "sha256", "checksum": "9b81e63d2e84c68b1c636f121550a388e1a046f117a37569546b4574668768cc"}, "config": {"enabled": true, "alias": "_int_pqi_05_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 05 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_05_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3792925, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_05_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('ahrq_measures__int_pqi_05_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('pqi__value_sets') }} as copd\r\n on e.primary_diagnosis_code = copd.code\r\n and copd.value_set_name = 'chronic_obstructive_pulmonary_disorder'\r\n and copd.pqi_number = '05'\r\nleft join {{ ref('pqi__value_sets') }} as asthma\r\n on e.primary_diagnosis_code = asthma.code\r\n and asthma.value_set_name = 'asthma'\r\n and asthma.pqi_number = '05'\r\nleft join {{ ref('ahrq_measures__int_pqi_05_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null\r\n and (\r\n asthma.code is not null \r\n or copd.code is not null\r\n )", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_05_denom", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_05_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_05_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._int_pqi_05_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._value_set_pqi as copd\n on e.primary_diagnosis_code = copd.code\n and copd.value_set_name = 'chronic_obstructive_pulmonary_disorder'\n and copd.pqi_number = '05'\nleft join dev_thuxuan.ahrq_measures._value_set_pqi as asthma\n on e.primary_diagnosis_code = asthma.code\n and asthma.value_set_name = 'asthma'\n and asthma.pqi_number = '05'\nleft join dev_thuxuan.ahrq_measures._int_pqi_05_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null\n and (\n asthma.code is not null \n or copd.code is not null\n )", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_07_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_07_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_07_denom"], "alias": "_int_pqi_07_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_07_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 07 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_07_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3832908, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_07_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_07_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_07_exclusions"], "alias": "_int_pqi_07_exclusions", "checksum": {"name": "sha256", "checksum": "b60c45078c51a050ba51ab0c1fb7a8a4445bd810eed5933707874a1f9c530d91"}, "config": {"enabled": true, "alias": "_int_pqi_07_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 07 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_07_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3865123, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_07_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith cardiac as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'cardiac procedure' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'cardiac_procedure_codes'\r\n and pqi_number = 'appendix_b'\r\n where c.encounter_id is not null\r\n),\r\n\r\nckd as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'exclusion_kidney_disease_diagnosis_codes'\r\n and pqi_number = '07'\r\n where c.encounter_id is not null\r\n),\r\n\r\naccess as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'exclusion_dialysis_access_procedure_codes'\r\n and pqi.pqi_number = '07'\r\n where c.encounter_id is not null\r\n),\r\n\r\ncombine as (\r\n select\r\n c.encounter_id\r\n , c.data_source\r\n , 'ckd' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join ckd \r\n on c.encounter_id = ckd.encounter_id\r\n and c.data_source = ckd.data_source\r\n inner join access as a \r\n on c.encounter_id = a.encounter_id\r\n and c.data_source = a.data_source\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n \r\n union all\r\n \r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from cardiac\r\n \r\n union all\r\n \r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from combine\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n), __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n),cardiac as (\n select distinct\n encounter_id\n , data_source\n , 'cardiac procedure' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'cardiac_procedure_codes'\n and pqi_number = 'appendix_b'\n where c.encounter_id is not null\n),\n\nckd as (\n select distinct\n encounter_id\n , data_source\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'exclusion_kidney_disease_diagnosis_codes'\n and pqi_number = '07'\n where c.encounter_id is not null\n),\n\naccess as (\n select distinct\n encounter_id\n , data_source\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'exclusion_dialysis_access_procedure_codes'\n and pqi.pqi_number = '07'\n where c.encounter_id is not null\n),\n\ncombine as (\n select\n c.encounter_id\n , c.data_source\n , 'ckd' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join ckd \n on c.encounter_id = ckd.encounter_id\n and c.data_source = ckd.data_source\n inner join access as a \n on c.encounter_id = a.encounter_id\n and c.data_source = a.data_source\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n \n union all\n \n select\n encounter_id\n , data_source\n , exclusion_reason\n from cardiac\n \n union all\n \n select\n encounter_id\n , data_source\n , exclusion_reason\n from combine\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "sql": " __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_07_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_07_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_07_num"], "alias": "_int_pqi_07_num", "checksum": {"name": "sha256", "checksum": "46a6954ca4b781012ba59c719f7282de38901a7e87210ae8e317367eb53ca046"}, "config": {"enabled": true, "alias": "_int_pqi_07_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 07 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_07_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3895314, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_07_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'hypertension_diagnosis_codes'\r\n and hyp.pqi_number = '07'\r\ninner join {{ ref('ahrq_measures__int_pqi_07_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_07_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_07_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_07_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_07_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'hypertension_diagnosis_codes'\n and hyp.pqi_number = '07'\ninner join dev_thuxuan.ahrq_measures._int_pqi_07_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_07_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_08_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_08_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_08_denom"], "alias": "_int_pqi_08_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_08_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 08 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_08_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3935277, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_08_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_08_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_08_exclusions"], "alias": "_int_pqi_08_exclusions", "checksum": {"name": "sha256", "checksum": "5a1f1a9f1073be8107e7d4c81b08213faf5f683ee1ae051d509d2112f2160493"}, "config": {"enabled": true, "alias": "_int_pqi_08_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 08 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_08_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.3965209, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_08_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith cardiac as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'cardiac procedure' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'cardiac_procedure_codes'\r\n and pqi.pqi_number = 'appendix_b'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from cardiac\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n),cardiac as (\n select distinct\n encounter_id\n , data_source\n , 'cardiac procedure' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'cardiac_procedure_codes'\n and pqi.pqi_number = 'appendix_b'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from cardiac\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "sql": " __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_08_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_08_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_08_num"], "alias": "_int_pqi_08_num", "checksum": {"name": "sha256", "checksum": "14bdfa1a3b83b86b7d1a28d69b302bb3d64f15f3d8c29f0b3ff9182fe173ed94"}, "config": {"enabled": true, "alias": "_int_pqi_08_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 08 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_08_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.399521, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_08_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'heart_failure_diagnosis_codes'\r\n and hyp.pqi_number = '08'\r\ninner join {{ ref('ahrq_measures__int_pqi_08_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_08_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_08_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_08_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_08_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'heart_failure_diagnosis_codes'\n and hyp.pqi_number = '08'\ninner join dev_thuxuan.ahrq_measures._int_pqi_08_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_08_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_11_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_11_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_11_denom"], "alias": "_int_pqi_11_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_11_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 11 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_11_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.403052, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_11_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_11_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_11_exclusions"], "alias": "_int_pqi_11_exclusions", "checksum": {"name": "sha256", "checksum": "6063e931d80245915346d49c033ad8d6a503163afb92e7a15c8606645ee0ba06"}, "config": {"enabled": true, "alias": "_int_pqi_11_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 11 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_11_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.407051, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_11_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith sickle_cell as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'sickle cell' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'sickle_cell_anemia_or_hb-s_disease_diagnosis_codes'\r\n and pqi.pqi_number = '11'\r\n where c.encounter_id is not null\r\n),\r\n\r\nimmune_dx as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'immunocompromised diagnosis' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'immunocompromised_state_diagnosis_codes'\r\n and pqi.pqi_number = 'appendix_c'\r\n where c.encounter_id is not null\r\n),\r\n\r\nimmune_px as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'immunocompromised procedure' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'immunocompromised_state_procedure_codes'\r\n and pqi.pqi_number = 'appendix_c'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from sickle_cell\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from immune_dx\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from immune_px\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n), __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n),sickle_cell as (\n select distinct\n encounter_id\n , data_source\n , 'sickle cell' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'sickle_cell_anemia_or_hb-s_disease_diagnosis_codes'\n and pqi.pqi_number = '11'\n where c.encounter_id is not null\n),\n\nimmune_dx as (\n select distinct\n encounter_id\n , data_source\n , 'immunocompromised diagnosis' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'immunocompromised_state_diagnosis_codes'\n and pqi.pqi_number = 'appendix_c'\n where c.encounter_id is not null\n),\n\nimmune_px as (\n select distinct\n encounter_id\n , data_source\n , 'immunocompromised procedure' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'immunocompromised_state_procedure_codes'\n and pqi.pqi_number = 'appendix_c'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from sickle_cell\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from immune_dx\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from immune_px\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "sql": " __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_11_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_11_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_11_num"], "alias": "_int_pqi_11_num", "checksum": {"name": "sha256", "checksum": "8a1de0f82c3792ffa784da2b8ec77ac9f09c9bef484e3a638ebf5044ef09e141"}, "config": {"enabled": true, "alias": "_int_pqi_11_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 11 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_11_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4100487, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_11_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'community_acquired_bacterial_pneumonia_diagnosis_codes'\r\n and hyp.pqi_number = '11'\r\ninner join {{ ref('ahrq_measures__int_pqi_11_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_11_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_11_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_11_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_11_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'community_acquired_bacterial_pneumonia_diagnosis_codes'\n and hyp.pqi_number = '11'\ninner join dev_thuxuan.ahrq_measures._int_pqi_11_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_11_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_12_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_12_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_12_denom"], "alias": "_int_pqi_12_denom", "checksum": {"name": "sha256", "checksum": "c25b22580b5986ed50887e009d82f314e5bf4526409ab47e4fd0beeebda25cae"}, "config": {"enabled": true, "alias": "_int_pqi_12_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 12 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_12_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4130485, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_12_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_denom.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_12_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_12_exclusions"], "alias": "_int_pqi_12_exclusions", "checksum": {"name": "sha256", "checksum": "d2505c66b1c7246d5b6df5defbba42892cb6cf286640b1f6236ec1ad3a477157"}, "config": {"enabled": true, "alias": "_int_pqi_12_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 12 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_12_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4160483, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_12_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith kidney as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'kidney' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'kidney_or_urinary_tract_disorder_diagnosis_codes'\r\n and pqi.pqi_number = '12'\r\n where c.encounter_id is not null\r\n),\r\n\r\nimmune_dx as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'immunocompromised diagnosis' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'immunocompromised_state_diagnosis_codes'\r\n and pqi.pqi_number = 'appendix_c'\r\n where c.encounter_id is not null\r\n),\r\n\r\nimmune_px as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'immunocompromised procedure' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'immunocompromised_state_procedure_codes'\r\n and pqi.pqi_number = 'appendix_c'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from kidney\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from immune_dx\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from immune_px\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n), __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n),kidney as (\n select distinct\n encounter_id\n , data_source\n , 'kidney' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'kidney_or_urinary_tract_disorder_diagnosis_codes'\n and pqi.pqi_number = '12'\n where c.encounter_id is not null\n),\n\nimmune_dx as (\n select distinct\n encounter_id\n , data_source\n , 'immunocompromised diagnosis' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'immunocompromised_state_diagnosis_codes'\n and pqi.pqi_number = 'appendix_c'\n where c.encounter_id is not null\n),\n\nimmune_px as (\n select distinct\n encounter_id\n , data_source\n , 'immunocompromised procedure' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'immunocompromised_state_procedure_codes'\n and pqi.pqi_number = 'appendix_c'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from kidney\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from immune_dx\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from immune_px\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "sql": " __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_12_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_12_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_12_num"], "alias": "_int_pqi_12_num", "checksum": {"name": "sha256", "checksum": "5fd851c21641b9ca6f46ed394bdb61210ffce7973bbc2f6fc4a61c11fa20ce44"}, "config": {"enabled": true, "alias": "_int_pqi_12_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 12 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_12_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4195588, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_12_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'urinary_tract_infection_diagnosis_codes'\r\n and hyp.pqi_number = '12'\r\ninner join {{ ref('ahrq_measures__int_pqi_12_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_12_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_12_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_12_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_12_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'urinary_tract_infection_diagnosis_codes'\n and hyp.pqi_number = '12'\ninner join dev_thuxuan.ahrq_measures._int_pqi_12_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_12_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_14_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_14_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_14_denom"], "alias": "_int_pqi_14_denom", "checksum": {"name": "sha256", "checksum": "3f6450f27d71f6008b5406561ad20f631f22f77085b820de11a1d72f0d00a6ca"}, "config": {"enabled": true, "alias": "_int_pqi_14_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 14 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_14_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4235585, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_14_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_14_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_14_exclusions"], "alias": "_int_pqi_14_exclusions", "checksum": {"name": "sha256", "checksum": "c53ffe2b2ae991258c3f32dab0577048eba62ee844781a5d2e56daea3e6960b0"}, "config": {"enabled": true, "alias": "_int_pqi_14_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 14 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_14_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.427146, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_14_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}", "language": "sql", "refs": [{"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_exclusions.sql", "compiled": true, "compiled_code": "\n\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_14_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_14_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_14_num"], "alias": "_int_pqi_14_num", "checksum": {"name": "sha256", "checksum": "db01b88eec96128f36116ed0b121da873363d797e250be8e27bcc252e27896bc"}, "config": {"enabled": true, "alias": "_int_pqi_14_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 14 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_14_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4302244, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_14_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'uncontrolled_diabetes_diagnosis_codes'\r\n and hyp.pqi_number = '14'\r\ninner join {{ ref('ahrq_measures__int_pqi_14_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_14_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_14_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_14_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_14_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'uncontrolled_diabetes_diagnosis_codes'\n and hyp.pqi_number = '14'\ninner join dev_thuxuan.ahrq_measures._int_pqi_14_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_14_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_15_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_15_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_15_denom"], "alias": "_int_pqi_15_denom", "checksum": {"name": "sha256", "checksum": "20c0e690a18e4fcc680a64c7b8a5fa38cb9b9e452c76477225386fa18eb7a54c"}, "config": {"enabled": true, "alias": "_int_pqi_15_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 15 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_15_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.43226, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_15_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18\r\n and\r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} <= 39", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_denom.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18\n and\n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) <= 39", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_15_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_15_exclusions"], "alias": "_int_pqi_15_exclusions", "checksum": {"name": "sha256", "checksum": "cffad90e73b8ee18f5a3792f57662a48b3cad2640974c0f4add28741271ec7ca"}, "config": {"enabled": true, "alias": "_int_pqi_15_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 15 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_15_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4354258, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_15_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith resp_an as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'cystic fibrosis' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'cystic_fibrosis_and_anomalies_of_the_respiratory_system_diagnosis_codes'\r\n and pqi.pqi_number = '15'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from resp_an\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_exclusions.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n),resp_an as (\n select distinct\n encounter_id\n , data_source\n , 'cystic fibrosis' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'cystic_fibrosis_and_anomalies_of_the_respiratory_system_diagnosis_codes'\n and pqi.pqi_number = '15'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from resp_an\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_15_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_15_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_15_num"], "alias": "_int_pqi_15_num", "checksum": {"name": "sha256", "checksum": "4e791c99510aba2483dd0932db89cf57f8127e874116276463f9b44712c6742c"}, "config": {"enabled": true, "alias": "_int_pqi_15_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 15 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_15_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4385026, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_15_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('pqi__value_sets') }} as hyp\r\n on e.primary_diagnosis_code = hyp.code\r\n and hyp.value_set_name = 'asthma_diagnosis_codes'\r\n and hyp.pqi_number = '15'\r\ninner join {{ ref('ahrq_measures__int_pqi_15_denom') }} as denom\r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\nleft join {{ ref('ahrq_measures__int_pqi_15_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_15_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_15_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_15_num.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)select\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._value_set_pqi as hyp\n on e.primary_diagnosis_code = hyp.code\n and hyp.value_set_name = 'asthma_diagnosis_codes'\n and hyp.pqi_number = '15'\ninner join dev_thuxuan.ahrq_measures._int_pqi_15_denom as denom\n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\nleft join dev_thuxuan.ahrq_measures._int_pqi_15_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_16_denom": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_16_denom", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_denom.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_denom.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_denom", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_16_denom"], "alias": "_int_pqi_16_denom", "checksum": {"name": "sha256", "checksum": "c25b22580b5986ed50887e009d82f314e5bf4526409ab47e4fd0beeebda25cae"}, "config": {"enabled": true, "alias": "_int_pqi_16_denom", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Denominator for PQI 16 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_16_denom", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4424329, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_16_denom", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n cast(left(e.year_month, 4) as int) as year_number\r\n , e.patient_id\r\n , e.data_source\r\n , {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} as age\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_member_months') }} as e\r\ninner join {{ ref('ahrq_measures__stg_pqi_patient') }} as p \r\n on e.patient_id = p.patient_id\r\n and p.data_source = e.data_source\r\nwhere \r\n {{ datediff('p.birth_date', 'e.first_day_of_month', 'year') }} >= 18", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_member_months", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_denom.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n), __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)select distinct\n cast(left(e.year_month, 4) as int) as year_number\n , e.patient_id\n , e.data_source\n , datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) as age\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_member_months as e\ninner join __dbt__cte__ahrq_measures__stg_pqi_patient as p \n on e.patient_id = p.patient_id\n and p.data_source = e.data_source\nwhere \n datediff(\n year,\n p.birth_date,\n e.first_day_of_month\n ) >= 18", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "sql": " __dbt__cte__ahrq_measures__stg_pqi_member_months as (\n\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_16_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_exclusions.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_exclusions.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_16_exclusions"], "alias": "_int_pqi_16_exclusions", "checksum": {"name": "sha256", "checksum": "c25013d3ed8ce14c13a5a1bb9b185abf2f3887359377f9a40e134361fae633d2"}, "config": {"enabled": true, "alias": "_int_pqi_16_exclusions", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic specific to PQI 16 measure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_16_exclusions", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4455094, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_16_exclusions", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith amputation as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'amputation' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'traumatic_amputation_of_the_lower_extremity_diagnosis_codes'\r\n and pqi.pqi_number = '16'\r\n where c.encounter_id is not null\r\n),\r\n\r\npregnancy as (\r\n select distinct\r\n encounter_id\r\n , data_source\r\n , 'pregnancy' as exclusion_reason\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi \r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'mdc_14_principal_diagnosis_codes'\r\n and pqi.pqi_number = 'appendix_f'\r\n where c.encounter_id is not null\r\n),\r\n\r\nunion_cte as (\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from {{ ref('ahrq_measures__int_pqi_shared_exclusion_union') }}\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from amputation\r\n\r\n union all\r\n\r\n select\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n from pregnancy\r\n)\r\n\r\nselect\r\n encounter_id\r\n , data_source\r\n , exclusion_reason\r\n , row_number() over (\r\n partition by encounter_id, data_source \r\n order by exclusion_reason\r\n ) as exclusion_number\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_union", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_exclusions.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n),amputation as (\n select distinct\n encounter_id\n , data_source\n , 'amputation' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'traumatic_amputation_of_the_lower_extremity_diagnosis_codes'\n and pqi.pqi_number = '16'\n where c.encounter_id is not null\n),\n\npregnancy as (\n select distinct\n encounter_id\n , data_source\n , 'pregnancy' as exclusion_reason\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi \n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'mdc_14_principal_diagnosis_codes'\n and pqi.pqi_number = 'appendix_f'\n where c.encounter_id is not null\n),\n\nunion_cte as (\n select\n encounter_id\n , data_source\n , exclusion_reason\n from dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from amputation\n\n union all\n\n select\n encounter_id\n , data_source\n , exclusion_reason\n from pregnancy\n)\n\nselect\n encounter_id\n , data_source\n , exclusion_reason\n , row_number() over (\n partition by encounter_id, data_source \n order by exclusion_reason\n ) as exclusion_number\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_16_num": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_16_num", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_num.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_num.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_num", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_16_num"], "alias": "_int_pqi_16_num", "checksum": {"name": "sha256", "checksum": "7e795b293849a1979803260139122f1835f1bd14d61158aaf701ff92ebc066e1"}, "config": {"enabled": true, "alias": "_int_pqi_16_num", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Numerator for PQI 16 measure calculation.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_16_num", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4485197, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_16_num", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled', var('claims_enabled', var('tuva_marts_enabled', false))) | as_bool\r\n)}}\r\n\r\nwith diagnosis as (\r\n select distinct\r\n c.encounter_id\r\n , c.data_source\r\n from {{ ref('ahrq_measures__stg_pqi_condition') }} as c\r\n inner join {{ ref('pqi__value_sets') }} as pqi\r\n on c.normalized_code = pqi.code\r\n and c.normalized_code_type = 'icd-10-cm'\r\n and pqi.value_set_name = 'diabetes_diagnosis_codes'\r\n and pqi_number = '16'\r\n where c.encounter_id is not null\r\n),\r\n\r\nprocedure as (\r\n select distinct\r\n p.encounter_id\r\n , p.data_source\r\n from {{ ref('ahrq_measures__stg_pqi_procedure') }} as p\r\n inner join diagnosis as d \r\n on p.encounter_id = d.encounter_id\r\n and d.data_source = p.data_source\r\n inner join {{ ref('pqi__value_sets') }} as pqi\r\n on p.normalized_code = pqi.code\r\n and p.normalized_code_type = 'icd-10-pcs'\r\n and pqi.value_set_name = 'lower-extremity_amputation_procedure_codes'\r\n and pqi_number = '16'\r\n)\r\n\r\nselect\r\n e.data_source\r\n , e.patient_id\r\n , e.year_number\r\n , e.encounter_id\r\n , '{{ var('tuva_last_run') }}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as e\r\ninner join {{ ref('ahrq_measures__int_pqi_16_denom') }} as denom \r\n on e.patient_id = denom.patient_id\r\n and e.data_source = denom.data_source\r\n and e.year_number = denom.year_number\r\ninner join procedure as p \r\n on e.encounter_id = p.encounter_id\r\n and e.data_source = p.data_source\r\nleft join {{ ref('ahrq_measures__int_pqi_16_exclusions') }} as shared\r\n on e.encounter_id = shared.encounter_id\r\n and e.data_source = shared.data_source\r\nwhere shared.encounter_id is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_condition", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_procedure", "package": null, "version": null}, {"name": "pqi__value_sets", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_16_denom", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_16_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_16_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_16_num.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n), __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n), __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n),diagnosis as (\n select distinct\n c.encounter_id\n , c.data_source\n from __dbt__cte__ahrq_measures__stg_pqi_condition as c\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi\n on c.normalized_code = pqi.code\n and c.normalized_code_type = 'icd-10-cm'\n and pqi.value_set_name = 'diabetes_diagnosis_codes'\n and pqi_number = '16'\n where c.encounter_id is not null\n),\n\nprocedure as (\n select distinct\n p.encounter_id\n , p.data_source\n from __dbt__cte__ahrq_measures__stg_pqi_procedure as p\n inner join diagnosis as d \n on p.encounter_id = d.encounter_id\n and d.data_source = p.data_source\n inner join dev_thuxuan.ahrq_measures._value_set_pqi as pqi\n on p.normalized_code = pqi.code\n and p.normalized_code_type = 'icd-10-pcs'\n and pqi.value_set_name = 'lower-extremity_amputation_procedure_codes'\n and pqi_number = '16'\n)\n\nselect\n e.data_source\n , e.patient_id\n , e.year_number\n , e.encounter_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as e\ninner join dev_thuxuan.ahrq_measures._int_pqi_16_denom as denom \n on e.patient_id = denom.patient_id\n and e.data_source = denom.data_source\n and e.year_number = denom.year_number\ninner join procedure as p \n on e.encounter_id = p.encounter_id\n and e.data_source = p.data_source\nleft join dev_thuxuan.ahrq_measures._int_pqi_16_exclusions as shared\n on e.encounter_id = shared.encounter_id\n and e.data_source = shared.data_source\nwhere shared.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "sql": " __dbt__cte__ahrq_measures__stg_pqi_condition as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "sql": " __dbt__cte__ahrq_measures__stg_pqi_procedure as (\n\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_missing_age", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_age.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_age.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_missing_age"], "alias": "_int_pqi_shared_exclusions_missing_age", "checksum": {"name": "sha256", "checksum": "ab1458de7037910e843d7747458aa1181d83032f3a07807c4d07f36cf043482f"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusions_missing_age", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Exclusion logic for patients without an age\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusions_missing_age", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.450523, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusions_missing_age", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n/* Exclude patients with missing age */\r\nselect \r\n data_source\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_patient') }}\r\nwhere birth_date is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_age.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)/* Exclude patients with missing age */\nselect \n data_source\n , patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_patient\nwhere birth_date is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_missing_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_dates.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_dates.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_missing_dates"], "alias": "_int_pqi_shared_exclusion_missing_dates", "checksum": {"name": "sha256", "checksum": "775302a6491381b7a519cefa8efff9387af4e73e04ef9a565fdb4755585e8f50"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_missing_dates", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Handles missing date fields across various PQI measures.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_missing_dates", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4550655, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_dates", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Exclude encounters with missing start dates\r\nselect\r\n encounter_id\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }}\r\nwhere \r\n encounter_start_date is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_dates.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)-- Exclude encounters with missing start dates\nselect\n encounter_id\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter\nwhere \n encounter_start_date is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_missing_gender", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_gender.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_gender.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_missing_gender"], "alias": "_int_pqi_shared_exclusion_missing_gender", "checksum": {"name": "sha256", "checksum": "c3377f5b39f1b23d874fa2ccb2a52aca84c723d43ccb3edfd4ea716cfa93ec5f"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_missing_gender", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Handles missing gender information for PQI measures.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_missing_gender", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4586613, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_gender", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Exclude patients with undefined or missing gender\r\nselect \r\n data_source\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_patient') }}\r\nwhere \r\n sex not in ('male', 'female')", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_gender.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)-- Exclude patients with undefined or missing gender\nselect \n data_source\n , patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_patient\nwhere \n sex not in ('male', 'female')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "sql": " __dbt__cte__ahrq_measures__stg_pqi_patient as (\n\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx"], "alias": "_int_pqi_shared_exclusion_missing_primary_dx", "checksum": {"name": "sha256", "checksum": "3ce0e57e85228abac1eed3f527fb6d3b18b3a5924a5275143a971584aa73e79e"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_missing_primary_dx", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Handles cases with missing primary diagnosis in PQI measure calculations.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_missing_primary_dx", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4616442, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_primary_dx", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n-- Exclude encounters with missing primary diagnosis code\r\nselect \r\n encounter_id\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }}\r\nwhere \r\n primary_diagnosis_code is null", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)-- Exclude encounters with missing primary diagnosis code\nselect \n encounter_id\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter\nwhere \n primary_diagnosis_code is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_transfer", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_transfer.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_transfer.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_transfer"], "alias": "_int_pqi_shared_exclusion_transfer", "checksum": {"name": "sha256", "checksum": "49ebb6b7513d0197b974815ea7f5572d4c3bd162651b6d673784485bf62d4aea"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_transfer", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Excludes transferred patients from PQI calculations.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_transfer", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4646595, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_transfer", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Exclude transfers from hospital, SNF, or other healthcare facility\r\nselect \r\n encounter_id\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }}\r\nwhere \r\n admit_source_code in ('4', '5', '6')", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_transfer.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)-- Exclude transfers from hospital, SNF, or other healthcare facility\nselect \n encounter_id\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter\nwhere \n admit_source_code in ('4', '5', '6')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg"], "alias": "_int_pqi_shared_exclusion_ungroupable_drg", "checksum": {"name": "sha256", "checksum": "091cad3853c48cc5a6b1fb466a335b68dd9a6437dec40e67217d3e95ac2ad3d5"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_ungroupable_drg", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Excludes patients with ungroupable DRGs from PQI measures.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_ungroupable_drg", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4676836, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_ungroupable_drg", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Exclude encounters with ungroupable DRG\r\nselect \r\n encounter_id\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }}\r\nwhere \r\n ms_drg_code = '999'", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)-- Exclude encounters with ungroupable DRG\nselect \n encounter_id\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter\nwhere \n ms_drg_code = '999'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__int_pqi_shared_exclusion_union", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_union.sql", "original_file_path": "models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_union.sql", "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "intermediate", "ahrq_measures__int_pqi_shared_exclusion_union"], "alias": "_int_pqi_shared_exclusion_union", "checksum": {"name": "sha256", "checksum": "7287b2e5b3891bec31350745392e6b2a3fe000e6b7bdfad2825bb386d7fb3269"}, "config": {"enabled": true, "alias": "_int_pqi_shared_exclusion_union", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Union of all exclusion criteria used across PQI measures for consistent exclusion logic.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_int_pqi_shared_exclusion_union", "tags": ["ahrq_measures", "pqi"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4720027, "relation_name": "dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_union", "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Missing Age Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'missing age' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_missing_age') }} as age\r\n on denom.patient_id = age.patient_id\r\n and denom.data_source = age.data_source\r\n\r\nunion all\r\n\r\n-- Missing Gender Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'missing gender' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_missing_gender') }} as gender\r\n on denom.patient_id = gender.patient_id\r\n and denom.data_source = gender.data_source\r\n\r\nunion all\r\n\r\n-- Missing Dates Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'missing dates' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_missing_dates') }} as dates\r\n on denom.encounter_id = dates.encounter_id\r\n and denom.data_source = dates.data_source\r\n\r\nunion all\r\n\r\n-- Missing Primary Diagnosis Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'missing primary diagnosis' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx') }} as dx\r\n on denom.encounter_id = dx.encounter_id\r\n and denom.data_source = dx.data_source\r\n\r\nunion all\r\n\r\n-- Transfer Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'transfer' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_transfer') }} as tx\r\n on denom.encounter_id = tx.encounter_id\r\n and denom.data_source = tx.data_source\r\n\r\nunion all\r\n\r\n-- Ungroupable DRG Exclusion\r\nselect \r\n denom.encounter_id\r\n , denom.data_source\r\n , 'ungroupable DRG' as exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ahrq_measures__stg_pqi_inpatient_encounter') }} as denom\r\ninner join {{ ref('ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg') }} as drg\r\n on denom.encounter_id = drg.encounter_id\r\n and denom.data_source = drg.data_source", "language": "sql", "refs": [{"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_missing_age", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_missing_gender", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_missing_dates", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_transfer", "package": null, "version": null}, {"name": "ahrq_measures__stg_pqi_inpatient_encounter", "package": null, "version": null}, {"name": "ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\intermediate\\ahrq_measures__int_pqi_shared_exclusion_union.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)-- Missing Age Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'missing age' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusions_missing_age as age\n on denom.patient_id = age.patient_id\n and denom.data_source = age.data_source\n\nunion all\n\n-- Missing Gender Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'missing gender' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_gender as gender\n on denom.patient_id = gender.patient_id\n and denom.data_source = gender.data_source\n\nunion all\n\n-- Missing Dates Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'missing dates' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_dates as dates\n on denom.encounter_id = dates.encounter_id\n and denom.data_source = dates.data_source\n\nunion all\n\n-- Missing Primary Diagnosis Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'missing primary diagnosis' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_missing_primary_dx as dx\n on denom.encounter_id = dx.encounter_id\n and denom.data_source = dx.data_source\n\nunion all\n\n-- Transfer Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'transfer' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_transfer as tx\n on denom.encounter_id = tx.encounter_id\n and denom.data_source = tx.data_source\n\nunion all\n\n-- Ungroupable DRG Exclusion\nselect \n denom.encounter_id\n , denom.data_source\n , 'ungroupable DRG' as exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as denom\ninner join dev_thuxuan.ahrq_measures._int_pqi_shared_exclusion_ungroupable_drg as drg\n on denom.encounter_id = drg.encounter_id\n and denom.data_source = drg.data_source", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "sql": " __dbt__cte__ahrq_measures__stg_pqi_inpatient_encounter as (\n\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__stg_pqi_condition": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__stg_pqi_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_condition.sql", "original_file_path": "models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_condition.sql", "unique_id": "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "staging", "ahrq_measures__stg_pqi_condition"], "alias": "_stg_pqi_condition", "checksum": {"name": "sha256", "checksum": "e930fd13cbf8987d99b336110c9db88dc8b1f3875ffcc9a6ce936fb450b0e4dc"}, "config": {"enabled": true, "alias": "_stg_pqi_condition", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Staging table for PQI condition, from core.condition.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_stg_pqi_condition", "tags": ["ahrq_measures", "pqi"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4790442, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n normalized_code_type\r\n , normalized_code\r\n , encounter_id\r\n , data_source\r\nfrom \r\n {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_condition.sql", "compiled": true, "compiled_code": "\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__stg_pqi_inpatient_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_inpatient_encounter.sql", "original_file_path": "models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_inpatient_encounter.sql", "unique_id": "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "staging", "ahrq_measures__stg_pqi_inpatient_encounter"], "alias": "_stg_pqi_inpatient_encounter", "checksum": {"name": "sha256", "checksum": "2d0db4c39cd6431fe4f0179e2da0e3796299fea423c48db00867bf5b75f1fd6e"}, "config": {"enabled": true, "alias": "_stg_pqi_inpatient_encounter", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Staging table for PQI inpatient encounters, serving as the basis for further PQI measure calculations.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_stg_pqi_inpatient_encounter", "tags": ["ahrq_measures", "pqi"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.475085, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id\r\n , data_source\r\n , ms_drg_code\r\n , ms_drg_description\r\n , admit_source_code\r\n , encounter_start_date\r\n , encounter_end_date\r\n , length_of_stay\r\n , primary_diagnosis_code\r\n , patient_id\r\n , facility_npi\r\n , paid_amount\r\n , {{ date_part('YEAR', 'encounter_start_date') }} as year_number\r\nfrom \r\n {{ ref('core__encounter') }}\r\nwhere \r\n encounter_type = 'acute inpatient'", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part"], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_inpatient_encounter.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id\n , data_source\n , ms_drg_code\n , ms_drg_description\n , admit_source_code\n , encounter_start_date\n , encounter_end_date\n , length_of_stay\n , primary_diagnosis_code\n , patient_id\n , facility_npi\n , paid_amount\n , date_part('YEAR', encounter_start_date) as year_number\nfrom \n dev_thuxuan.core.encounter\nwhere \n encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__stg_pqi_member_months": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__stg_pqi_member_months", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_member_months.sql", "original_file_path": "models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_member_months.sql", "unique_id": "model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "staging", "ahrq_measures__stg_pqi_member_months"], "alias": "_stg_pqi_member_months", "checksum": {"name": "sha256", "checksum": "b9cf36e8e8dfbf053f0ed48f7fc30950d7d72106c4e0c08d9ec53e5a9d5b818d"}, "config": {"enabled": true, "alias": "_stg_pqi_member_months", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Staging table for PQI member months, from financial_pmpm__member_months.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_stg_pqi_member_months", "tags": ["ahrq_measures", "pqi"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.481082, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith date_int as (\r\n select distinct\r\n replace(year_month,'-','') yyyymm\r\n , first_day_of_month\r\n from {{ ref('terminology__calendar') }} as c\r\n)\r\n\r\nselect \r\n data_source\r\n , patient_id\r\n , first_day_of_month\r\n , d.yyyymm as year_month\r\n\r\nfrom \r\n {{ ref('financial_pmpm__member_months') }} mm\r\ninner join date_int d on mm.year_month = d.yyyymm", "language": "sql", "refs": [{"name": "terminology__calendar", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_member_months.sql", "compiled": true, "compiled_code": "\n\nwith date_int as (\n select distinct\n replace(year_month,'-','') yyyymm\n , first_day_of_month\n from dev_thuxuan.terminology.calendar as c\n)\n\nselect \n data_source\n , patient_id\n , first_day_of_month\n , d.yyyymm as year_month\n\nfrom \n dev_thuxuan.financial_pmpm.member_months mm\ninner join date_int d on mm.year_month = d.yyyymm", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__stg_pqi_patient": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__stg_pqi_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_patient.sql", "original_file_path": "models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_patient.sql", "unique_id": "model.the_tuva_project.ahrq_measures__stg_pqi_patient", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "staging", "ahrq_measures__stg_pqi_patient"], "alias": "_stg_pqi_patient", "checksum": {"name": "sha256", "checksum": "e06845d29e0696b7132d670c23f06f2d15e2d84d1c17cb29f79b78f9ce840f2a"}, "config": {"enabled": true, "alias": "_stg_pqi_patient", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Staging table for PQI patient, from core.patient.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_stg_pqi_patient", "tags": ["ahrq_measures", "pqi"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4841166, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n data_source\r\n , birth_date\r\n , patient_id\r\n , sex\r\nfrom \r\n {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_patient.sql", "compiled": true, "compiled_code": "\n\nselect \n data_source\n , birth_date\n , patient_id\n , sex\nfrom \n dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ahrq_measures__stg_pqi_procedure": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "ahrq_measures__stg_pqi_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_procedure.sql", "original_file_path": "models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_procedure.sql", "unique_id": "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "fqn": ["the_tuva_project", "ahrq_measures", "pqi", "staging", "ahrq_measures__stg_pqi_procedure"], "alias": "_stg_pqi_procedure", "checksum": {"name": "sha256", "checksum": "fe47dce66938242affcd09c21c9f18c82c24f6557815c06a3d536735303048fc"}, "config": {"enabled": true, "alias": "_stg_pqi_procedure", "schema": "\n ahrq_measures", "database": null, "tags": ["ahrq_measures", "pqi"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ahrq_measures", "pqi"], "description": "Staging table for PQI condition, from core.procedure.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ahrq_measures\\pqi\\pqi_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "\n ahrq_measures", "alias": "_stg_pqi_procedure", "tags": ["ahrq_measures", "pqi"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4894495, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('pqi_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n normalized_code_type\r\n , normalized_code\r\n , encounter_id\r\n , data_source\r\nfrom \r\n {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ahrq_measures\\pqi\\staging\\ahrq_measures__stg_pqi_procedure.sql", "compiled": true, "compiled_code": "\n\nselect \n normalized_code_type\n , normalized_code\n , encounter_id\n , data_source\nfrom \n dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__long_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__long_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__long_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__long_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_condition_category"], "alias": "long_condition_category", "checksum": {"name": "sha256", "checksum": "04e7070502746dfc43e411d6398cca515fd69b52f9fab4f45137ade4aff0965f"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5071747, "relation_name": "dev_thuxuan.ccsr.long_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith ccsr__dx_vertical_pivot as (\r\n \r\n select * from {{ ref('ccsr__dx_vertical_pivot') }} \r\n\r\n), condition as (\r\n \r\n select * from {{ ref('ccsr__stg_core__condition') }}\r\n\r\n), dxccsr_body_systems as (\r\n\r\n select * from {{ ref('ccsr__dxccsr_v2023_1_body_systems') }}\r\n\r\n)\r\n\r\nselect \r\n condition.encounter_id,\r\n condition.claim_id,\r\n condition.patient_id,\r\n condition.normalized_code,\r\n ccsr__dx_vertical_pivot.code_description,\r\n condition.condition_rank,\r\n ccsr__dx_vertical_pivot.ccsr_parent_category,\r\n dxccsr_body_systems.body_system,\r\n dxccsr_body_systems.parent_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category,\r\n ccsr__dx_vertical_pivot.ccsr_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category_rank,\r\n ccsr__dx_vertical_pivot.is_ip_default_category,\r\n ccsr__dx_vertical_pivot.is_op_default_category,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom condition\r\nleft join ccsr__dx_vertical_pivot\r\n on condition.normalized_code = ccsr__dx_vertical_pivot.code\r\nleft join dxccsr_body_systems using(ccsr_parent_category)", "language": "sql", "refs": [{"name": "ccsr__dx_vertical_pivot", "package": null, "version": null}, {"name": "ccsr__stg_core__condition", "package": null, "version": null}, {"name": "ccsr__dxccsr_v2023_1_body_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'\n),ccsr__dx_vertical_pivot as (\n \n select * from dev_thuxuan.ccsr.dx_vertical_pivot \n\n), condition as (\n \n select * from __dbt__cte__ccsr__stg_core__condition\n\n), dxccsr_body_systems as (\n\n select * from dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_body_systems\n\n)\n\nselect \n condition.encounter_id,\n condition.claim_id,\n condition.patient_id,\n condition.normalized_code,\n ccsr__dx_vertical_pivot.code_description,\n condition.condition_rank,\n ccsr__dx_vertical_pivot.ccsr_parent_category,\n dxccsr_body_systems.body_system,\n dxccsr_body_systems.parent_category_description,\n ccsr__dx_vertical_pivot.ccsr_category,\n ccsr__dx_vertical_pivot.ccsr_category_description,\n ccsr__dx_vertical_pivot.ccsr_category_rank,\n ccsr__dx_vertical_pivot.is_ip_default_category,\n ccsr__dx_vertical_pivot.is_op_default_category,\n '2023.1' as dxccsr_version,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom condition\nleft join ccsr__dx_vertical_pivot\n on condition.normalized_code = ccsr__dx_vertical_pivot.code\nleft join dxccsr_body_systems using(ccsr_parent_category)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ccsr__stg_core__condition", "sql": " __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__long_procedure_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__long_procedure_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__long_procedure_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__long_procedure_category.sql", "unique_id": "model.the_tuva_project.ccsr__long_procedure_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_procedure_category"], "alias": "long_procedure_category", "checksum": {"name": "sha256", "checksum": "b730558911e6223946a523c8ce17320e7825cf8daa66a43d5f6447522c8a5b49"}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5188448, "relation_name": "dev_thuxuan.ccsr.long_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith procedure as (\r\n \r\n select * from {{ ref('ccsr__stg_core__procedure') }}\r\n\r\n), ccsr__procedure_category_map as (\r\n\r\n select * from {{ ref ('ccsr__procedure_category_map') }}\r\n\r\n)\r\n\r\nselect distinct\r\n procedure.encounter_id,\r\n procedure.patient_id,\r\n procedure.normalized_code,\r\n ccsr__procedure_category_map.code_description,\r\n ccsr__procedure_category_map.ccsr_parent_category,\r\n ccsr__procedure_category_map.ccsr_category,\r\n ccsr__procedure_category_map.ccsr_category_description,\r\n ccsr__procedure_category_map.clinical_domain,\r\n {{ var('prccsr_version') }} as prccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom procedure\r\nleft join ccsr__procedure_category_map\r\n on procedure.normalized_code = ccsr__procedure_category_map.code", "language": "sql", "refs": [{"name": "ccsr__stg_core__procedure", "package": null, "version": null}, {"name": "ccsr__procedure_category_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),procedure as (\n \n select * from __dbt__cte__ccsr__stg_core__procedure\n\n), ccsr__procedure_category_map as (\n\n select * from dev_thuxuan.ccsr.procedure_category_map\n\n)\n\nselect distinct\n procedure.encounter_id,\n procedure.patient_id,\n procedure.normalized_code,\n ccsr__procedure_category_map.code_description,\n ccsr__procedure_category_map.ccsr_parent_category,\n ccsr__procedure_category_map.ccsr_category,\n ccsr__procedure_category_map.ccsr_category_description,\n ccsr__procedure_category_map.clinical_domain,\n '2023.1' as prccsr_version,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom procedure\nleft join ccsr__procedure_category_map\n on procedure.normalized_code = ccsr__procedure_category_map.code", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ccsr__stg_core__procedure", "sql": " __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__singular_condition_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\final\\ccsr__singular_condition_category.sql", "original_file_path": "models\\ccsr\\final\\ccsr__singular_condition_category.sql", "unique_id": "model.the_tuva_project.ccsr__singular_condition_category", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__singular_condition_category"], "alias": "singular_condition_category", "checksum": {"name": "sha256", "checksum": "854eb4524c34f5adc61603a23e98a40537fc0be4c24fcb6b47bccfabec9b4e24"}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "singular_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5131748, "relation_name": "dev_thuxuan.ccsr.singular_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n ccsr_category_description,\r\n ccsr_parent_category,\r\n parent_category_description,\r\n body_system,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ref('ccsr__long_condition_category')}}\r\nwhere \r\n is_{{ var('record_type', 'ip') }}_default_category = true\r\n and condition_rank = 1", "language": "sql", "refs": [{"name": "ccsr__long_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n ccsr_category_description,\n ccsr_parent_category,\n parent_category_description,\n body_system,\n '2023.1' as dxccsr_version,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ccsr.long_condition_category\nwhere \n is_ip_default_category = true\n and condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dx_vertical_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "original_file_path": "models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__dx_vertical_pivot"], "alias": "dx_vertical_pivot", "checksum": {"name": "sha256", "checksum": "c9f8e28a9410fcf064b1981808503dfc12fb104051f21fc0e68e1b95ae036185"}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "dx_vertical_pivot", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4945257, "relation_name": "dev_thuxuan.ccsr.dx_vertical_pivot", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith codes as (\r\n \r\n select\r\n icd_10_cm_code as code, \r\n icd_10_cm_code_description as code_description,\r\n -- loop to generate columns for CCSR categories 1-6\r\n {%- for i in range(1,7) %}\r\n ccsr_category_{{ i }},\r\n ccsr_category_{{ i }}_description,\r\n {%- endfor %}\r\n default_ccsr_category_ip,\r\n default_ccsr_category_op\r\n from {{ ref('ccsr__dxccsr_v2023_1_cleaned_map') }}\r\n\r\n), long_union as (\r\n -- generate select & union statements to pivot category columns to rows\r\n {% for i in range(1,7,1) %}\r\n select \r\n code,\r\n code_description,\r\n left(ccsr_category_{{ i }}, 3) as ccsr_parent_category,\r\n ccsr_category_{{ i }} as ccsr_category,\r\n ccsr_category_{{ i }}_description as ccsr_category_description,\r\n {{ i }} as ccsr_category_rank,\r\n (ccsr_category_{{ i }} = default_ccsr_category_ip) as is_ip_default_category,\r\n (ccsr_category_{{ i }} = default_ccsr_category_op) as is_op_default_category\r\n from codes \r\n {{ \"union all\" if not loop.last else \"\" }}\r\n {%- endfor %}\r\n\r\n)\r\n\r\nselect distinct\r\n *,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom long_union\r\n-- as not all diagnosis codes have multiple categories, we can discard nulls\r\nwhere ccsr_category is not null", "language": "sql", "refs": [{"name": "ccsr__dxccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "compiled": true, "compiled_code": "\n\nwith codes as (\n \n select\n icd_10_cm_code as code, \n icd_10_cm_code_description as code_description,\n -- loop to generate columns for CCSR categories 1-6\n ccsr_category_1,\n ccsr_category_1_description,\n ccsr_category_2,\n ccsr_category_2_description,\n ccsr_category_3,\n ccsr_category_3_description,\n ccsr_category_4,\n ccsr_category_4_description,\n ccsr_category_5,\n ccsr_category_5_description,\n ccsr_category_6,\n ccsr_category_6_description,\n default_ccsr_category_ip,\n default_ccsr_category_op\n from dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_cleaned_map\n\n), long_union as (\n -- generate select & union statements to pivot category columns to rows\n \n select \n code,\n code_description,\n left(ccsr_category_1, 3) as ccsr_parent_category,\n ccsr_category_1 as ccsr_category,\n ccsr_category_1_description as ccsr_category_description,\n 1 as ccsr_category_rank,\n (ccsr_category_1 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_1 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_2, 3) as ccsr_parent_category,\n ccsr_category_2 as ccsr_category,\n ccsr_category_2_description as ccsr_category_description,\n 2 as ccsr_category_rank,\n (ccsr_category_2 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_2 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_3, 3) as ccsr_parent_category,\n ccsr_category_3 as ccsr_category,\n ccsr_category_3_description as ccsr_category_description,\n 3 as ccsr_category_rank,\n (ccsr_category_3 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_3 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_4, 3) as ccsr_parent_category,\n ccsr_category_4 as ccsr_category,\n ccsr_category_4_description as ccsr_category_description,\n 4 as ccsr_category_rank,\n (ccsr_category_4 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_4 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_5, 3) as ccsr_parent_category,\n ccsr_category_5 as ccsr_category,\n ccsr_category_5_description as ccsr_category_description,\n 5 as ccsr_category_rank,\n (ccsr_category_5 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_5 = default_ccsr_category_op) as is_op_default_category\n from codes \n union all\n select \n code,\n code_description,\n left(ccsr_category_6, 3) as ccsr_parent_category,\n ccsr_category_6 as ccsr_category,\n ccsr_category_6_description as ccsr_category_description,\n 6 as ccsr_category_rank,\n (ccsr_category_6 = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_6 = default_ccsr_category_op) as is_op_default_category\n from codes \n \n\n)\n\nselect distinct\n *,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom long_union\n-- as not all diagnosis codes have multiple categories, we can discard nulls\nwhere ccsr_category is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__procedure_category_map", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\intermediate\\ccsr__procedure_category_map.sql", "original_file_path": "models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "unique_id": "model.the_tuva_project.ccsr__procedure_category_map", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__procedure_category_map"], "alias": "procedure_category_map", "checksum": {"name": "sha256", "checksum": "0f6cd9ed03c512e1112e451dc9e2705bf170e21e45792fea675af9c9f27b1df9"}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "procedure_category_map", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.4995403, "relation_name": "dev_thuxuan.ccsr.procedure_category_map", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n icd_10_pcs as code,\r\n icd_10_pcs_description as code_description,\r\n prccsr as ccsr_category,\r\n left(prccsr, 3) as ccsr_parent_category,\r\n prccsr_description as ccsr_category_description,\r\n clinical_domain,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ccsr__prccsr_v2023_1_cleaned_map')}}", "language": "sql", "refs": [{"name": "ccsr__prccsr_v2023_1_cleaned_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "compiled": true, "compiled_code": "\n\nselect \n icd_10_pcs as code,\n icd_10_pcs_description as code_description,\n prccsr as ccsr_category,\n left(prccsr, 3) as ccsr_parent_category,\n prccsr_description as ccsr_category_description,\n clinical_domain,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "ccsr__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__condition.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__condition", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__condition"], "alias": "ccsr__stg_core__condition", "checksum": {"name": "sha256", "checksum": "53dcf3e02727e62f515ca661a5e705fa89f77182e14fd4c3e0105043d36c3b95"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5207803, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , claim_id\r\n , patient_id\r\n , normalized_code\r\n , condition_rank\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}\r\nwhere normalized_code_type = 'icd-10-cm'", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , claim_id\n , patient_id\n , normalized_code\n , condition_rank\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere normalized_code_type = 'icd-10-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "ccsr__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "ccsr\\staging\\ccsr__stg_core__procedure.sql", "original_file_path": "models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.ccsr__stg_core__procedure", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__procedure"], "alias": "ccsr__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "5c6186a586734d9fb78d7bfd57195a09b8cdea3ac126cfff7833b4ba8a0bc987"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5228157, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id\r\n , patient_id\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id\n , patient_id\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_long"], "alias": "cms_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "0214ba9004298fcecf5b2b221352442efb5afa854edd2c4752f1ee4edc2c7c08"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "cms_chronic_conditions_long", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5707216, "relation_name": "dev_thuxuan.chronic_conditions.cms_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions_unioned as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hiv_aids') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_oud') }}\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , start_date\r\n , chronic_condition_type\r\n , condition_category\r\n , condition\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom conditions_unioned", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith conditions_unioned as (\n\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\n union distinct\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\n union distinct\n select * from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\n\n)\n\nselect\n patient_id\n , claim_id\n , start_date\n , chronic_condition_type\n , condition_category\n , condition\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_wide"], "alias": "cms_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "50e44c6afcc69f43ad2bc6a07d331cc8102bdba94a61b5d7c6a20b4f43f28f5e"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "cms_chronic_conditions_wide", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5651765, "relation_name": "dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n chronic_conditions_unioned.patient_id\r\n , chronic_conditions.condition_column_name\r\n , 1 as condition_count\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_long') }} as chronic_conditions_unioned\r\n inner join chronic_conditions as chronic_conditions\r\n on chronic_conditions_unioned.condition = chronic_conditions.condition\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref ('chronic_conditions__cms_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n , order_by= 'condition_column_name'\r\n )\r\n , agg='max'\r\n , then_value= 1\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('cms_chronic_conditions__stg_core__patient') }} p\r\n left join conditions\r\n on p.patient_id = conditions.patient_id\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n\n)\n\n, conditions as (\n\n select\n chronic_conditions_unioned.patient_id\n , chronic_conditions.condition_column_name\n , 1 as condition_count\n from dev_thuxuan.chronic_conditions.cms_chronic_conditions_long as chronic_conditions_unioned\n inner join chronic_conditions as chronic_conditions\n on chronic_conditions_unioned.condition = chronic_conditions.condition\n\n)\n\nselect\n p.patient_id\n , \n \n max(\n \n case\n when condition_column_name = 'acute_myocardial_infarction'\n then 1\n else 0\n end\n )\n \n \n as acute_myocardial_infarction\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'adhd_conduct_disorders_and_hyperkinetic_syndrome'\n then 1\n else 0\n end\n )\n \n \n as adhd_conduct_disorders_and_hyperkinetic_syndrome\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'alcohol_use_disorders'\n then 1\n else 0\n end\n )\n \n \n as alcohol_use_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'alzheimers_disease'\n then 1\n else 0\n end\n )\n \n \n as alzheimers_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'anemia'\n then 1\n else 0\n end\n )\n \n \n as anemia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'anxiety_disorders'\n then 1\n else 0\n end\n )\n \n \n as anxiety_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'asthma'\n then 1\n else 0\n end\n )\n \n \n as asthma\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'atrial_fibrillation_and_flutter'\n then 1\n else 0\n end\n )\n \n \n as atrial_fibrillation_and_flutter\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'autism_spectrum_disorders'\n then 1\n else 0\n end\n )\n \n \n as autism_spectrum_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'benign_prostatic_hyperplasia'\n then 1\n else 0\n end\n )\n \n \n as benign_prostatic_hyperplasia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'bipolar_disorder'\n then 1\n else 0\n end\n )\n \n \n as bipolar_disorder\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_breast'\n then 1\n else 0\n end\n )\n \n \n as cancer_breast\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_colorectal'\n then 1\n else 0\n end\n )\n \n \n as cancer_colorectal\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_endometrial'\n then 1\n else 0\n end\n )\n \n \n as cancer_endometrial\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_lung'\n then 1\n else 0\n end\n )\n \n \n as cancer_lung\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_prostate'\n then 1\n else 0\n end\n )\n \n \n as cancer_prostate\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cancer_urologic_kidney_renal_pelvis_and_ureter'\n then 1\n else 0\n end\n )\n \n \n as cancer_urologic_kidney_renal_pelvis_and_ureter\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cataract'\n then 1\n else 0\n end\n )\n \n \n as cataract\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cerebral_palsy'\n then 1\n else 0\n end\n )\n \n \n as cerebral_palsy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'chronic_kidney_disease'\n then 1\n else 0\n end\n )\n \n \n as chronic_kidney_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'chronic_obstructive_pulmonary_disease'\n then 1\n else 0\n end\n )\n \n \n as chronic_obstructive_pulmonary_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'cystic_fibrosis_and_other_metabolic_developmental_disorders'\n then 1\n else 0\n end\n )\n \n \n as cystic_fibrosis_and_other_metabolic_developmental_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'depression_bipolar_or_other_depressive_mood_disorders'\n then 1\n else 0\n end\n )\n \n \n as depression_bipolar_or_other_depressive_mood_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'depressive_disorders'\n then 1\n else 0\n end\n )\n \n \n as depressive_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'diabetes'\n then 1\n else 0\n end\n )\n \n \n as diabetes\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'drug_use_disorders'\n then 1\n else 0\n end\n )\n \n \n as drug_use_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'epilepsy'\n then 1\n else 0\n end\n )\n \n \n as epilepsy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'fibromyalgia_and_chronic_pain_and_fatigue'\n then 1\n else 0\n end\n )\n \n \n as fibromyalgia_and_chronic_pain_and_fatigue\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'glaucoma'\n then 1\n else 0\n end\n )\n \n \n as glaucoma\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'heart_failure_and_non_ischemic_heart_disease'\n then 1\n else 0\n end\n )\n \n \n as heart_failure_and_non_ischemic_heart_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_a'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_a\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_b_acute_or_unspecified'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_b_acute_or_unspecified\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_b_chronic'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_b_chronic\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_acute'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_acute\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_chronic'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_chronic\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_c_unspecified'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_c_unspecified\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_d'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_d\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hepatitis_e'\n then 1\n else 0\n end\n )\n \n \n as hepatitis_e\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hip_pelvic_fracture'\n then 1\n else 0\n end\n )\n \n \n as hip_pelvic_fracture\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids'\n then 1\n else 0\n end\n )\n \n \n as human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hyperlipidemia'\n then 1\n else 0\n end\n )\n \n \n as hyperlipidemia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hypertension'\n then 1\n else 0\n end\n )\n \n \n as hypertension\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'hypothyroidism'\n then 1\n else 0\n end\n )\n \n \n as hypothyroidism\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'intellectual_disabilities_and_related_conditions'\n then 1\n else 0\n end\n )\n \n \n as intellectual_disabilities_and_related_conditions\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'ischemic_heart_disease'\n then 1\n else 0\n end\n )\n \n \n as ischemic_heart_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'learning_disabilities'\n then 1\n else 0\n end\n )\n \n \n as learning_disabilities\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'leukemias_and_lymphomas'\n then 1\n else 0\n end\n )\n \n \n as leukemias_and_lymphomas\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis'\n then 1\n else 0\n end\n )\n \n \n as liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'migraine_and_chronic_headache'\n then 1\n else 0\n end\n )\n \n \n as migraine_and_chronic_headache\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'mobility_impairments'\n then 1\n else 0\n end\n )\n \n \n as mobility_impairments\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'multiple_sclerosis_and_transverse_myelitis'\n then 1\n else 0\n end\n )\n \n \n as multiple_sclerosis_and_transverse_myelitis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'muscular_dystrophy'\n then 1\n else 0\n end\n )\n \n \n as muscular_dystrophy\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'non_alzheimers_dementia'\n then 1\n else 0\n end\n )\n \n \n as non_alzheimers_dementia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'obesity'\n then 1\n else 0\n end\n )\n \n \n as obesity\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'opioid_use_disorder_oud'\n then 1\n else 0\n end\n )\n \n \n as opioid_use_disorder_oud\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'osteoporosis_with_or_without_pathological_fracture'\n then 1\n else 0\n end\n )\n \n \n as osteoporosis_with_or_without_pathological_fracture\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'other_developmental_delays'\n then 1\n else 0\n end\n )\n \n \n as other_developmental_delays\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'parkinsons_disease_and_secondary_parkinsonism'\n then 1\n else 0\n end\n )\n \n \n as parkinsons_disease_and_secondary_parkinsonism\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'peripheral_vascular_disease_pvd'\n then 1\n else 0\n end\n )\n \n \n as peripheral_vascular_disease_pvd\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'personality_disorders'\n then 1\n else 0\n end\n )\n \n \n as personality_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'pneumonia_all_cause'\n then 1\n else 0\n end\n )\n \n \n as pneumonia_all_cause\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'post_traumatic_stress_disorder_ptsd'\n then 1\n else 0\n end\n )\n \n \n as post_traumatic_stress_disorder_ptsd\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'pressure_and_chronic_ulcers'\n then 1\n else 0\n end\n )\n \n \n as pressure_and_chronic_ulcers\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'rheumatoid_arthritis_osteoarthritis'\n then 1\n else 0\n end\n )\n \n \n as rheumatoid_arthritis_osteoarthritis\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'schizophrenia'\n then 1\n else 0\n end\n )\n \n \n as schizophrenia\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'schizophrenia_and_other_psychotic_disorders'\n then 1\n else 0\n end\n )\n \n \n as schizophrenia_and_other_psychotic_disorders\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sensory_blindness_and_visual_impairment'\n then 1\n else 0\n end\n )\n \n \n as sensory_blindness_and_visual_impairment\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sensory_deafness_and_hearing_impairment'\n then 1\n else 0\n end\n )\n \n \n as sensory_deafness_and_hearing_impairment\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'sickle_cell_disease'\n then 1\n else 0\n end\n )\n \n \n as sickle_cell_disease\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'spina_bifida_and_other_congenital_anomalies_of_the_nervous_system'\n then 1\n else 0\n end\n )\n \n \n as spina_bifida_and_other_congenital_anomalies_of_the_nervous_system\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'spinal_cord_injury'\n then 1\n else 0\n end\n )\n \n \n as spinal_cord_injury\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'stroke_transient_ischemic_attack'\n then 1\n else 0\n end\n )\n \n \n as stroke_transient_ischemic_attack\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'tobacco_use'\n then 1\n else 0\n end\n )\n \n \n as tobacco_use\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage'\n then 1\n else 0\n end\n )\n \n \n as traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage\n \n \n ,\n \n max(\n \n case\n when condition_column_name = 'viral_hepatitis_general'\n then 1\n else 0\n end\n )\n \n \n as viral_hepatitis_general\n \n \n \n \n\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__cms_chronic_conditions__stg_core__patient p\n left join conditions\n on p.patient_id = conditions.patient_id\ngroup by\n p.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_long"], "alias": "tuva_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "238205021f8f37691a836918d59008a60e8647c64ce4139bbb83c51ba95254c8"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_long", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6330204, "relation_name": "dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_conditions as (\r\nselect \r\n patient_id,\r\n normalized_code,\r\n recorded_date\r\n from {{ ref('tuva_chronic_conditions__stg_core__condition') }}\r\n),\r\n\r\n\r\nconditions_with_first_and_last_diagnosis_date as (\r\nselect \r\n patient_id,\r\n normalized_code as icd_10_cm,\r\n min(recorded_date) as first_diagnosis_date,\r\n max(recorded_date) as last_diagnosis_date\r\nfrom all_conditions\r\ngroup by patient_id, normalized_code\r\n\r\n)\r\n\r\n\r\nselect\r\n aa.patient_id,\r\n bb.concept_name as condition,\r\n min(first_diagnosis_date) as first_diagnosis_date,\r\n max(last_diagnosis_date) as last_diagnosis_date,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom conditions_with_first_and_last_diagnosis_date aa\r\ninner join {{ ref('value_set_member_relevant_fields') }} bb\r\non aa.icd_10_cm = bb.code\r\ngroup by aa.patient_id, bb.concept_name", "language": "sql", "refs": [{"name": "tuva_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "value_set_member_relevant_fields", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "model.the_tuva_project.value_set_member_relevant_fields"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__tuva_chronic_conditions__stg_core__condition as (\n\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n),all_conditions as (\nselect \n patient_id,\n normalized_code,\n recorded_date\n from __dbt__cte__tuva_chronic_conditions__stg_core__condition\n),\n\n\nconditions_with_first_and_last_diagnosis_date as (\nselect \n patient_id,\n normalized_code as icd_10_cm,\n min(recorded_date) as first_diagnosis_date,\n max(recorded_date) as last_diagnosis_date\nfrom all_conditions\ngroup by patient_id, normalized_code\n\n)\n\n\nselect\n aa.patient_id,\n bb.concept_name as condition,\n min(first_diagnosis_date) as first_diagnosis_date,\n max(last_diagnosis_date) as last_diagnosis_date,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom conditions_with_first_and_last_diagnosis_date aa\ninner join dev_thuxuan.clinical_concept_library.value_set_member_relevant_fields bb\non aa.icd_10_cm = bb.code\ngroup by aa.patient_id, bb.concept_name", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__tuva_chronic_conditions__stg_core__condition as (\n\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_wide"], "alias": "tuva_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "e262e74fea6bef9fff50e8562484f873cd9f1503f65f495f70e8da5b15362ad7"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_wide", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6533022, "relation_name": "dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\n),\r\n\r\nobesity as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Obesity'\r\n),\r\n\r\n\r\nosteoarthritis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Osteoarthritis'\r\n),\r\n\r\ncopd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Obstructive Pulmonary Disease'\r\n),\r\n\r\nanxiety_disorders as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Anxiety Disorders'\r\n),\r\n\r\nckd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Kidney Disease'\r\n),\r\n\r\nt2d as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Type 2 Diabetes Mellitus'\r\n),\r\n\r\ncll as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chronic Lymphocytic Leukemia'\r\n),\r\n\r\ndysplipidemias as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Dyslipidemias'\r\n),\r\n\r\nhypertension as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Hypertension'\r\n),\r\n\r\natherosclerosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Atherosclerosis'\r\n),\r\n\r\ndementia as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Dementia'\r\n),\r\n\r\nrheumatoid_arthritis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Rheumatoid Arthritis'\r\n),\r\n\r\nceliac as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Celiac Disease'\r\n),\r\n\r\nhip_fracture as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Hip Fracture'\r\n),\r\n\r\nimmunodeficiencies_and_white_blood_cell_disorders as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Specified Immunodeficiencies and White Blood Cell Disorders (HCC v28 concept #115)'\r\n),\r\n\r\nasthma as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Asthma'\r\n),\r\n\r\nt1d as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Type 1 Diabetes Mellitus'\r\n),\r\n\r\nulcerative_colitis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Ulcerative colitis'\r\n),\r\n\r\nchrohns as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Chrohn\\'s Disease'\r\n),\r\n\r\nholicobacter as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Helicobacter pylori Infection'\r\n),\r\n\r\nbipolar as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Bipolar Affective Disorder'\r\n),\r\n\r\nheart_failure as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Heart Failure'\r\n),\r\n\r\ntabacco as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Tobacco Use'\r\n),\r\n\r\nlyme as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Lyme Disease'\r\n),\r\n\r\nbreast_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Breast Cancer'\r\n),\r\n\r\nosteoporosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Osteoporosis'\r\n),\r\n\r\npulmonary_embolism as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Pulmonary Embolism, Thrombotic or Unspecified'\r\n),\r\n\r\nschizophrenia as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Schizophrenia'\r\n),\r\n\r\natrial_fibrillation as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Atrial Fibrillation'\r\n),\r\n\r\ncolorectal_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Colorectal Cancer'\r\n),\r\n\r\ndepression as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Major Depressive Disorder'\r\n),\r\n\r\ndeep_vein_thrombosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Deep Vein Thrombosis of Extremities or Central Veins'\r\n),\r\n\r\nalzheimer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Alzheimer Disease'\r\n),\r\n\r\nstroke as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Stroke'\r\n),\r\n\r\nmyocardial_infraction as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Myocardial Infarction'\r\n),\r\n\r\nopiod_use_disorder as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Opioid Use Disorder'\r\n),\r\n\r\nlung_cancer as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Lung cancer, primary or unspecified'\r\n),\r\n\r\nherpes as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Herpes Simplex Infection'\r\n),\r\n\r\nrickettsiosis as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Rickettsiosis'\r\n),\r\n\r\nms as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Multiple Sclerosis'\r\n),\r\n\r\nalchohol as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Alcohol Use Disorder'\r\n),\r\n\r\nadhd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Attention Deficit-Hyperactivity Disorder'\r\n),\r\n\r\nhiv as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'HIV/AIDS (HCC v28 concept #1)'\r\n),\r\n\r\nptsd as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Post-Traumatic Stress Disorder'\r\n),\r\n\r\nlupus as (\r\nselect distinct patient_id\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_long') }}\r\nwhere condition = 'Systemic Lupus Erythematosus'\r\n)\r\n\r\n\r\n\r\n\r\nselect\r\n patient_id,\r\n case when patient_id in (select * from obesity) then 1\r\n else 0\r\n end as obesity,\r\n case when patient_id in (select * from osteoarthritis) then 1\r\n else 0\r\n end as osteoarthritis,\r\n case when patient_id in (select * from copd) then 1\r\n else 0\r\n end as copd,\r\n case when patient_id in (select * from anxiety_disorders) then 1\r\n else 0\r\n end as anxiety_disorders,\r\n case when patient_id in (select * from ckd) then 1\r\n else 0\r\n end as ckd,\r\n case when patient_id in (select * from t2d) then 1\r\n else 0\r\n end as t2d,\r\n case when patient_id in (select * from cll) then 1\r\n else 0\r\n end as cll,\r\n case when patient_id in (select * from dysplipidemias) then 1\r\n else 0\r\n end as dysplipidemias,\r\n case when patient_id in (select * from hypertension) then 1\r\n else 0\r\n end as hypertension,\r\n case when patient_id in (select * from atherosclerosis) then 1\r\n else 0\r\n end as atherosclerosis,\r\n case when patient_id in (select * from dementia) then 1\r\n else 0\r\n end as dementia,\r\n case when patient_id in (select * from rheumatoid_arthritis) then 1\r\n else 0\r\n end as rheumatoid_arthritis,\r\n case when patient_id in (select * from celiac) then 1\r\n else 0\r\n end as celiac,\r\n case when patient_id in (select * from hip_fracture) then 1\r\n else 0\r\n end as hip_fracture,\r\n case when patient_id in (select * from immunodeficiencies_and_white_blood_cell_disorders) then 1\r\n else 0\r\n end as immunodeficiencies_and_white_blood_cell_disorders,\r\n case when patient_id in (select * from asthma) then 1\r\n else 0\r\n end as asthma,\r\n case when patient_id in (select * from t1d) then 1\r\n else 0\r\n end as t1d,\r\n case when patient_id in (select * from ulcerative_colitis) then 1\r\n else 0\r\n end as ulcerative_colitis,\r\n case when patient_id in (select * from chrohns) then 1\r\n else 0\r\n end as chrohns,\r\n case when patient_id in (select * from holicobacter) then 1\r\n else 0\r\n end as holicobacter,\r\n case when patient_id in (select * from bipolar) then 1\r\n else 0\r\n end as bipolar,\r\n case when patient_id in (select * from heart_failure) then 1\r\n else 0\r\n end as heart_failure,\r\n case when patient_id in (select * from tabacco) then 1\r\n else 0\r\n end as tabacco,\r\n case when patient_id in (select * from lyme) then 1\r\n else 0\r\n end as lyme,\r\n case when patient_id in (select * from breast_cancer) then 1\r\n else 0\r\n end as breast_cancer,\r\n case when patient_id in (select * from osteoporosis) then 1\r\n else 0\r\n end as osteoporosis,\r\n case when patient_id in (select * from pulmonary_embolism) then 1\r\n else 0\r\n end as pulmonary_embolism,\r\n case when patient_id in (select * from schizophrenia) then 1\r\n else 0\r\n end as schizophrenia,\r\n case when patient_id in (select * from atrial_fibrillation) then 1\r\n else 0\r\n end as atrial_fibrillation,\r\n case when patient_id in (select * from colorectal_cancer) then 1\r\n else 0\r\n end as colorectal_cancer,\r\n case when patient_id in (select * from depression) then 1\r\n else 0\r\n end as depression,\r\n case when patient_id in (select * from deep_vein_thrombosis) then 1\r\n else 0\r\n end as deep_vein_thrombosis,\r\n case when patient_id in (select * from alzheimer) then 1\r\n else 0\r\n end as alzheimer,\r\n case when patient_id in (select * from stroke) then 1\r\n else 0\r\n end as stroke,\r\n case when patient_id in (select * from myocardial_infraction) then 1\r\n else 0\r\n end as myocardial_infraction,\r\n case when patient_id in (select * from opiod_use_disorder) then 1\r\n else 0\r\n end as opiod_use_disorder,\r\n case when patient_id in (select * from lung_cancer) then 1\r\n else 0\r\n end as lung_cancer,\r\n case when patient_id in (select * from herpes) then 1\r\n else 0\r\n end as herpes,\r\n case when patient_id in (select * from rickettsiosis) then 1\r\n else 0\r\n end as rickettsiosis,\r\n case when patient_id in (select * from ms) then 1\r\n else 0\r\n end as ms,\r\n case when patient_id in (select * from alchohol) then 1\r\n else 0\r\n end as alchohol,\r\n case when patient_id in (select * from adhd) then 1\r\n else 0\r\n end as adhd,\r\n case when patient_id in (select * from hiv) then 1\r\n else 0\r\n end as hiv,\r\n case when patient_id in (select * from ptsd) then 1\r\n else 0\r\n end as ptsd,\r\n case when patient_id in (select * from lupus) then 1\r\n else 0\r\n end as lupus,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom patients", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}, {"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith patients as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\n),\n\nobesity as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Obesity'\n),\n\n\nosteoarthritis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Osteoarthritis'\n),\n\ncopd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Obstructive Pulmonary Disease'\n),\n\nanxiety_disorders as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Anxiety Disorders'\n),\n\nckd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Kidney Disease'\n),\n\nt2d as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Type 2 Diabetes Mellitus'\n),\n\ncll as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chronic Lymphocytic Leukemia'\n),\n\ndysplipidemias as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Dyslipidemias'\n),\n\nhypertension as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Hypertension'\n),\n\natherosclerosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Atherosclerosis'\n),\n\ndementia as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Dementia'\n),\n\nrheumatoid_arthritis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Rheumatoid Arthritis'\n),\n\nceliac as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Celiac Disease'\n),\n\nhip_fracture as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Hip Fracture'\n),\n\nimmunodeficiencies_and_white_blood_cell_disorders as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Specified Immunodeficiencies and White Blood Cell Disorders (HCC v28 concept #115)'\n),\n\nasthma as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Asthma'\n),\n\nt1d as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Type 1 Diabetes Mellitus'\n),\n\nulcerative_colitis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Ulcerative colitis'\n),\n\nchrohns as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Chrohn\\'s Disease'\n),\n\nholicobacter as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Helicobacter pylori Infection'\n),\n\nbipolar as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Bipolar Affective Disorder'\n),\n\nheart_failure as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Heart Failure'\n),\n\ntabacco as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Tobacco Use'\n),\n\nlyme as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Lyme Disease'\n),\n\nbreast_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Breast Cancer'\n),\n\nosteoporosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Osteoporosis'\n),\n\npulmonary_embolism as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Pulmonary Embolism, Thrombotic or Unspecified'\n),\n\nschizophrenia as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Schizophrenia'\n),\n\natrial_fibrillation as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Atrial Fibrillation'\n),\n\ncolorectal_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Colorectal Cancer'\n),\n\ndepression as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Major Depressive Disorder'\n),\n\ndeep_vein_thrombosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Deep Vein Thrombosis of Extremities or Central Veins'\n),\n\nalzheimer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Alzheimer Disease'\n),\n\nstroke as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Stroke'\n),\n\nmyocardial_infraction as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Myocardial Infarction'\n),\n\nopiod_use_disorder as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Opioid Use Disorder'\n),\n\nlung_cancer as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Lung cancer, primary or unspecified'\n),\n\nherpes as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Herpes Simplex Infection'\n),\n\nrickettsiosis as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Rickettsiosis'\n),\n\nms as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Multiple Sclerosis'\n),\n\nalchohol as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Alcohol Use Disorder'\n),\n\nadhd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Attention Deficit-Hyperactivity Disorder'\n),\n\nhiv as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'HIV/AIDS (HCC v28 concept #1)'\n),\n\nptsd as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Post-Traumatic Stress Disorder'\n),\n\nlupus as (\nselect distinct patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere condition = 'Systemic Lupus Erythematosus'\n)\n\n\n\n\nselect\n patient_id,\n case when patient_id in (select * from obesity) then 1\n else 0\n end as obesity,\n case when patient_id in (select * from osteoarthritis) then 1\n else 0\n end as osteoarthritis,\n case when patient_id in (select * from copd) then 1\n else 0\n end as copd,\n case when patient_id in (select * from anxiety_disorders) then 1\n else 0\n end as anxiety_disorders,\n case when patient_id in (select * from ckd) then 1\n else 0\n end as ckd,\n case when patient_id in (select * from t2d) then 1\n else 0\n end as t2d,\n case when patient_id in (select * from cll) then 1\n else 0\n end as cll,\n case when patient_id in (select * from dysplipidemias) then 1\n else 0\n end as dysplipidemias,\n case when patient_id in (select * from hypertension) then 1\n else 0\n end as hypertension,\n case when patient_id in (select * from atherosclerosis) then 1\n else 0\n end as atherosclerosis,\n case when patient_id in (select * from dementia) then 1\n else 0\n end as dementia,\n case when patient_id in (select * from rheumatoid_arthritis) then 1\n else 0\n end as rheumatoid_arthritis,\n case when patient_id in (select * from celiac) then 1\n else 0\n end as celiac,\n case when patient_id in (select * from hip_fracture) then 1\n else 0\n end as hip_fracture,\n case when patient_id in (select * from immunodeficiencies_and_white_blood_cell_disorders) then 1\n else 0\n end as immunodeficiencies_and_white_blood_cell_disorders,\n case when patient_id in (select * from asthma) then 1\n else 0\n end as asthma,\n case when patient_id in (select * from t1d) then 1\n else 0\n end as t1d,\n case when patient_id in (select * from ulcerative_colitis) then 1\n else 0\n end as ulcerative_colitis,\n case when patient_id in (select * from chrohns) then 1\n else 0\n end as chrohns,\n case when patient_id in (select * from holicobacter) then 1\n else 0\n end as holicobacter,\n case when patient_id in (select * from bipolar) then 1\n else 0\n end as bipolar,\n case when patient_id in (select * from heart_failure) then 1\n else 0\n end as heart_failure,\n case when patient_id in (select * from tabacco) then 1\n else 0\n end as tabacco,\n case when patient_id in (select * from lyme) then 1\n else 0\n end as lyme,\n case when patient_id in (select * from breast_cancer) then 1\n else 0\n end as breast_cancer,\n case when patient_id in (select * from osteoporosis) then 1\n else 0\n end as osteoporosis,\n case when patient_id in (select * from pulmonary_embolism) then 1\n else 0\n end as pulmonary_embolism,\n case when patient_id in (select * from schizophrenia) then 1\n else 0\n end as schizophrenia,\n case when patient_id in (select * from atrial_fibrillation) then 1\n else 0\n end as atrial_fibrillation,\n case when patient_id in (select * from colorectal_cancer) then 1\n else 0\n end as colorectal_cancer,\n case when patient_id in (select * from depression) then 1\n else 0\n end as depression,\n case when patient_id in (select * from deep_vein_thrombosis) then 1\n else 0\n end as deep_vein_thrombosis,\n case when patient_id in (select * from alzheimer) then 1\n else 0\n end as alzheimer,\n case when patient_id in (select * from stroke) then 1\n else 0\n end as stroke,\n case when patient_id in (select * from myocardial_infraction) then 1\n else 0\n end as myocardial_infraction,\n case when patient_id in (select * from opiod_use_disorder) then 1\n else 0\n end as opiod_use_disorder,\n case when patient_id in (select * from lung_cancer) then 1\n else 0\n end as lung_cancer,\n case when patient_id in (select * from herpes) then 1\n else 0\n end as herpes,\n case when patient_id in (select * from rickettsiosis) then 1\n else 0\n end as rickettsiosis,\n case when patient_id in (select * from ms) then 1\n else 0\n end as ms,\n case when patient_id in (select * from alchohol) then 1\n else 0\n end as alchohol,\n case when patient_id in (select * from adhd) then 1\n else 0\n end as adhd,\n case when patient_id in (select * from hiv) then 1\n else 0\n end as hiv,\n case when patient_id in (select * from ptsd) then 1\n else 0\n end as ptsd,\n case when patient_id in (select * from lupus) then 1\n else 0\n end as lupus,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n\nfrom patients", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_all", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_all"], "alias": "_int_cms_chronic_condition_all", "checksum": {"name": "sha256", "checksum": "a18ad9a5b0f085f926819b82e6d17431e78e0f15dfdad2ef15bf40df621db48a"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_all", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5757182, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, exclusions_diagnosis as (\r\n\r\n select distinct\r\n patient_conditions.claim_id\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Exclude'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_ms_drg\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_diagnosis\r\n on inclusions_unioned.claim_id = exclusions_diagnosis.claim_id\r\n and inclusions_unioned.condition = exclusions_diagnosis.condition\r\nwhere exclusions_diagnosis.claim_id is null", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_ms_drgs as (\n\n select\n patient_id\n , claim_id\n , claim_start_date as start_date\n , 'MS-DRG' as code_type\n , ms_drg_code as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_medical_claim\n\n)\n\n, patient_procedures as (\n\n select\n patient_id\n , claim_id\n , procedure_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__procedure\n\n)\n\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, inclusions_ms_drg as (\n\n select\n patient_ms_drgs.patient_id\n , patient_ms_drgs.claim_id\n , patient_ms_drgs.start_date\n , patient_ms_drgs.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_ms_drgs\n inner join chronic_conditions\n on patient_ms_drgs.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'MS-DRG'\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, inclusions_procedure as (\n\n select\n patient_procedures.patient_id\n , patient_procedures.claim_id\n , patient_procedures.start_date\n , patient_procedures.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_procedures\n inner join chronic_conditions\n on patient_procedures.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\n and chronic_conditions.additional_logic = 'None'\n\n)\n\n, exclusions_diagnosis as (\n\n select distinct\n patient_conditions.claim_id\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Exclude'\n and chronic_conditions.code_system = 'ICD-10-CM'\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_procedure\n union distinct\n select * from inclusions_ms_drg\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom inclusions_unioned\n left join exclusions_diagnosis\n on inclusions_unioned.claim_id = exclusions_diagnosis.claim_id\n and inclusions_unioned.condition = exclusions_diagnosis.condition\nwhere exclusions_diagnosis.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_hiv_aids"], "alias": "_int_cms_chronic_condition_hiv_aids", "checksum": {"name": "sha256", "checksum": "4f52818afa1d5527e38e7356d2d3b07c2181460240a4df8fcc43d8e8ccab3997"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_hiv_aids", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5807197, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)' -%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE excludes encounters with the exception code. Those encounters\r\n will be evaluated separately.\r\n*/\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code <> 'R75'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE includes encounters with the exception code only where that\r\n patient has another encounter that is not R75.\r\n*/\r\n, exception_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n inner join inclusions_diagnosis\r\n on patient_conditions.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code = 'R75'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_ms_drg\r\n union distinct\r\n select * from exception_diagnosis\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n where condition = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)'\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_ms_drgs as (\n\n select\n patient_id\n , claim_id\n , claim_start_date as start_date\n , 'MS-DRG' as code_type\n , ms_drg_code as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_medical_claim\n\n)\n\n/*\n Exception logic: a claim with the diagnosis code R75 requires a second\n qualifying claim that is not R75 (a screening code)\n\n This CTE excludes encounters with the exception code. Those encounters\n will be evaluated separately.\n*/\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.code <> 'R75'\n\n)\n\n, inclusions_ms_drg as (\n\n select\n patient_ms_drgs.patient_id\n , patient_ms_drgs.claim_id\n , patient_ms_drgs.start_date\n , patient_ms_drgs.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_ms_drgs\n inner join chronic_conditions\n on patient_ms_drgs.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'MS-DRG'\n\n)\n\n/*\n Exception logic: a claim with the diagnosis code R75 requires a second\n qualifying claim that is not R75 (a screening code)\n\n This CTE includes encounters with the exception code only where that\n patient has another encounter that is not R75.\n*/\n, exception_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n inner join inclusions_diagnosis\n on patient_conditions.patient_id = inclusions_diagnosis.patient_id\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n and chronic_conditions.code = 'R75'\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_ms_drg\n union distinct\n select * from exception_diagnosis\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom inclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_medical_claim as (\n\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_oud", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_oud"], "alias": "_int_cms_chronic_condition_oud", "checksum": {"name": "sha256", "checksum": "9eee4de2dfb008c08c12e666840e4637a62d57305ab567f01e978bd7e695a0ee"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_oud", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5862927, "relation_name": "dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Opioid Use Disorder (OUD)' -%}\r\n\r\n{%- set naltrexone_ndcs = (\r\n '00056001122', '00056001130', '00056001170', '00056007950', '00056008050',\r\n '00185003901', '00185003930', '00406009201', '00406009203', '00406117001',\r\n '00406117003', '00555090201', '00555090202', '00904703604', '16729008101',\r\n '16729008110', '42291063230', '43063059115', '47335032683', '47335032688',\r\n '50090286600', '50436010501', '51224020630', '51224020650', '51285027501',\r\n '51285027502', '52152010502', '52152010504', '52152010530', '54868557400',\r\n '63459030042', '63629104601', '63629104701', '65694010003', '65694010010',\r\n '65757030001', '65757030202', '68084029111', '68084029121', '68094085362',\r\n '68115068030'\r\n )\r\n-%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_medications as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , paid_date as start_date\r\n , replace(ndc_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE excludes medication encounters with the exception codes for\r\n Naltrexone. Those encounters will be evaluated separately.\r\n*/\r\n, inclusions_medication as (\r\n\r\n select\r\n patient_medications.patient_id\r\n , patient_medications.claim_id\r\n , patient_medications.start_date\r\n , patient_medications.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code not in {{ naltrexone_ndcs }}\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE includes patients with evidence of the chronic conditions Alcohol\r\n Use Disorders or Drug Use Disorders.\r\n*/\r\n, exclusions_other_chronic_conditions as (\r\n\r\n select distinct patient_id\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n where condition in (\r\n 'Alcohol Use Disorders'\r\n , 'Drug Use Disorders'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE creates the exclusion list which consists of patients with\r\n medication encounters for Naltrexone having Alcohol Use Disorder or Drug\r\n Use Disorder and missing the Opioid Use Disorder diagnosis codes.\r\n*/\r\n, exclusions_medication as (\r\n select distinct\r\n patient_medications.patient_id\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n inner join exclusions_other_chronic_conditions\r\n on patient_medications.patient_id = exclusions_other_chronic_conditions.patient_id\r\n left join inclusions_diagnosis\r\n on patient_medications.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code in {{ naltrexone_ndcs }}\r\n and inclusions_diagnosis.patient_id is null\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_medication\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_medication\r\n on inclusions_unioned.patient_id = exclusions_medication.patient_id\r\nwhere exclusions_medication.patient_id is null", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hierarchy", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__condition", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_pharmacy_claim", "package": null, "version": null}, {"name": "cms_chronic_conditions__stg_core__procedure", "package": null, "version": null}, {"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n), __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim as (\n\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n),chronic_conditions as (\n\n select * from dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy\n where condition = 'Opioid Use Disorder (OUD)'\n\n)\n\n, patient_conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__condition\n\n)\n\n, patient_medications as (\n\n select\n patient_id\n , claim_id\n , paid_date as start_date\n , replace(ndc_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim\n\n)\n\n, patient_procedures as (\n\n select\n patient_id\n , claim_id\n , procedure_date as start_date\n , normalized_code_type as code_type\n , replace(normalized_code,'.','') as code\n , data_source\n from __dbt__cte__cms_chronic_conditions__stg_core__procedure\n\n)\n\n, inclusions_diagnosis as (\n\n select\n patient_conditions.patient_id\n , patient_conditions.claim_id\n , patient_conditions.start_date\n , patient_conditions.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_conditions\n inner join chronic_conditions\n on patient_conditions.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'ICD-10-CM'\n\n)\n\n, inclusions_procedure as (\n\n select\n patient_procedures.patient_id\n , patient_procedures.claim_id\n , patient_procedures.start_date\n , patient_procedures.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_procedures\n inner join chronic_conditions\n on patient_procedures.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE excludes medication encounters with the exception codes for\n Naltrexone. Those encounters will be evaluated separately.\n*/\n, inclusions_medication as (\n\n select\n patient_medications.patient_id\n , patient_medications.claim_id\n , patient_medications.start_date\n , patient_medications.data_source\n , chronic_conditions.chronic_condition_type\n , chronic_conditions.condition_category\n , chronic_conditions.condition\n from patient_medications\n inner join chronic_conditions\n on patient_medications.code = chronic_conditions.code\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'NDC'\n and chronic_conditions.code not in ('00056001122', '00056001130', '00056001170', '00056007950', '00056008050', '00185003901', '00185003930', '00406009201', '00406009203', '00406117001', '00406117003', '00555090201', '00555090202', '00904703604', '16729008101', '16729008110', '42291063230', '43063059115', '47335032683', '47335032688', '50090286600', '50436010501', '51224020630', '51224020650', '51285027501', '51285027502', '52152010502', '52152010504', '52152010530', '54868557400', '63459030042', '63629104601', '63629104701', '65694010003', '65694010010', '65757030001', '65757030202', '68084029111', '68084029121', '68094085362', '68115068030')\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE includes patients with evidence of the chronic conditions Alcohol\n Use Disorders or Drug Use Disorders.\n*/\n, exclusions_other_chronic_conditions as (\n\n select distinct patient_id\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\n where condition in (\n 'Alcohol Use Disorders'\n , 'Drug Use Disorders'\n )\n\n)\n\n/*\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\n alcohol or other drug use disorder where opioid DX is not present\n\n This CTE creates the exclusion list which consists of patients with\n medication encounters for Naltrexone having Alcohol Use Disorder or Drug\n Use Disorder and missing the Opioid Use Disorder diagnosis codes.\n*/\n, exclusions_medication as (\n select distinct\n patient_medications.patient_id\n from patient_medications\n inner join chronic_conditions\n on patient_medications.code = chronic_conditions.code\n inner join exclusions_other_chronic_conditions\n on patient_medications.patient_id = exclusions_other_chronic_conditions.patient_id\n left join inclusions_diagnosis\n on patient_medications.patient_id = inclusions_diagnosis.patient_id\n where chronic_conditions.inclusion_type = 'Include'\n and chronic_conditions.code_system = 'NDC'\n and chronic_conditions.code in ('00056001122', '00056001130', '00056001170', '00056007950', '00056008050', '00185003901', '00185003930', '00406009201', '00406009203', '00406117001', '00406117003', '00555090201', '00555090202', '00904703604', '16729008101', '16729008110', '42291063230', '43063059115', '47335032683', '47335032688', '50090286600', '50436010501', '51224020630', '51224020650', '51285027501', '51285027502', '52152010502', '52152010504', '52152010530', '54868557400', '63459030042', '63629104601', '63629104701', '65694010003', '65694010010', '65757030001', '65757030202', '68084029111', '68084029121', '68094085362', '68115068030')\n and inclusions_diagnosis.patient_id is null\n\n)\n\n, inclusions_unioned as (\n\n select * from inclusions_diagnosis\n union distinct\n select * from inclusions_procedure\n union distinct\n select * from inclusions_medication\n\n)\n\nselect distinct\n cast(inclusions_unioned.patient_id as TEXT) as patient_id\n , cast(inclusions_unioned.claim_id as TEXT) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as TEXT) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as TEXT) as condition_category\n , cast(inclusions_unioned.condition as TEXT) as condition\n , cast(inclusions_unioned.data_source as TEXT) as data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom inclusions_unioned\n left join exclusions_medication\n on inclusions_unioned.patient_id = exclusions_medication.patient_id\nwhere exclusions_medication.patient_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "sql": " __dbt__cte__cms_chronic_conditions__stg_pharmacy_claim as (\n\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "a70e41749804fd6e994d9e402d8009d0ac5056125b8406bd3b3c83d7bcb6b89b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5882926, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}\r\nwhere claim_id is not null", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\nwhere claim_id is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "07322cb7611f42c7a13dc4eb47bef985761aa7d22f76edf64f311600572837ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5902922, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "53d00e7c521d7f492d420fda96b6d32320ec8fbb2cbdfe289086366cf25a24ce"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.5923102, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , procedure_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}\r\nwhere claim_id is not null", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\nwhere claim_id is not null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "13658bee1ace9ca1182c47521f91379a9f01c2acea63cc7ac6ebbd20f5c11c43"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.594337, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , claim_start_date\r\n , ms_drg_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "cms_chronic_conditions__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "ecc2a524daafc432ac31406a35143ad8149f911db369e71f86d2c40481339e94"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.596378, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , paid_date\r\n , ndc_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [{"name": "pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "tuva_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "f370672047f2b026bd5104b700c770c40070642f54642308ade51083b49abd3d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.656334, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition')}}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "dev_thuxuan", "schema": "test", "name": "tuva_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "47a2c172b79fd191be1a9e81b8f5a936d1cfc42b4bfb4f24c5436c775ff9e8a5"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6573362, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.medical_claim_expanded": {"database": "dev_thuxuan", "schema": "claims_expanded", "name": "medical_claim_expanded", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_expanded\\medical_claim_expanded.sql", "original_file_path": "models\\claims_expanded\\medical_claim_expanded.sql", "unique_id": "model.the_tuva_project.medical_claim_expanded", "fqn": ["the_tuva_project", "claims_expanded", "medical_claim_expanded"], "alias": "medical_claim_expanded", "checksum": {"name": "sha256", "checksum": "04ff66dd3885b586f0e72f7a5acbb9ece6c6a162a10835ee6e4d0893ea9b63c5"}, "config": {"enabled": true, "alias": null, "schema": "claims_expanded", "database": null, "tags": ["claims_expanded"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["claims_expanded"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_expanded\\_claims_expanded_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_expanded", "materialized": "table", "tags": "claims_expanded", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6643476, "relation_name": "dev_thuxuan.claims_expanded.medical_claim_expanded", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect *\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_expanded\\medical_claim_expanded.sql", "compiled": true, "compiled_code": "\n\n\nselect *\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "unique_id": "model.the_tuva_project.acute_inpatient__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "final", "acute_inpatient__summary"], "alias": "acute_inpatient_summary", "checksum": {"name": "sha256", "checksum": "d96d82c8fa390ed36d4c75f02f9a2d17968b5f777f562e4edd109615cc4cf2ab"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the acute inpatient encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "acute_inpatient_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6756387, "relation_name": "dev_thuxuan.claims_preprocessing.acute_inpatient_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith distinct_encounters as (\r\n select distinct\r\n a.encounter_id\r\n , a.patient_id\r\n , b.encounter_start_date\r\n , b.encounter_end_date\r\nfrom {{ ref('acute_inpatient__encounter_id') }} a\r\ninner join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('acute_inpatient__first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('acute_inpatient__last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\n select\r\n b.encounter_id\r\n , sum(paid_amount) as prof_paid_amount\r\n , sum(allowed_amount) as prof_allowed_amount\r\n , sum(charge_amount) as prof_charge_amount\r\n from {{ ref('acute_inpatient__stg_medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\n select distinct\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n from {{ ref('acute_inpatient__stg_eligibility') }}\r\n )\r\n\r\n, provider as (\r\n select\r\n a.encounter_id\r\n , max(a.facility_npi) as facility_npi\r\n , b.provider_first_name\r\n , b.provider_last_name\r\n , count(distinct facility_npi) as npi_count\r\n from {{ ref('acute_inpatient__institutional_encounter_id') }} a\r\n left join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\n group by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n, a.encounter_start_date\r\n, a.encounter_end_date\r\n, a.patient_id\r\n, {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n, e.gender\r\n, e.race\r\n, c.diagnosis_code_type as primary_diagnosis_code_type\r\n, c.diagnosis_code_1 as primary_diagnosis_code\r\n, coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\r\n, f.facility_npi\r\n, f.provider_first_name\r\n, f.provider_last_name\r\n, c.ms_drg_code\r\n, j.ms_drg_description\r\n, j.medical_surgical\r\n, c.apr_drg_code\r\n, k.apr_drg_description\r\n, c.admit_source_code\r\n, h.admit_source_description\r\n, c.admit_type_code\r\n, i.admit_type_description\r\n, c.discharge_disposition_code\r\n, g.discharge_disposition_description\r\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n, {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n, case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__first_claim_values", "package": null, "version": null}, {"name": "acute_inpatient__last_claim_values", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_eligibility", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n),distinct_encounters as (\n select distinct\n a.encounter_id\n , a.patient_id\n , b.encounter_start_date\n , b.encounter_end_date\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id a\ninner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\n select\n b.encounter_id\n , sum(paid_amount) as prof_paid_amount\n , sum(allowed_amount) as prof_allowed_amount\n , sum(charge_amount) as prof_charge_amount\n from __dbt__cte__acute_inpatient__stg_medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\n select distinct\n patient_id\n , birth_date\n , gender\n , race\n from __dbt__cte__acute_inpatient__stg_eligibility\n )\n\n, provider as (\n select\n a.encounter_id\n , max(a.facility_npi) as facility_npi\n , b.provider_first_name\n , b.provider_last_name\n , count(distinct facility_npi) as npi_count\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id a\n left join dev_thuxuan.terminology.provider b\n on a.facility_npi = b.npi\n group by 1,3,4\n)\n\nselect\n a.encounter_id\n, a.encounter_start_date\n, a.encounter_end_date\n, a.patient_id\n, datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n, e.gender\n, e.race\n, c.diagnosis_code_type as primary_diagnosis_code_type\n, c.diagnosis_code_1 as primary_diagnosis_code\n, coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\n, f.facility_npi\n, f.provider_first_name\n, f.provider_last_name\n, c.ms_drg_code\n, j.ms_drg_description\n, j.medical_surgical\n, c.apr_drg_code\n, k.apr_drg_description\n, c.admit_source_code\n, h.admit_source_description\n, c.admit_type_code\n, i.admit_type_description\n, c.discharge_disposition_code\n, g.discharge_disposition_description\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n, datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n, case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n, data_source\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom distinct_encounters a\nleft join institutional_claim_details c\n on a.encounter_id = c.encounter_id\nleft join professional_claim_details d\n on a.encounter_id = d.encounter_id\nleft join patient e\n on a.patient_id = e.patient_id\nleft join provider f\n on a.encounter_id = f.encounter_id\nleft join dev_thuxuan.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join dev_thuxuan.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join dev_thuxuan.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join dev_thuxuan.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join dev_thuxuan.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "sql": " __dbt__cte__acute_inpatient__stg_eligibility as (\n\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__claims_with_encounter_data", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__claims_with_encounter_data"], "alias": "_int_acute_inpatient_claims_with_encounter_data", "checksum": {"name": "sha256", "checksum": "e1a9951d714eb969fe7106960d6cd71fa4769a2467c7b70cf9dff3cf17370154"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_claims_with_encounter_data", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.697333, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_claims_with_encounter_data", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns relevant encounter-level\r\n-- data for every professional or institutional\r\n-- acute inpatient claim that is part of an encounter\r\n-- (note that all institutional acute inpatienet claims\r\n-- are part of an acute inpatient encounter, but only\r\n-- professional acute inpatient claims that are not\r\n-- orphan claims and that belong to one and only\r\n-- one encounter, i.e. have encounter_count = 1,\r\n-- are part of an acute inpatient encounter).\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_id\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.admit_type_code,\r\n aa.admit_source_code,\r\n aa.discharge_disposition_code,\r\n aa.start_date,\r\n aa.end_date,\r\n\r\n bb.encounter_id,\r\n\r\n cc.encounter_start_date,\r\n cc.encounter_end_date\r\n\r\nfrom {{ ref('acute_inpatient__institutional_claims') }} aa\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_id') }} bb\r\non aa.claim_id = bb.claim_id\r\nand aa.patient_id = bb.patient_id\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_start_and_end_dates') }} cc\r\non bb.encounter_id = cc.encounter_id\r\nand bb.patient_id = cc.patient_id\r\n),\r\n\r\n\r\n\r\nadmit_codes as (\r\nselect\r\n encounter_id,\r\n max(admit_source_code) as encounter_admit_source_code,\r\n max(admit_type_code) as encounter_admit_type_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere start_date = encounter_start_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\ndischarge_code as (\r\nselect\r\n encounter_id,\r\n max(discharge_disposition_code) as encounter_discharge_disposition_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere end_date = encounter_end_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\nall_useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.encounter_start_date,\r\n aa.encounter_end_date,\r\n\r\n bb.encounter_admit_source_code,\r\n bb.encounter_admit_type_code,\r\n \r\n cc.encounter_discharge_disposition_code\r\n\r\nfrom useful_fields_at_claim_id_level aa \r\n left join admit_codes bb on aa.encounter_id = bb.encounter_id\r\n left join discharge_code cc on aa.encounter_id = cc.encounter_id\r\n)\r\n\r\n\r\n\r\nselect \r\n *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_useful_fields_at_claim_id_level", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns relevant encounter-level\n-- data for every professional or institutional\n-- acute inpatient claim that is part of an encounter\n-- (note that all institutional acute inpatienet claims\n-- are part of an acute inpatient encounter, but only\n-- professional acute inpatient claims that are not\n-- orphan claims and that belong to one and only\n-- one encounter, i.e. have encounter_count = 1,\n-- are part of an acute inpatient encounter).\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_id\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- *************************************************\n\n\n\n\nwith useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.admit_type_code,\n aa.admit_source_code,\n aa.discharge_disposition_code,\n aa.start_date,\n aa.end_date,\n\n bb.encounter_id,\n\n cc.encounter_start_date,\n cc.encounter_end_date\n\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims aa\n\nleft join\ndev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id bb\non aa.claim_id = bb.claim_id\nand aa.patient_id = bb.patient_id\n\nleft join\ndev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates cc\non bb.encounter_id = cc.encounter_id\nand bb.patient_id = cc.patient_id\n),\n\n\n\nadmit_codes as (\nselect\n encounter_id,\n max(admit_source_code) as encounter_admit_source_code,\n max(admit_type_code) as encounter_admit_type_code\nfrom useful_fields_at_claim_id_level\nwhere start_date = encounter_start_date\ngroup by encounter_id\n),\n\n\ndischarge_code as (\nselect\n encounter_id,\n max(discharge_disposition_code) as encounter_discharge_disposition_code\nfrom useful_fields_at_claim_id_level\nwhere end_date = encounter_end_date\ngroup by encounter_id\n),\n\n\nall_useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.encounter_start_date,\n aa.encounter_end_date,\n\n bb.encounter_admit_source_code,\n bb.encounter_admit_type_code,\n \n cc.encounter_discharge_disposition_code\n\nfrom useful_fields_at_claim_id_level aa \n left join admit_codes bb on aa.encounter_id = bb.encounter_id\n left join discharge_code cc on aa.encounter_id = cc.encounter_id\n)\n\n\n\nselect \n *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__data_quality_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__data_quality_summary"], "alias": "_int_acute_inpatient_data_quality_summary", "checksum": {"name": "sha256", "checksum": "15282b45f8a715704fcf456517f324f18136338f9a5ba67618c709a0583b4e34"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_data_quality_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.681679, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_data_quality_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model summarizes data quality issues\r\n-- that could affect claims preprocessing.\r\n-- The table returns 2 fields:\r\n-- field\r\n-- total_count\r\n--\r\n-- If we order the results by 'field', the first\r\n-- 3 rows give us a high level summary:\r\n--\r\n-- 01 Total acute inpatient institutional claims:\r\n-- This is the total number of acute inpatient\r\n-- institutional claims\r\n-- 02 Acute inpatient institutional claims with insights:\r\n-- This is the number of acute inpatient institutional\r\n-- claims for which something is not ideal (e.g. they\r\n-- are missing a claim_start_date) but it's not something\r\n-- that prevents the claim from being used in the\r\n-- encounter grouper.\r\n\r\n-- 03 Acute inpatient institutional claims with problems:\r\n-- This is the number of acute inpatient institutional\r\n-- claims that have a data quality problem that\r\n-- prevents them from being used in the encounter grouper.\r\n\r\n-- The rest of the rows in the table give us counts\r\n-- of the number of acute inpatient institutional claims\r\n-- that have specific data quality problems.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith total_acute_inpatient__institutional_claims as (\r\nselect\r\n '01 Total acute inpatient institutional claims' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ntotal_claims_with_insights as (\r\nselect\r\n '02 Acute inpatient institutional claims with insights' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_insight = 1\r\n),\r\n\r\n\r\ntotal_claims_with_problems as (\r\nselect\r\n '03 Acute inpatient institutional claims with problems' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_problem = 1\r\n),\r\n\r\n\r\npatient_id_not_unique as (\r\nselect\r\n '04 patient_id_not_unique' as field,\r\n sum(patient_id_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\npatient_id_missing as (\r\nselect\r\n '05 patient_id_missing' as field,\r\n sum(patient_id_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_not_unique as (\r\nselect\r\n '06 claim_start_date_not_unique' as field,\r\n sum(claim_start_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_missing as (\r\nselect\r\n '07 claim_start_date_missing' as field,\r\n sum(claim_start_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_not_unique as (\r\nselect\r\n '08 claim_end_date_not_unique' as field,\r\n sum(claim_end_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_missing as (\r\nselect\r\n '09 claim_end_date_missing' as field,\r\n sum(claim_end_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_after_claim_end_date as (\r\nselect\r\n '10 claim_start_date_after_claim_end_date' as field,\r\n sum(claim_start_date_after_claim_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_not_unique as (\r\nselect\r\n '11 admission_date_not_unique' as field,\r\n sum(admission_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_missing as (\r\nselect\r\n '12 admission_date_missing' as field,\r\n sum(admission_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_not_unique as (\r\nselect\r\n '13 discharge_date_not_unique' as field,\r\n sum(discharge_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_missing as (\r\nselect\r\n '14 discharge_date_missing' as field,\r\n sum(discharge_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_after_discharge_date as (\r\nselect\r\n '15 admission_date_after_discharge_date' as field,\r\n sum(admission_date_after_discharge_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_not_unique as (\r\nselect\r\n '16 admit_type_code_not_unique' as field,\r\n sum(admit_type_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_missing as (\r\nselect\r\n '17 admit_type_code_missing' as field,\r\n sum(admit_type_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_not_unique as (\r\nselect\r\n '18 admit_source_code_not_unique' as field,\r\n sum(admit_source_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_missing as (\r\nselect\r\n '19 admit_source_code_missing' as field,\r\n sum(admit_source_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_not_unique as (\r\nselect\r\n '20 discharge_disposition_code_not_unique' as field,\r\n sum(discharge_disposition_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_missing as (\r\nselect\r\n '21 discharge_disposition_code_missing' as field,\r\n sum(discharge_disposition_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_not_unique as (\r\nselect\r\n '22 facility_npi_not_unique' as field,\r\n sum(facility_npi_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_missing as (\r\nselect\r\n '23 facility_npi_missing' as field,\r\n sum(facility_npi_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_unique as (\r\nselect\r\n '24 claim_type_not_unique' as field,\r\n sum(claim_type_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_missing as (\r\nselect\r\n '25 claim_type_missing' as field,\r\n sum(claim_type_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_institutional as (\r\nselect\r\n '26 claim_type_not_institutional' as field,\r\n sum(claim_type_not_institutional) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_not_determined as (\r\nselect\r\n '27 start_date_not_determined' as field,\r\n sum(start_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nend_date_not_determined as (\r\nselect\r\n '28 end_date_not_determined' as field,\r\n sum(end_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_after_end_date as (\r\nselect\r\n '29 start_date_after_end_date' as field,\r\n sum(start_date_after_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\n\r\nunion_cte as (\r\nselect *\r\nfrom total_acute_inpatient__institutional_claims\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_insights\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_problems\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_after_claim_end_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_after_discharge_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_institutional\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom end_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_after_end_date\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model summarizes data quality issues\n-- that could affect claims preprocessing.\n-- The table returns 2 fields:\n-- field\n-- total_count\n--\n-- If we order the results by 'field', the first\n-- 3 rows give us a high level summary:\n--\n-- 01 Total acute inpatient institutional claims:\n-- This is the total number of acute inpatient\n-- institutional claims\n-- 02 Acute inpatient institutional claims with insights:\n-- This is the number of acute inpatient institutional\n-- claims for which something is not ideal (e.g. they\n-- are missing a claim_start_date) but it's not something\n-- that prevents the claim from being used in the\n-- encounter grouper.\n\n-- 03 Acute inpatient institutional claims with problems:\n-- This is the number of acute inpatient institutional\n-- claims that have a data quality problem that\n-- prevents them from being used in the encounter grouper.\n\n-- The rest of the rows in the table give us counts\n-- of the number of acute inpatient institutional claims\n-- that have specific data quality problems.\n-- *************************************************\n\n\n\n\nwith total_acute_inpatient__institutional_claims as (\nselect\n '01 Total acute inpatient institutional claims' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ntotal_claims_with_insights as (\nselect\n '02 Acute inpatient institutional claims with insights' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\nwhere dq_insight = 1\n),\n\n\ntotal_claims_with_problems as (\nselect\n '03 Acute inpatient institutional claims with problems' as field,\n count(*) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\nwhere dq_problem = 1\n),\n\n\npatient_id_not_unique as (\nselect\n '04 patient_id_not_unique' as field,\n sum(patient_id_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\npatient_id_missing as (\nselect\n '05 patient_id_missing' as field,\n sum(patient_id_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_not_unique as (\nselect\n '06 claim_start_date_not_unique' as field,\n sum(claim_start_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_missing as (\nselect\n '07 claim_start_date_missing' as field,\n sum(claim_start_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_end_date_not_unique as (\nselect\n '08 claim_end_date_not_unique' as field,\n sum(claim_end_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_end_date_missing as (\nselect\n '09 claim_end_date_missing' as field,\n sum(claim_end_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_start_date_after_claim_end_date as (\nselect\n '10 claim_start_date_after_claim_end_date' as field,\n sum(claim_start_date_after_claim_end_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_not_unique as (\nselect\n '11 admission_date_not_unique' as field,\n sum(admission_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_missing as (\nselect\n '12 admission_date_missing' as field,\n sum(admission_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_date_not_unique as (\nselect\n '13 discharge_date_not_unique' as field,\n sum(discharge_date_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_date_missing as (\nselect\n '14 discharge_date_missing' as field,\n sum(discharge_date_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmission_date_after_discharge_date as (\nselect\n '15 admission_date_after_discharge_date' as field,\n sum(admission_date_after_discharge_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_type_code_not_unique as (\nselect\n '16 admit_type_code_not_unique' as field,\n sum(admit_type_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_type_code_missing as (\nselect\n '17 admit_type_code_missing' as field,\n sum(admit_type_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_source_code_not_unique as (\nselect\n '18 admit_source_code_not_unique' as field,\n sum(admit_source_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nadmit_source_code_missing as (\nselect\n '19 admit_source_code_missing' as field,\n sum(admit_source_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_disposition_code_not_unique as (\nselect\n '20 discharge_disposition_code_not_unique' as field,\n sum(discharge_disposition_code_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\ndischarge_disposition_code_missing as (\nselect\n '21 discharge_disposition_code_missing' as field,\n sum(discharge_disposition_code_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nfacility_npi_not_unique as (\nselect\n '22 facility_npi_not_unique' as field,\n sum(facility_npi_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nfacility_npi_missing as (\nselect\n '23 facility_npi_missing' as field,\n sum(facility_npi_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_not_unique as (\nselect\n '24 claim_type_not_unique' as field,\n sum(claim_type_not_unique) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_missing as (\nselect\n '25 claim_type_missing' as field,\n sum(claim_type_missing) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nclaim_type_not_institutional as (\nselect\n '26 claim_type_not_institutional' as field,\n sum(claim_type_not_institutional) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nstart_date_not_determined as (\nselect\n '27 start_date_not_determined' as field,\n sum(start_date_not_determined) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nend_date_not_determined as (\nselect\n '28 end_date_not_determined' as field,\n sum(end_date_not_determined) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\nstart_date_after_end_date as (\nselect\n '29 start_date_after_end_date' as field,\n sum(start_date_after_end_date) as total_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\n\n\nunion_cte as (\nselect *\nfrom total_acute_inpatient__institutional_claims\n\nunion all\n\nselect *\nfrom total_claims_with_insights\n\nunion all\n\nselect *\nfrom total_claims_with_problems\n\nunion all\n\nselect *\nfrom patient_id_not_unique\n\nunion all\n\nselect *\nfrom patient_id_missing\n\nunion all\n\nselect *\nfrom claim_start_date_not_unique\n\nunion all\n\nselect *\nfrom claim_start_date_missing\n\nunion all\n\nselect *\nfrom claim_end_date_not_unique\n\nunion all\n\nselect *\nfrom claim_end_date_missing\n\nunion all\n\nselect *\nfrom claim_start_date_after_claim_end_date\n\nunion all\n\nselect *\nfrom admission_date_not_unique\n\nunion all\n\nselect *\nfrom admission_date_missing\n\nunion all\n\nselect *\nfrom discharge_date_not_unique\n\nunion all\n\nselect *\nfrom discharge_date_missing\n\nunion all\n\nselect *\nfrom admission_date_after_discharge_date\n\nunion all\n\nselect *\nfrom admit_type_code_not_unique\n\nunion all\n\nselect *\nfrom admit_type_code_missing\n\nunion all\n\nselect *\nfrom admit_source_code_not_unique\n\nunion all\n\nselect *\nfrom admit_source_code_missing\n\nunion all\n\nselect *\nfrom discharge_disposition_code_not_unique\n\nunion all\n\nselect *\nfrom discharge_disposition_code_missing\n\nunion all\n\nselect *\nfrom facility_npi_not_unique\n\nunion all\n\nselect *\nfrom facility_npi_missing\n\nunion all\n\nselect *\nfrom claim_type_not_unique\n\nunion all\n\nselect *\nfrom claim_type_missing\n\nunion all\n\nselect *\nfrom claim_type_not_institutional\n\nunion all\n\nselect *\nfrom start_date_not_determined\n\nunion all\n\nselect *\nfrom end_date_not_determined\n\nunion all\n\nselect *\nfrom start_date_after_end_date\n)\n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_data_for_medical_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_data_for_medical_claims"], "alias": "_int_encounter_data_for_medical_claims", "checksum": {"name": "sha256", "checksum": "88e533b9c572f2d70b39f28e985d31860d6b8b00f8cb7935f23f4dcc1d2551d9"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_encounter_data_for_medical_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6993327, "relation_name": "dev_thuxuan.claims_preprocessing._int_encounter_data_for_medical_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns all the columns with relevant\r\n-- encounter fields that we will append to the medical_claim\r\n-- table.\r\n\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_type\r\n-- encounter_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- orphan_claim_flag (always 0 or 1) (never null)\r\n-- encounter_count (could be 0,1,2,3,...) (never null)\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith acute_inpatient_claims_with_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' as encounter_type,\r\n encounter_id,\r\n encounter_start_date,\r\n encounter_end_date,\r\n encounter_admit_source_code,\r\n encounter_admit_type_code,\r\n encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n 0 as orphan_claim_flag,\r\n 1 as encounter_count\r\nfrom {{ ref('acute_inpatient__claims_with_encounter_data') }}\r\n),\r\n\r\n\r\nacute_inpatient_claims_without_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' encounter_type,\r\n cast(null as {{ dbt.type_string() }}) as encounter_id,\r\n cast(null as date) as encounter_start_date,\r\n cast(null as date) as encounter_end_date,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_source_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_type_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n orphan_claim_flag,\r\n encounter_count\r\n \r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_with_encounter_id\r\n\r\nunion all\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_without_encounter_id", "language": "sql", "refs": [{"name": "acute_inpatient__claims_with_encounter_data", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns all the columns with relevant\n-- encounter fields that we will append to the medical_claim\n-- table.\n\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- encounter_type\n-- encounter_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- orphan_claim_flag (always 0 or 1) (never null)\n-- encounter_count (could be 0,1,2,3,...) (never null)\n-- *************************************************\n\n\n\n\nwith acute_inpatient_claims_with_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' as encounter_type,\n encounter_id,\n encounter_start_date,\n encounter_end_date,\n encounter_admit_source_code,\n encounter_admit_type_code,\n encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n 0 as orphan_claim_flag,\n 1 as encounter_count\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_claims_with_encounter_data\n),\n\n\nacute_inpatient_claims_without_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' encounter_type,\n cast(null as TEXT) as encounter_id,\n cast(null as date) as encounter_start_date,\n cast(null as date) as encounter_end_date,\n cast(null as TEXT) as encounter_admit_source_code,\n cast(null as TEXT) as encounter_admit_type_code,\n cast(null as TEXT) as encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n orphan_claim_flag,\n encounter_count\n \nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_id"], "alias": "_int_acute_inpatient_encounter_id", "checksum": {"name": "sha256", "checksum": "db38237e33ffd492574e6c5ad5ebea49fccc7cd892c82fbca60b60398714e637"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6943328, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns an encounter_id to each\r\n-- institutional or professional acute inpatient claim\r\n-- that is eligible to be part of an encounter.\r\n-- Professional acute inpatient claims that are\r\n-- orphan claims (don't overlap with an institutional\r\n-- acute inpatient claim) or that have\r\n-- encounter_count > 1 (overlap with more than one different\r\n-- acute inpatient encounter) are not included here.\r\n-- It returns a table with these 3 columns:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }} inst\r\nleft join {{ ref('acute_inpatient__stg_medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)-- *************************************************\n-- This dbt model assigns an encounter_id to each\n-- institutional or professional acute inpatient claim\n-- that is eligible to be part of an encounter.\n-- Professional acute inpatient claims that are\n-- orphan claims (don't overlap with an institutional\n-- acute inpatient claim) or that have\n-- encounter_count > 1 (overlap with more than one different\n-- acute inpatient encounter) are not included here.\n-- It returns a table with these 3 columns:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- *************************************************\n\n\n\n\nselect\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id inst\nleft join __dbt__cte__acute_inpatient__stg_medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_start_and_end_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_start_and_end_dates"], "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "57037b341f7e9ff8d6b3804ee4e5b1e5fe1f2294bf6c2934d1091b830e4ce0eb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6883335, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns an encounter_start_date and\r\n-- an encounter_end_date to each acute inpatient\r\n-- encounter_id.\r\n-- This returns a table with 4 fields:\r\n-- patient_id\r\n-- encounter_id\r\n-- encounter_start_date\r\n-- encounter_end_date\r\n-- The number of rows in the table should be equal\r\n-- to the number of acute inpatient encounters.\r\n-- *************************************************\r\n\r\n\r\nwith add_encounter_id_to_acute_inpatient_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('acute_inpatient__institutional_claims') }} aip\r\nleft join {{ ref('acute_inpatient__institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_acute_inpatient_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}, {"name": "acute_inpatient__institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_start_date and\n-- an encounter_end_date to each acute inpatient\n-- encounter_id.\n-- This returns a table with 4 fields:\n-- patient_id\n-- encounter_id\n-- encounter_start_date\n-- encounter_end_date\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient encounters.\n-- *************************************************\n\n\nwith add_encounter_id_to_acute_inpatient_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims aip\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_acute_inpatient_encounters\ngroup by patient_id, encounter_id\n)\n\nselect\n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__first_claim_values"], "alias": "_int_acute_inpatient_first_claim_values", "checksum": {"name": "sha256", "checksum": "b9cfe221cd15388a374f8fe6d6d8a3de682efe4065e75162c4ad51fb146160d9"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_first_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.70386, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('acute_inpatient__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join __dbt__cte__acute_inpatient__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__institutional_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_claims"], "alias": "_int_acute_inpatient_institutional_claims", "checksum": {"name": "sha256", "checksum": "deff2167566d0415c0d661bf0f9eaac277f5fad00d5ac1964d2e8d8555cc52d6"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.6786547, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model gives us all acute inpatient institutional claims.\r\n-- We have one row per claim_id (for all claim_ids belonging to\r\n-- acute inpatient institutinal claims).\r\n-- The number of rows in the table is equal to the number of unique\r\n-- claim_ids (i.e. claim_id is a primary key).\r\n-- Note that we are assuming that a claim_id is unique across\r\n-- all people in the datset, i.e.\r\n-- that no two people can have the same claim_id.\r\n-- *************************************************\r\n\r\nwith acute_inpatient_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\r\ninner join {{ ref('acute_inpatient__stg_service_category')}} sc\r\n on mc.claim_id = sc.claim_id\r\nwhere mc.claim_type = 'institutional'\r\n and sc.service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [{"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__stg_service_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model gives us all acute inpatient institutional claims.\n-- We have one row per claim_id (for all claim_ids belonging to\n-- acute inpatient institutinal claims).\n-- The number of rows in the table is equal to the number of unique\n-- claim_ids (i.e. claim_id is a primary key).\n-- Note that we are assuming that a claim_id is unique across\n-- all people in the datset, i.e.\n-- that no two people can have the same claim_id.\n-- *************************************************\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n),acute_inpatient_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join __dbt__cte__acute_inpatient__stg_service_category sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Acute Inpatient'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom acute_inpatient_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom acute_inpatient_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n\nfrom header_level_values h\nleft join data_quality_flags dq\n on h.claim_id = dq.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_encounter_id"], "alias": "_int_acute_inpatient_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "78875daea25541f4c85eeb70dd86b8a4c4991ecb85252f1cd2ab6fcb85c5b4c4"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.684245, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model groups acute inpatient institutional\r\n-- claims into encounters. It assigns an encounter_id\r\n-- to each acute inpatient institutional claim.\r\n-- This returns a table with 3 fields:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id\r\n-- The number of rows in the table should be equal\r\n-- to the number of acute inpatient institutional claims.\r\n-- *************************************************\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n\r\n -- Claims with different end_date and start_date that are\r\n -- adjacent (i.e. separated by 1 day) should be merged:\r\n when ( {{ dbt.dateadd(datepart= 'day', interval=1, from_date_or_timestamp='aa.end_date') }} = bb.start_date\r\n and aa.facility_npi = bb.facility_npi\r\n\t and aa.discharge_disposition_code = '30') then 1\r\n\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [{"name": "acute_inpatient__institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model groups acute inpatient institutional\n-- claims into encounters. It assigns an encounter_id\n-- to each acute inpatient institutional claim.\n-- This returns a table with 3 fields:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient institutional claims.\n-- *************************************************\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional_claims\n),\n\ncheck_for_merges_with_larger_row_num as (\nselect\n aa.patient_id,\n aa.claim_id as claim_id_a,\n bb.claim_id as claim_id_b,\n aa.row_num as row_num_a,\n bb.row_num as row_num_b,\n case\n -- Claims with same end_date and same facility_npi should be merged:\n when (aa.end_date = bb.end_date\n and aa.facility_npi = bb.facility_npi) then 1\n\n -- Claims with different end_date and start_date that are\n -- adjacent (i.e. separated by 1 day) should be merged:\n when ( \n\n dateadd(\n day,\n 1,\n aa.end_date\n )\n\n = bb.start_date\n and aa.facility_npi = bb.facility_npi\n\t and aa.discharge_disposition_code = '30') then 1\n\n -- Claims with different end_date \n -- should be merged if they overlap:\n when ( (aa.end_date <> bb.end_date) and \n (aa.end_date >= bb.start_date) and --overlap requirement\n (aa.facility_npi = bb.facility_npi)\n\t )then 1\n else 0\n end as merge_flag\nfrom add_row_num aa\n inner join add_row_num bb\n on aa.patient_id = bb.patient_id\n and aa.row_num < bb.row_num\n),\n\nmerges_with_larger_row_num as (\nselect\n patient_id,\n claim_id_a,\n claim_id_b,\n row_num_a,\n row_num_b,\n merge_flag\nfrom check_for_merges_with_larger_row_num\nwhere merge_flag = 1\n),\n\n\nclaim_ids_that_merge_with_larger_row_num as (\nselect distinct claim_id_a as claim_id\nfrom merges_with_larger_row_num\n),\n\n\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\nselect distinct aa.claim_id as claim_id\nfrom add_row_num aa\n inner join\n merges_with_larger_row_num bb\n on aa.patient_id = bb.patient_id\n and bb.row_num_a < aa.row_num\n and bb.row_num_b > aa.row_num\n),\n\n\nclose_flags as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.row_num,\n case when (bb.claim_id is null and cc.claim_id is null) then 1\n else 0\n end as close_flag\n\nfrom add_row_num aa\n\nleft join claim_ids_that_merge_with_larger_row_num bb\non aa.claim_id = bb.claim_id\n\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\non aa.claim_id = cc.claim_id\n),\n\n\njoin_every_row_to_later_closes as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.row_num as row_num,\n bb.row_num as row_num_b\nfrom close_flags aa inner join close_flags bb\n on aa.patient_id = bb.patient_id\n and aa.row_num <= bb.row_num\nwhere bb.close_flag = 1\n),\n\n\nfind_min_closing_row_num_for_every_claim as (\nselect\n patient_id,\n claim_id,\n min(row_num_b) as min_closing_row\nfrom join_every_row_to_later_closes\ngroup by patient_id, claim_id\n),\n\n\nadd_min_closing_row_to_every_claim as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n bb.min_closing_row as min_closing_row\nfrom close_flags aa\n left join find_min_closing_row_num_for_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.claim_id = bb.claim_id\n),\n\n\nadd_encounter_id as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n aa.min_closing_row as min_closing_row,\n bb.claim_id as encounter_id\nfrom add_min_closing_row_to_every_claim aa\n left join add_min_closing_row_to_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.min_closing_row = bb.row_num\n)\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__last_claim_values"], "alias": "_int_acute_inpatient_last_claim_values", "checksum": {"name": "sha256", "checksum": "718a965cebd0fb4a4c0f5c8e49931c8b7c6595a1bae02803c753efc9e7dce173"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_last_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7078462, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('acute_inpatient__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join __dbt__cte__acute_inpatient__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "acute_inpatient__professional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__professional_encounter_id"], "alias": "_int_acute_inpatient_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "b716ead5414e5010295289940ec23bca7fad99fb2edf1caf05c253c36f8c11ba"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.691333, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model assigns professional acute inpatient\r\n-- claims to acute inpatient encounters.\r\n-- Some acute inpatient professional claims do not fall\r\n-- within an acute inpatient encounter. We call these\r\n-- orphan claims, and they do not have an encounter_id.\r\n-- Some acute inpatient professional claims fall within\r\n-- more than one acute inpatient encounter. Since we do not\r\n-- know what encounter these claims should be mapped to\r\n-- we do not assign them an encounter_id. These claims\r\n-- have encounter_count > 1.\r\n-- This model returns a table with 5 fields:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id (is null for orphan claims or claims\r\n-- that fall within more than one encounter)\r\n-- orphan_claim_flag (is always 0 or 1)\r\n-- encounter_count (an integer that represents the number\r\n-- of acute inpatient encounters this\r\n-- professional claim could fall into:\r\n-- could be 0,1,2,3,... but is never null\r\n-- for acute inpatient professional claims)\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith acute_inpatient_professional_claim_ids as (\r\nselect distinct \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('acute_inpatient__stg_service_category') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\nacute_inpatient_professional_claim_lines as (\r\nselect\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.patient_id,\r\n mc.claim_start_date as start_date,\r\n mc.claim_end_date as end_date\t \r\nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\r\ninner join acute_inpatient_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nacute_inpatient_professional_claim_dates as (\r\nselect\r\n claim_id,\r\n claim_line_number,\r\n patient_id,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date\r\nfrom acute_inpatient_professional_claim_lines\r\ngroup by claim_id, claim_line_number, patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n bb.encounter_id,\r\n case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\nfrom acute_inpatient_professional_claim_dates aa\r\nleft join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date,\r\n count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_line_number, claim_id\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_acute_inpatient_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_acute_inpatient_professional_claims", "language": "sql", "refs": [{"name": "acute_inpatient__stg_service_category", "package": null, "version": null}, {"name": "acute_inpatient__stg_medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns professional acute inpatient\n-- claims to acute inpatient encounters.\n-- Some acute inpatient professional claims do not fall\n-- within an acute inpatient encounter. We call these\n-- orphan claims, and they do not have an encounter_id.\n-- Some acute inpatient professional claims fall within\n-- more than one acute inpatient encounter. Since we do not\n-- know what encounter these claims should be mapped to\n-- we do not assign them an encounter_id. These claims\n-- have encounter_count > 1.\n-- This model returns a table with 5 fields:\n-- patient_id\n-- claim_id\n-- encounter_id (is null for orphan claims or claims\n-- that fall within more than one encounter)\n-- orphan_claim_flag (is always 0 or 1)\n-- encounter_count (an integer that represents the number\n-- of acute inpatient encounters this\n-- professional claim could fall into:\n-- could be 0,1,2,3,... but is never null\n-- for acute inpatient professional claims)\n-- *************************************************\n\n\n\n\nwith __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n), __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),acute_inpatient_professional_claim_ids as (\nselect distinct \n claim_id\n , claim_line_number\nfrom __dbt__cte__acute_inpatient__stg_service_category \nwhere claim_type = 'professional'\n and service_category_2 = 'Acute Inpatient'\n),\n\nacute_inpatient_professional_claim_lines as (\nselect\n mc.claim_id,\n mc.claim_line_number,\n mc.patient_id,\n mc.claim_start_date as start_date,\n mc.claim_end_date as end_date\t \nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join acute_inpatient_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\n claim_line_number,\n patient_id,\n min(start_date) as start_date,\n max(end_date) as end_date\nfrom acute_inpatient_professional_claim_lines\ngroup by claim_id, claim_line_number, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n bb.encounter_id,\n case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\nfrom acute_inpatient_professional_claim_dates aa\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n min(start_date) as start_date,\n max(end_date) as end_date,\n count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_line_number, claim_id\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_acute_inpatient_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom all_acute_inpatient_professional_claims", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_eligibility"], "alias": "acute_inpatient__stg_eligibility", "checksum": {"name": "sha256", "checksum": "8ea3cc5c41ed888f9eb8efd0e440f74e67e7b33dd4969c4267f859b5abb3909c"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_eligibility", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7098475, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_medical_claim"], "alias": "acute_inpatient__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "d56bfd67210f050492eb94d5324158b86000e550d4e6d69848d578e691130f0c"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_medical_claim", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7128463, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , claim_type\r\n , claim_start_date\r\n , claim_end_date\r\n , admission_date\r\n , discharge_date\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.acute_inpatient__stg_service_category": {"database": "dev_thuxuan", "schema": "test", "name": "acute_inpatient__stg_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category"], "alias": "acute_inpatient__stg_service_category", "checksum": {"name": "sha256", "checksum": "a1155be311fc6b6f364f6c5baec9b3195835afc5d81fb895ab4c3a996f08ad09"}, "config": {"enabled": true, "alias": "acute_inpatient__stg_service_category", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "acute_inpatient__stg_service_category", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7148466, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\r\n, claim_line_number\r\n, service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "refs": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__summary": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "unique_id": "model.the_tuva_project.emergency_department__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "final", "emergency_department__summary"], "alias": "emergency_department_summary", "checksum": {"name": "sha256", "checksum": "38032361837dc54cd177da94ad9d8631951c349f763df55304038ffe78ecaa73"}, "config": {"enabled": true, "alias": "emergency_department_summary", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "emergency_department_summary", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7308772, "relation_name": "dev_thuxuan.claims_preprocessing.emergency_department_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith distinct_encounters as (\r\nselect distinct\r\n a.encounter_id\r\n, a.patient_id\r\n, b.encounter_start_date\r\n, b.encounter_end_date\r\nfrom {{ ref('emergency_department__int_encounter_id') }} a\r\ninner join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('emergency_department__int_first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('emergency_department__int_last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\nselect\r\n b.encounter_id\r\n, sum(paid_amount) as prof_paid_amount\r\n, sum(allowed_amount) as prof_allowed_amount\r\n, sum(charge_amount) as prof_charge_amount\r\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\nselect distinct\r\n patient_id\r\n, birth_date\r\n, gender\r\n, race\r\nfrom {{ ref('eligibility') }}\r\n)\r\n\r\n, provider as (\r\nselect\r\n a.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, b.provider_first_name\r\n, b.provider_last_name\r\n, count(distinct facility_npi) as npi_count\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} a\r\nleft join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\ngroup by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n , a.encounter_start_date\r\n , a.encounter_end_date\r\n , a.patient_id\r\n , {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n , e.gender\r\n , e.race\r\n , c.diagnosis_code_type as primary_diagnosis_code_type\r\n , c.diagnosis_code_1 as primary_diagnosis_code\r\n , coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\r\n , f.facility_npi\r\n , f.provider_first_name\r\n , f.provider_last_name\r\n , c.ms_drg_code\r\n , j.ms_drg_description\r\n , j.medical_surgical\r\n , c.apr_drg_code\r\n , k.apr_drg_description\r\n , c.admit_source_code\r\n , h.admit_source_description\r\n , c.admit_type_code\r\n , i.admit_type_description\r\n , c.discharge_disposition_code\r\n , g.discharge_disposition_description\r\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n , {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n , case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_start_and_end_dates", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_first_claim_values", "package": null, "version": null}, {"name": "emergency_department__int_last_claim_values", "package": null, "version": null}, {"name": "medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "eligibility", "package": null, "version": null}, {"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.eligibility", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "compiled": true, "compiled_code": "\n\nwith distinct_encounters as (\nselect distinct\n a.encounter_id\n, a.patient_id\n, b.encounter_start_date\n, b.encounter_end_date\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id a\ninner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join dev_thuxuan.claims_preprocessing._int_emergency_department_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\nselect\n b.encounter_id\n, sum(paid_amount) as prof_paid_amount\n, sum(allowed_amount) as prof_allowed_amount\n, sum(charge_amount) as prof_charge_amount\nfrom tuva.input_layer.medical_claim a\ninner join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\nselect distinct\n patient_id\n, birth_date\n, gender\n, race\nfrom tuva.input_layer.eligibility\n)\n\n, provider as (\nselect\n a.encounter_id\n, max(a.facility_npi) as facility_npi\n, b.provider_first_name\n, b.provider_last_name\n, count(distinct facility_npi) as npi_count\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id a\nleft join dev_thuxuan.terminology.provider b\n on a.facility_npi = b.npi\ngroup by 1,3,4\n)\n\nselect\n a.encounter_id\n , a.encounter_start_date\n , a.encounter_end_date\n , a.patient_id\n , datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n , e.gender\n , e.race\n , c.diagnosis_code_type as primary_diagnosis_code_type\n , c.diagnosis_code_1 as primary_diagnosis_code\n , coalesce(icd10cm.long_description, icd9cm.long_description) as primary_diagnosis_description\n , f.facility_npi\n , f.provider_first_name\n , f.provider_last_name\n , c.ms_drg_code\n , j.ms_drg_description\n , j.medical_surgical\n , c.apr_drg_code\n , k.apr_drg_description\n , c.admit_source_code\n , h.admit_source_description\n , c.admit_type_code\n , i.admit_type_description\n , c.discharge_disposition_code\n , g.discharge_disposition_description\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n , datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n , case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom distinct_encounters a\nleft join institutional_claim_details c\n on a.encounter_id = c.encounter_id\nleft join professional_claim_details d\n on a.encounter_id = d.encounter_id\nleft join patient e\n on a.patient_id = e.patient_id\nleft join provider f\n on a.encounter_id = f.encounter_id\nleft join dev_thuxuan.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join dev_thuxuan.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join dev_thuxuan.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join dev_thuxuan.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join dev_thuxuan.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_id"], "alias": "_int_emergency_department_encounter_id", "checksum": {"name": "sha256", "checksum": "c0da17d4d9bba71141dded7bde3f6526a4b912aa332e6a76a58c4eb2f6c55a50"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7338762, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} inst\r\nleft join {{ ref('emergency_department__stg_medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_professional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__int_professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id inst\nleft join __dbt__cte__emergency_department__stg_medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_start_and_end_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_start_and_end_dates"], "alias": "_int_emergency_department_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "63e6cb67b07f7f259b4abb0475a8414cd8e52181a89c82f391e1424402c5cae5"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Defines encounter start and end dates for emergency_department encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_start_and_end_dates", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7379403, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith add_encounter_id_to_emergency_department_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('emergency_department__int_institutional_claims') }} aip\r\nleft join {{ ref('emergency_department__int_institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_emergency_department_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect \r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\r\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_claims", "package": null, "version": null}, {"name": "emergency_department__int_institutional_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n\nwith add_encounter_id_to_emergency_department_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims aip\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_emergency_department_encounters\ngroup by patient_id, encounter_id\n)\n\nselect \n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_first_claim_values"], "alias": "_int_emergency_department_first_claim_values", "checksum": {"name": "sha256", "checksum": "097b5828d393facda2ee2f01b8c5c39e72338c8b35e3b32d1db5c2c52a1cecd0"}, "config": {"enabled": true, "alias": "_int_emergency_department_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_first_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7420306, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('emergency_department__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id e\n inner join __dbt__cte__emergency_department__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_claims"], "alias": "_int_emergency_department_institutional_claims", "checksum": {"name": "sha256", "checksum": "b782e9ffb8cfbb5dbe444291364c94d3e3e0e11f854f1169a4794439d17c5095"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "All emergency_department institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_claims", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7449381, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith emergency_department_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('emergency_department__stg_medical_claim') }} mc\r\ninner join {{ ref('emergency_department__stg_service_category')}} sc\r\n on mc.claim_id = sc.claim_id\r\nwhere mc.claim_type = 'institutional'\r\n and sc.service_category_2 = 'Emergency Department'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [{"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__stg_service_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n), __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n),emergency_department_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom __dbt__cte__emergency_department__stg_medical_claim mc\ninner join __dbt__cte__emergency_department__stg_service_category sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Emergency Department'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom emergency_department_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom emergency_department_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n\nfrom header_level_values h\nleft join data_quality_flags dq\n on h.claim_id = dq.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}, {"id": "model.the_tuva_project.emergency_department__stg_service_category", "sql": " __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_encounter_id"], "alias": "_int_emergency_department_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "be89cc93df22e01f04c5e8e3e31be246b28d5955e104252e562343534b3ea2c6"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department institutional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7479446, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('emergency_department__int_institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [{"name": "emergency_department__int_institutional_claims", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional_claims\n),\n\ncheck_for_merges_with_larger_row_num as (\nselect\n aa.patient_id,\n aa.claim_id as claim_id_a,\n bb.claim_id as claim_id_b,\n aa.row_num as row_num_a,\n bb.row_num as row_num_b,\n case\n -- Claims with same end_date and same facility_npi should be merged:\n when (aa.end_date = bb.end_date\n and aa.facility_npi = bb.facility_npi) then 1\n -- Claims with different end_date \n -- should be merged if they overlap:\n when ( (aa.end_date <> bb.end_date) and \n (aa.end_date >= bb.start_date) and --overlap requirement\n (aa.facility_npi = bb.facility_npi)\n\t )then 1\n else 0\n end as merge_flag\nfrom add_row_num aa\n inner join add_row_num bb\n on aa.patient_id = bb.patient_id\n and aa.row_num < bb.row_num\n),\n\nmerges_with_larger_row_num as (\nselect\n patient_id,\n claim_id_a,\n claim_id_b,\n row_num_a,\n row_num_b,\n merge_flag\nfrom check_for_merges_with_larger_row_num\nwhere merge_flag = 1\n),\n\n\nclaim_ids_that_merge_with_larger_row_num as (\nselect distinct claim_id_a as claim_id\nfrom merges_with_larger_row_num\n),\n\n\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\nselect distinct aa.claim_id as claim_id\nfrom add_row_num aa\n inner join\n merges_with_larger_row_num bb\n on aa.patient_id = bb.patient_id\n and bb.row_num_a < aa.row_num\n and bb.row_num_b > aa.row_num\n),\n\n\nclose_flags as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.row_num,\n case when (bb.claim_id is null and cc.claim_id is null) then 1\n else 0\n end as close_flag\n\nfrom add_row_num aa\n\nleft join claim_ids_that_merge_with_larger_row_num bb\non aa.claim_id = bb.claim_id\n\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\non aa.claim_id = cc.claim_id\n),\n\n\njoin_every_row_to_later_closes as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.row_num as row_num,\n bb.row_num as row_num_b\nfrom close_flags aa inner join close_flags bb\n on aa.patient_id = bb.patient_id\n and aa.row_num <= bb.row_num\nwhere bb.close_flag = 1\n),\n\n\nfind_min_closing_row_num_for_every_claim as (\nselect\n patient_id,\n claim_id,\n min(row_num_b) as min_closing_row\nfrom join_every_row_to_later_closes\ngroup by patient_id, claim_id\n),\n\n\nadd_min_closing_row_to_every_claim as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n bb.min_closing_row as min_closing_row\nfrom close_flags aa\n left join find_min_closing_row_num_for_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.claim_id = bb.claim_id\n),\n\n\nadd_encounter_id as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n aa.min_closing_row as min_closing_row,\n bb.claim_id as encounter_id\nfrom add_min_closing_row_to_every_claim aa\n left join add_min_closing_row_to_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.min_closing_row = bb.row_num\n)\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_last_claim_values"], "alias": "_int_emergency_department_last_claim_values", "checksum": {"name": "sha256", "checksum": "cdcac307509e32aa888cb1e58695612ac6662adfcba02c437da3ebc21fc98728"}, "config": {"enabled": true, "alias": "_int_emergency_department_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (discharge disposition, etc)", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_last_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7551563, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('emergency_department__stg_medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [{"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id e\n inner join __dbt__cte__emergency_department__stg_medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "emergency_department__int_professional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_professional_encounter_id"], "alias": "_int_emergency_department_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "23eae8edab63adc6216c2326a32f50d69e54d18ae92541e5ad76659ce1faeb12"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department professional claim", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7509418, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_professional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith emergency_department_professional_claim_ids as (\r\nselect \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('emergency_department__stg_service_category') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Emergency Department'\r\n),\r\n\r\nemergency_department_professional_claim_lines as (\r\nselect\r\n mc.claim_id\r\n , mc.claim_line_number\r\n , mc.patient_id\r\n , mc.claim_start_date as start_date\r\n , mc.claim_end_date as end_date\t \r\nfrom {{ ref('emergency_department__stg_medical_claim') }} mc\r\ninner join emergency_department_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nemergency_department_professional_claim_dates as (\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\nfrom emergency_department_professional_claim_lines\r\ngroup by \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\n select\r\n aa.patient_id\r\n , aa.claim_id\r\n , aa.claim_line_number\r\n , aa.start_date\r\n , aa.end_date\r\n , bb.encounter_id\r\n , case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\n from emergency_department_professional_claim_dates aa\r\n left join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\n , count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_id, claim_line_number\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_emergency_department_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_emergency_department_professional_claims", "language": "sql", "refs": [{"name": "emergency_department__stg_service_category", "package": null, "version": null}, {"name": "emergency_department__stg_medical_claim", "package": null, "version": null}, {"name": "emergency_department__int_encounter_start_and_end_dates", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__stg_service_category", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n), __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),emergency_department_professional_claim_ids as (\nselect \n claim_id\n , claim_line_number\nfrom __dbt__cte__emergency_department__stg_service_category \nwhere claim_type = 'professional'\n and service_category_2 = 'Emergency Department'\n),\n\nemergency_department_professional_claim_lines as (\nselect\n mc.claim_id\n , mc.claim_line_number\n , mc.patient_id\n , mc.claim_start_date as start_date\n , mc.claim_end_date as end_date\t \nfrom __dbt__cte__emergency_department__stg_medical_claim mc\ninner join emergency_department_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nemergency_department_professional_claim_dates as (\nselect\n claim_id\n , claim_line_number\n , patient_id\n , min(start_date) as start_date\n , max(end_date) as end_date\nfrom emergency_department_professional_claim_lines\ngroup by \n claim_id\n , claim_line_number\n , patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\n select\n aa.patient_id\n , aa.claim_id\n , aa.claim_line_number\n , aa.start_date\n , aa.end_date\n , bb.encounter_id\n , case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\n from emergency_department_professional_claim_dates aa\n left join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id\n , claim_id\n , claim_line_number\n , min(start_date) as start_date\n , max(end_date) as end_date\n , count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_id, claim_line_number\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_emergency_department_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom all_emergency_department_professional_claims", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.emergency_department__stg_service_category", "sql": " __dbt__cte__emergency_department__stg_service_category as (\n\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper\n)"}, {"id": "model.the_tuva_project.emergency_department__stg_medical_claim", "sql": " __dbt__cte__emergency_department__stg_medical_claim as (\n\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_eligibility"], "alias": "emergency_department__stg_eligibility", "checksum": {"name": "sha256", "checksum": "ceb2bdec3e0b46fb8c63d40d7bcbee052bd6475870be65545bffe8bb480c1fec"}, "config": {"enabled": true, "alias": "emergency_department__stg_eligibility", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_eligibility", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7581542, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , birth_date\n , gender\n , race\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_medical_claim"], "alias": "emergency_department__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "67ad20964677e6cb8dd410b85642938bcb60c12291002e5d7f7a12eba87f19e8"}, "config": {"enabled": true, "alias": "emergency_department__stg_medical_claim", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_medical_claim", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7601547, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , claim_type\r\n , claim_start_date\r\n , claim_end_date\r\n , admission_date\r\n , discharge_date\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_id\n , claim_line_number\n , patient_id\n , claim_type\n , claim_start_date\n , claim_end_date\n , admission_date\n , discharge_date\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , paid_amount\n , allowed_amount\n , charge_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.emergency_department__stg_service_category": {"database": "dev_thuxuan", "schema": "test", "name": "emergency_department__stg_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "unique_id": "model.the_tuva_project.emergency_department__stg_service_category", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "staging", "emergency_department__stg_service_category"], "alias": "emergency_department__stg_service_category", "checksum": {"name": "sha256", "checksum": "105b5186427b29374ee4c199260f7b53e255ff14deb730a79942e66b4ae6cc40"}, "config": {"enabled": true, "alias": "emergency_department__stg_service_category", "schema": null, "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "emergency_department__stg_service_category", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.762155, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_type\r\n , claim_line_number\r\n , service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "refs": [{"name": "service_category__service_category_grouper", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\staging\\emergency_department__stg_service_category.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , claim_type\n , claim_line_number\n , service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__eligibility": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "unique_id": "model.the_tuva_project.normalized_input__eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__eligibility"], "alias": "normalized_input_eligibility", "checksum": {"name": "sha256", "checksum": "dd1a750618a90eb4478ad0b5362f71b6d2545fc829565dc20947de2197218b9c"}, "config": {"enabled": true, "alias": "normalized_input_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The eligibility table contains information on patient health plan and \nsupplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_eligibility", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8803186, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(elig.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(elig.member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(elig.subscriber_id as {{ dbt.type_string() }} ) as subscriber_id\r\n , cast(elig.gender as {{ dbt.type_string() }} ) as gender\r\n , cast(elig.race as {{ dbt.type_string() }} ) as race\r\n , cast(date_norm.normalized_birth_date as date ) as birth_date\r\n , cast(date_norm.normalized_death_date as date ) as death_date\r\n , cast(elig.death_flag as int ) as death_flag\r\n , cast(date_norm.normalized_enrollment_start_date as date ) as enrollment_start_date\r\n , cast(date_norm.normalized_enrollment_end_date as date ) as enrollment_end_date\r\n , cast(elig.payer as {{ dbt.type_string() }} ) as payer\r\n , cast(elig.payer_type as {{ dbt.type_string() }} ) as payer_type\r\n , cast(elig.plan as {{ dbt.type_string() }} ) as plan\r\n , cast(elig.original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\r\n , cast(elig.dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\r\n , cast(elig.medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\r\n , cast(elig.first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(elig.last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(elig.social_security_number as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(elig.subscriber_relation as {{ dbt.type_string() }} ) as subscriber_relation\r\n , cast(elig.address as {{ dbt.type_string() }} ) as address\r\n , cast(elig.city as {{ dbt.type_string() }} ) as city\r\n , cast(elig.state as {{ dbt.type_string() }} ) as state\r\n , cast(elig.zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(elig.phone as {{ dbt.type_string() }} ) as phone\r\n , cast(elig.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_eligibility') }} elig\r\nleft join {{ ref('normalized_input__int_eligibility_dates_normalize') }} date_norm\r\n on elig.patient_id_key = date_norm.patient_id_key", "language": "sql", "refs": [{"name": "normalized_input__stg_eligibility", "package": null, "version": null}, {"name": "normalized_input__int_eligibility_dates_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__stg_eligibility", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)select\n cast(elig.patient_id as TEXT ) as patient_id\n , cast(elig.member_id as TEXT ) as member_id\n , cast(elig.subscriber_id as TEXT ) as subscriber_id\n , cast(elig.gender as TEXT ) as gender\n , cast(elig.race as TEXT ) as race\n , cast(date_norm.normalized_birth_date as date ) as birth_date\n , cast(date_norm.normalized_death_date as date ) as death_date\n , cast(elig.death_flag as int ) as death_flag\n , cast(date_norm.normalized_enrollment_start_date as date ) as enrollment_start_date\n , cast(date_norm.normalized_enrollment_end_date as date ) as enrollment_end_date\n , cast(elig.payer as TEXT ) as payer\n , cast(elig.payer_type as TEXT ) as payer_type\n , cast(elig.plan as TEXT ) as plan\n , cast(elig.original_reason_entitlement_code as TEXT ) as original_reason_entitlement_code\n , cast(elig.dual_status_code as TEXT ) as dual_status_code\n , cast(elig.medicare_status_code as TEXT ) as medicare_status_code\n , cast(elig.first_name as TEXT ) as first_name\n , cast(elig.last_name as TEXT ) as last_name\n , cast(elig.social_security_number as TEXT ) as social_security_number\n , cast(elig.subscriber_relation as TEXT ) as subscriber_relation\n , cast(elig.address as TEXT ) as address\n , cast(elig.city as TEXT ) as city\n , cast(elig.state as TEXT ) as state\n , cast(elig.zip_code as TEXT ) as zip_code\n , cast(elig.phone as TEXT ) as phone\n , cast(elig.data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_eligibility elig\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_eligibility_dates_normalize date_norm\n on elig.patient_id_key = date_norm.patient_id_key", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_eligibility", "sql": " __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__medical_claim": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__medical_claim"], "alias": "normalized_input_medical_claim", "checksum": {"name": "sha256", "checksum": "df62308dfe919d72c9b017de1aeeb02c7051fd9d6c78a78a81c5a8981be4b2c5"}, "config": {"enabled": true, "alias": "normalized_input_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The medical claim table contains information on services rendered to \npatients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_medical_claim", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8989365, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n\tcast(med.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n\t, cast(med.claim_line_number as int ) as claim_line_number\r\n\t, cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\r\n\t, cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n\t, cast(med.member_id as {{ dbt.type_string() }} ) as member_id\r\n\t, cast(med.payer as {{ dbt.type_string() }} ) as payer\r\n\t, cast(med.plan as {{ dbt.type_string() }} ) as plan\r\n\t, cast(coalesce(dates.minimum_claim_start_date, undetermined.claim_start_date) as date ) as claim_start_date\r\n\t, cast(coalesce(dates.maximum_claim_end_date, undetermined.claim_start_date) as date ) as claim_end_date\r\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_start_date, undetermined.claim_line_start_date) as date ) as claim_line_start_date\r\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_end_date, undetermined.claim_line_end_date) as date ) as claim_line_end_date\r\n\t, cast(coalesce(dates.minimum_admission_date, undetermined.admission_date) as date ) as admission_date\r\n\t, cast(coalesce(dates.maximum_discharge_date, undetermined.discharge_date) as date ) as discharge_date\r\n\t, cast(coalesce(ad_source.normalized_code, undetermined.admit_source_code) as {{ dbt.type_string() }} ) as admit_source_code\r\n\t, cast(coalesce(ad_type.normalized_code, undetermined.admit_type_code) as {{ dbt.type_string() }} ) as admit_type_code\r\n\t, cast(coalesce(disch_disp.normalized_code, undetermined.discharge_disposition_code) as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n\t, cast(coalesce(pos.normalized_code, undetermined.place_of_service_code) as {{ dbt.type_string() }} ) as place_of_service_code\r\n\t, cast(coalesce(bill.normalized_code, undetermined.bill_type_code) as {{ dbt.type_string() }} ) as bill_type_code\r\n\t, cast(coalesce(ms.normalized_code, undetermined.ms_drg_code) as {{ dbt.type_string() }} ) as ms_drg_code\r\n\t, cast(coalesce(apr.normalized_code, undetermined.apr_drg_code) as {{ dbt.type_string() }} ) as apr_drg_code\r\n\t, cast(coalesce(rev.normalized_code, undetermined.revenue_center_code) as {{ dbt.type_string() }} ) as revenue_center_code\r\n\t, cast(med.service_unit_quantity as {{ dbt.type_string() }} ) as service_unit_quantity\r\n\t, cast(med.hcpcs_code as {{ dbt.type_string() }} ) as hcpcs_code\r\n\t, cast(med.hcpcs_modifier_1 as {{ dbt.type_string() }} ) as hcpcs_modifier_1\r\n\t, cast(med.hcpcs_modifier_2 as {{ dbt.type_string() }} ) as hcpcs_modifier_2\r\n\t, cast(med.hcpcs_modifier_3 as {{ dbt.type_string() }} ) as hcpcs_modifier_3\r\n\t, cast(med.hcpcs_modifier_4 as {{ dbt.type_string() }} ) as hcpcs_modifier_4\r\n\t, cast(med.hcpcs_modifier_5 as {{ dbt.type_string() }} ) as hcpcs_modifier_5\r\n\t, cast(coalesce(med_npi.normalized_rendering_npi, undetermined.rendering_npi) as {{ dbt.type_string() }} ) as rendering_npi\r\n\t, cast(coalesce(med_npi.normalized_billing_npi, undetermined.billing_npi) as {{ dbt.type_string() }} ) as billing_npi\r\n\t, cast(coalesce(med_npi.normalized_facility_npi, undetermined.facility_npi) as {{ dbt.type_string() }} ) as facility_npi\r\n\t, cast(med.paid_date as date ) as paid_date\r\n\t, cast(med.paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n\t, cast(med.allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n\t, cast(med.charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n\t, cast(med.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n\t, cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n\t, cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n\t, cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\r\n\t, cast(med.diagnosis_code_type as {{ dbt.type_string() }} ) as diagnosis_code_type\r\n\t, cast(coalesce(dx_code.diagnosis_code_1, undetermined.diagnosis_code_1) as {{ dbt.type_string() }} ) as diagnosis_code_1\r\n\t, cast(coalesce(dx_code.diagnosis_code_2, undetermined.diagnosis_code_2) as {{ dbt.type_string() }} ) as diagnosis_code_2\r\n\t, cast(coalesce(dx_code.diagnosis_code_3, undetermined.diagnosis_code_3) as {{ dbt.type_string() }} ) as diagnosis_code_3\r\n\t, cast(coalesce(dx_code.diagnosis_code_4, undetermined.diagnosis_code_4) as {{ dbt.type_string() }} ) as diagnosis_code_4\r\n\t, cast(coalesce(dx_code.diagnosis_code_5, undetermined.diagnosis_code_5) as {{ dbt.type_string() }} ) as diagnosis_code_5\r\n\t, cast(coalesce(dx_code.diagnosis_code_6, undetermined.diagnosis_code_6) as {{ dbt.type_string() }} ) as diagnosis_code_6\r\n\t, cast(coalesce(dx_code.diagnosis_code_7, undetermined.diagnosis_code_7) as {{ dbt.type_string() }} ) as diagnosis_code_7\r\n\t, cast(coalesce(dx_code.diagnosis_code_8, undetermined.diagnosis_code_8) as {{ dbt.type_string() }} ) as diagnosis_code_8\r\n\t, cast(coalesce(dx_code.diagnosis_code_9, undetermined.diagnosis_code_9) as {{ dbt.type_string() }} ) as diagnosis_code_9\r\n\t, cast(coalesce(dx_code.diagnosis_code_10, undetermined.diagnosis_code_10) as {{ dbt.type_string() }} ) as diagnosis_code_10\r\n\t, cast(coalesce(dx_code.diagnosis_code_11, undetermined.diagnosis_code_11) as {{ dbt.type_string() }} ) as diagnosis_code_11\r\n\t, cast(coalesce(dx_code.diagnosis_code_12, undetermined.diagnosis_code_12) as {{ dbt.type_string() }} ) as diagnosis_code_12\r\n\t, cast(coalesce(dx_code.diagnosis_code_13, undetermined.diagnosis_code_13) as {{ dbt.type_string() }} ) as diagnosis_code_13\r\n\t, cast(coalesce(dx_code.diagnosis_code_14, undetermined.diagnosis_code_14) as {{ dbt.type_string() }} ) as diagnosis_code_14\r\n\t, cast(coalesce(dx_code.diagnosis_code_15, undetermined.diagnosis_code_15) as {{ dbt.type_string() }} ) as diagnosis_code_15\r\n\t, cast(coalesce(dx_code.diagnosis_code_16, undetermined.diagnosis_code_16) as {{ dbt.type_string() }} ) as diagnosis_code_16\r\n\t, cast(coalesce(dx_code.diagnosis_code_17, undetermined.diagnosis_code_17) as {{ dbt.type_string() }} ) as diagnosis_code_17\r\n\t, cast(coalesce(dx_code.diagnosis_code_18, undetermined.diagnosis_code_18) as {{ dbt.type_string() }} ) as diagnosis_code_18\r\n\t, cast(coalesce(dx_code.diagnosis_code_19, undetermined.diagnosis_code_19) as {{ dbt.type_string() }} ) as diagnosis_code_19\r\n\t, cast(coalesce(dx_code.diagnosis_code_20, undetermined.diagnosis_code_20) as {{ dbt.type_string() }} ) as diagnosis_code_20\r\n\t, cast(coalesce(dx_code.diagnosis_code_21, undetermined.diagnosis_code_21) as {{ dbt.type_string() }} ) as diagnosis_code_21\r\n\t, cast(coalesce(dx_code.diagnosis_code_22, undetermined.diagnosis_code_22) as {{ dbt.type_string() }} ) as diagnosis_code_22\r\n\t, cast(coalesce(dx_code.diagnosis_code_23, undetermined.diagnosis_code_23) as {{ dbt.type_string() }} ) as diagnosis_code_23\r\n\t, cast(coalesce(dx_code.diagnosis_code_24, undetermined.diagnosis_code_24) as {{ dbt.type_string() }} ) as diagnosis_code_24\r\n\t, cast(coalesce(dx_code.diagnosis_code_25, undetermined.diagnosis_code_25) as {{ dbt.type_string() }} ) as diagnosis_code_25\r\n\t, cast(coalesce(poa.diagnosis_poa_1, undetermined.diagnosis_poa_1) as {{ dbt.type_string() }} ) as diagnosis_poa_1\r\n\t, cast(coalesce(poa.diagnosis_poa_2, undetermined.diagnosis_poa_2) as {{ dbt.type_string() }} ) as diagnosis_poa_2\r\n\t, cast(coalesce(poa.diagnosis_poa_3, undetermined.diagnosis_poa_3) as {{ dbt.type_string() }} ) as diagnosis_poa_3\r\n\t, cast(coalesce(poa.diagnosis_poa_4, undetermined.diagnosis_poa_4) as {{ dbt.type_string() }} ) as diagnosis_poa_4\r\n\t, cast(coalesce(poa.diagnosis_poa_5, undetermined.diagnosis_poa_5) as {{ dbt.type_string() }} ) as diagnosis_poa_5\r\n\t, cast(coalesce(poa.diagnosis_poa_6, undetermined.diagnosis_poa_6) as {{ dbt.type_string() }} ) as diagnosis_poa_6\r\n\t, cast(coalesce(poa.diagnosis_poa_7, undetermined.diagnosis_poa_7) as {{ dbt.type_string() }} ) as diagnosis_poa_7\r\n\t, cast(coalesce(poa.diagnosis_poa_8, undetermined.diagnosis_poa_8) as {{ dbt.type_string() }} ) as diagnosis_poa_8\r\n\t, cast(coalesce(poa.diagnosis_poa_9, undetermined.diagnosis_poa_9) as {{ dbt.type_string() }} ) as diagnosis_poa_9\r\n\t, cast(coalesce(poa.diagnosis_poa_10, undetermined.diagnosis_poa_10) as {{ dbt.type_string() }} ) as diagnosis_poa_10\r\n\t, cast(coalesce(poa.diagnosis_poa_11, undetermined.diagnosis_poa_11) as {{ dbt.type_string() }} ) as diagnosis_poa_11\r\n\t, cast(coalesce(poa.diagnosis_poa_12, undetermined.diagnosis_poa_12) as {{ dbt.type_string() }} ) as diagnosis_poa_12\r\n\t, cast(coalesce(poa.diagnosis_poa_13, undetermined.diagnosis_poa_13) as {{ dbt.type_string() }} ) as diagnosis_poa_13\r\n\t, cast(coalesce(poa.diagnosis_poa_14, undetermined.diagnosis_poa_14) as {{ dbt.type_string() }} ) as diagnosis_poa_14\r\n\t, cast(coalesce(poa.diagnosis_poa_15, undetermined.diagnosis_poa_15) as {{ dbt.type_string() }} ) as diagnosis_poa_15\r\n\t, cast(coalesce(poa.diagnosis_poa_16, undetermined.diagnosis_poa_16) as {{ dbt.type_string() }} ) as diagnosis_poa_16\r\n\t, cast(coalesce(poa.diagnosis_poa_17, undetermined.diagnosis_poa_17) as {{ dbt.type_string() }} ) as diagnosis_poa_17\r\n\t, cast(coalesce(poa.diagnosis_poa_18, undetermined.diagnosis_poa_18) as {{ dbt.type_string() }} ) as diagnosis_poa_18\r\n\t, cast(coalesce(poa.diagnosis_poa_19, undetermined.diagnosis_poa_19) as {{ dbt.type_string() }} ) as diagnosis_poa_19\r\n\t, cast(coalesce(poa.diagnosis_poa_20, undetermined.diagnosis_poa_20) as {{ dbt.type_string() }} ) as diagnosis_poa_20\r\n\t, cast(coalesce(poa.diagnosis_poa_21, undetermined.diagnosis_poa_21) as {{ dbt.type_string() }} ) as diagnosis_poa_21\r\n\t, cast(coalesce(poa.diagnosis_poa_22, undetermined.diagnosis_poa_22) as {{ dbt.type_string() }} ) as diagnosis_poa_22\r\n\t, cast(coalesce(poa.diagnosis_poa_23, undetermined.diagnosis_poa_23) as {{ dbt.type_string() }} ) as diagnosis_poa_23\r\n\t, cast(coalesce(poa.diagnosis_poa_24, undetermined.diagnosis_poa_24) as {{ dbt.type_string() }} ) as diagnosis_poa_24\r\n\t, cast(coalesce(poa.diagnosis_poa_25, undetermined.diagnosis_poa_25) as {{ dbt.type_string() }} ) as diagnosis_poa_25\r\n\t, cast(med.procedure_code_type as {{ dbt.type_string() }} ) as procedure_code_type\r\n\t, cast(coalesce(px_code.procedure_code_1, undetermined.procedure_code_1) as {{ dbt.type_string() }} ) as procedure_code_1\r\n\t, cast(coalesce(px_code.procedure_code_2, undetermined.procedure_code_2) as {{ dbt.type_string() }} ) as procedure_code_2\r\n\t, cast(coalesce(px_code.procedure_code_3, undetermined.procedure_code_3) as {{ dbt.type_string() }} ) as procedure_code_3\r\n\t, cast(coalesce(px_code.procedure_code_4, undetermined.procedure_code_4) as {{ dbt.type_string() }} ) as procedure_code_4\r\n\t, cast(coalesce(px_code.procedure_code_5, undetermined.procedure_code_5) as {{ dbt.type_string() }} ) as procedure_code_5\r\n\t, cast(coalesce(px_code.procedure_code_6, undetermined.procedure_code_6) as {{ dbt.type_string() }} ) as procedure_code_6\r\n\t, cast(coalesce(px_code.procedure_code_7, undetermined.procedure_code_7) as {{ dbt.type_string() }} ) as procedure_code_7\r\n\t, cast(coalesce(px_code.procedure_code_8, undetermined.procedure_code_8) as {{ dbt.type_string() }} ) as procedure_code_8\r\n\t, cast(coalesce(px_code.procedure_code_9, undetermined.procedure_code_9) as {{ dbt.type_string() }} ) as procedure_code_9\r\n\t, cast(coalesce(px_code.procedure_code_10, undetermined.procedure_code_10) as {{ dbt.type_string() }} ) as procedure_code_10\r\n\t, cast(coalesce(px_code.procedure_code_11, undetermined.procedure_code_11) as {{ dbt.type_string() }} ) as procedure_code_11\r\n\t, cast(coalesce(px_code.procedure_code_12, undetermined.procedure_code_12) as {{ dbt.type_string() }} ) as procedure_code_12\r\n\t, cast(coalesce(px_code.procedure_code_13, undetermined.procedure_code_13) as {{ dbt.type_string() }} ) as procedure_code_13\r\n\t, cast(coalesce(px_code.procedure_code_14, undetermined.procedure_code_14) as {{ dbt.type_string() }} ) as procedure_code_14\r\n\t, cast(coalesce(px_code.procedure_code_15, undetermined.procedure_code_15) as {{ dbt.type_string() }} ) as procedure_code_15\r\n\t, cast(coalesce(px_code.procedure_code_16, undetermined.procedure_code_16) as {{ dbt.type_string() }} ) as procedure_code_16\r\n\t, cast(coalesce(px_code.procedure_code_17, undetermined.procedure_code_17) as {{ dbt.type_string() }} ) as procedure_code_17\r\n\t, cast(coalesce(px_code.procedure_code_18, undetermined.procedure_code_18) as {{ dbt.type_string() }} ) as procedure_code_18\r\n\t, cast(coalesce(px_code.procedure_code_19, undetermined.procedure_code_19) as {{ dbt.type_string() }} ) as procedure_code_19\r\n\t, cast(coalesce(px_code.procedure_code_20, undetermined.procedure_code_20) as {{ dbt.type_string() }} ) as procedure_code_20\r\n\t, cast(coalesce(px_code.procedure_code_21, undetermined.procedure_code_21) as {{ dbt.type_string() }} ) as procedure_code_21\r\n\t, cast(coalesce(px_code.procedure_code_22, undetermined.procedure_code_22) as {{ dbt.type_string() }} ) as procedure_code_22\r\n\t, cast(coalesce(px_code.procedure_code_23, undetermined.procedure_code_23) as {{ dbt.type_string() }} ) as procedure_code_23\r\n\t, cast(coalesce(px_code.procedure_code_24, undetermined.procedure_code_24) as {{ dbt.type_string() }} ) as procedure_code_24\r\n\t, cast(coalesce(px_code.procedure_code_25, undetermined.procedure_code_25) as {{ dbt.type_string() }} ) as procedure_code_25\r\n\t, cast(coalesce(px_date.procedure_date_1, undetermined.procedure_date_1) as date ) as procedure_date_1\r\n\t, cast(coalesce(px_date.procedure_date_2, undetermined.procedure_date_2) as date ) as procedure_date_2\r\n\t, cast(coalesce(px_date.procedure_date_3, undetermined.procedure_date_3) as date ) as procedure_date_3\r\n\t, cast(coalesce(px_date.procedure_date_4, undetermined.procedure_date_4) as date ) as procedure_date_4\r\n\t, cast(coalesce(px_date.procedure_date_5, undetermined.procedure_date_5) as date ) as procedure_date_5\r\n\t, cast(coalesce(px_date.procedure_date_6, undetermined.procedure_date_6) as date ) as procedure_date_6\r\n\t, cast(coalesce(px_date.procedure_date_7, undetermined.procedure_date_7) as date ) as procedure_date_7\r\n\t, cast(coalesce(px_date.procedure_date_8, undetermined.procedure_date_8) as date ) as procedure_date_8\r\n\t, cast(coalesce(px_date.procedure_date_9, undetermined.procedure_date_9) as date ) as procedure_date_9\r\n\t, cast(coalesce(px_date.procedure_date_10, undetermined.procedure_date_10) as date ) as procedure_date_10\r\n\t, cast(coalesce(px_date.procedure_date_11, undetermined.procedure_date_11) as date ) as procedure_date_11\r\n\t, cast(coalesce(px_date.procedure_date_12, undetermined.procedure_date_12) as date ) as procedure_date_12\r\n\t, cast(coalesce(px_date.procedure_date_13, undetermined.procedure_date_13) as date ) as procedure_date_13\r\n\t, cast(coalesce(px_date.procedure_date_14, undetermined.procedure_date_14) as date ) as procedure_date_14\r\n\t, cast(coalesce(px_date.procedure_date_15, undetermined.procedure_date_15) as date ) as procedure_date_15\r\n\t, cast(coalesce(px_date.procedure_date_16, undetermined.procedure_date_16) as date ) as procedure_date_16\r\n\t, cast(coalesce(px_date.procedure_date_17, undetermined.procedure_date_17) as date ) as procedure_date_17\r\n\t, cast(coalesce(px_date.procedure_date_18, undetermined.procedure_date_18) as date ) as procedure_date_18\r\n\t, cast(coalesce(px_date.procedure_date_19, undetermined.procedure_date_19) as date ) as procedure_date_19\r\n\t, cast(coalesce(px_date.procedure_date_20, undetermined.procedure_date_20) as date ) as procedure_date_20\r\n\t, cast(coalesce(px_date.procedure_date_21, undetermined.procedure_date_21) as date ) as procedure_date_21\r\n\t, cast(coalesce(px_date.procedure_date_22, undetermined.procedure_date_22) as date ) as procedure_date_22\r\n\t, cast(coalesce(px_date.procedure_date_23, undetermined.procedure_date_23) as date ) as procedure_date_23\r\n\t, cast(coalesce(px_date.procedure_date_24, undetermined.procedure_date_24) as date ) as procedure_date_24\r\n\t, cast(coalesce(px_date.procedure_date_25, undetermined.procedure_date_25) as date ) as procedure_date_25\r\n\t, cast(med.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ref('normalized_input__int_admit_source_final') }} ad_source\r\n on med.claim_id = ad_source.claim_id\r\n and med.data_source = ad_source.data_source\r\nleft join {{ref('normalized_input__int_admit_type_final') }} ad_type\r\n on med.claim_id = ad_type.claim_id\r\n and med.data_source = ad_type.data_source\r\nleft join {{ref('normalized_input__int_apr_drg_final') }} apr\r\n on med.claim_id = apr.claim_id\r\n and med.data_source = apr.data_source\r\nleft join {{ref('normalized_input__int_bill_type_final') }} bill\r\n on med.claim_id = bill.claim_id\r\n and med.data_source = bill.data_source\r\nleft join {{ref('normalized_input__int_medical_claim_date_normalize') }} claim_line_dates\r\n on med.claim_id = claim_line_dates.claim_id\r\n and med.claim_line_number = claim_line_dates.claim_line_number\r\n and med.data_source = claim_line_dates.data_source\r\nleft join {{ref('normalized_input__int_medical_date_aggregation') }} dates\r\n on med.claim_id = dates.claim_id\r\n and med.data_source = dates.data_source\r\nleft join {{ref('normalized_input__int_medical_npi_normalize') }} med_npi\r\n on med.claim_id = med_npi.claim_id\r\n and med.claim_line_number = med_npi.claim_line_number\r\n and med.data_source = med_npi.data_source\r\nleft join {{ref('normalized_input__int_discharge_disposition_final') }} disch_disp\r\n on med.claim_id = disch_disp.claim_id\r\n and med.data_source = disch_disp.data_source\r\nleft join {{ref('normalized_input__int_ms_drg_final') }} ms\r\n on med.claim_id = ms.claim_id\r\n and med.data_source = ms.data_source\r\nleft join {{ref('normalized_input__int_place_of_service_normalize') }} pos\r\n on med.claim_id = pos.claim_id\r\n and med.claim_line_number = pos.claim_line_number\r\n and med.data_source = pos.data_source\r\nleft join {{ref('normalized_input__int_diagnosis_code_final') }} dx_code\r\n on med.claim_id = dx_code.claim_id\r\n and med.data_source = dx_code.data_source\r\nleft join {{ref('normalized_input__int_present_on_admit_final') }} poa\r\n on med.claim_id = poa.claim_id\r\n and med.data_source = poa.data_source\r\nleft join {{ref('normalized_input__int_procedure_code_final') }} px_code\r\n on med.claim_id = px_code.claim_id\r\n and med.data_source = px_code.data_source\r\nleft join {{ref('normalized_input__int_procedure_date_final') }} px_date\r\n on med.claim_id = px_date.claim_id\r\n and med.data_source = px_date.data_source\r\nleft join {{ref('normalized_input__int_revenue_center_normalize') }} rev\r\n on med.claim_id = rev.claim_id\r\n and med.claim_line_number = rev.claim_line_number\r\n and med.data_source = rev.data_source\r\nleft join {{ref('normalized_input__int_undetermined_claim_type') }} undetermined\r\n on med.claim_id = undetermined.claim_id\r\n and med.claim_line_number = undetermined.claim_line_number\r\n and med.data_source = undetermined.data_source", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__int_admit_source_final", "package": null, "version": null}, {"name": "normalized_input__int_admit_type_final", "package": null, "version": null}, {"name": "normalized_input__int_apr_drg_final", "package": null, "version": null}, {"name": "normalized_input__int_bill_type_final", "package": null, "version": null}, {"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}, {"name": "normalized_input__int_medical_date_aggregation", "package": null, "version": null}, {"name": "normalized_input__int_medical_npi_normalize", "package": null, "version": null}, {"name": "normalized_input__int_discharge_disposition_final", "package": null, "version": null}, {"name": "normalized_input__int_ms_drg_final", "package": null, "version": null}, {"name": "normalized_input__int_place_of_service_normalize", "package": null, "version": null}, {"name": "normalized_input__int_diagnosis_code_final", "package": null, "version": null}, {"name": "normalized_input__int_present_on_admit_final", "package": null, "version": null}, {"name": "normalized_input__int_procedure_code_final", "package": null, "version": null}, {"name": "normalized_input__int_procedure_date_final", "package": null, "version": null}, {"name": "normalized_input__int_revenue_center_normalize", "package": null, "version": null}, {"name": "normalized_input__int_undetermined_claim_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__int_admit_source_final", "model.the_tuva_project.normalized_input__int_admit_type_final", "model.the_tuva_project.normalized_input__int_apr_drg_final", "model.the_tuva_project.normalized_input__int_bill_type_final", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "model.the_tuva_project.normalized_input__int_ms_drg_final", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "model.the_tuva_project.normalized_input__int_present_on_admit_final", "model.the_tuva_project.normalized_input__int_procedure_code_final", "model.the_tuva_project.normalized_input__int_procedure_date_final", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n\tcast(med.claim_id as TEXT ) as claim_id\n\t, cast(med.claim_line_number as int ) as claim_line_number\n\t, cast(med.claim_type as TEXT ) as claim_type\n\t, cast(med.patient_id as TEXT ) as patient_id\n\t, cast(med.member_id as TEXT ) as member_id\n\t, cast(med.payer as TEXT ) as payer\n\t, cast(med.plan as TEXT ) as plan\n\t, cast(coalesce(dates.minimum_claim_start_date, undetermined.claim_start_date) as date ) as claim_start_date\n\t, cast(coalesce(dates.maximum_claim_end_date, undetermined.claim_start_date) as date ) as claim_end_date\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_start_date, undetermined.claim_line_start_date) as date ) as claim_line_start_date\n\t, cast(coalesce(claim_line_dates.normalized_claim_line_end_date, undetermined.claim_line_end_date) as date ) as claim_line_end_date\n\t, cast(coalesce(dates.minimum_admission_date, undetermined.admission_date) as date ) as admission_date\n\t, cast(coalesce(dates.maximum_discharge_date, undetermined.discharge_date) as date ) as discharge_date\n\t, cast(coalesce(ad_source.normalized_code, undetermined.admit_source_code) as TEXT ) as admit_source_code\n\t, cast(coalesce(ad_type.normalized_code, undetermined.admit_type_code) as TEXT ) as admit_type_code\n\t, cast(coalesce(disch_disp.normalized_code, undetermined.discharge_disposition_code) as TEXT ) as discharge_disposition_code\n\t, cast(coalesce(pos.normalized_code, undetermined.place_of_service_code) as TEXT ) as place_of_service_code\n\t, cast(coalesce(bill.normalized_code, undetermined.bill_type_code) as TEXT ) as bill_type_code\n\t, cast(coalesce(ms.normalized_code, undetermined.ms_drg_code) as TEXT ) as ms_drg_code\n\t, cast(coalesce(apr.normalized_code, undetermined.apr_drg_code) as TEXT ) as apr_drg_code\n\t, cast(coalesce(rev.normalized_code, undetermined.revenue_center_code) as TEXT ) as revenue_center_code\n\t, cast(med.service_unit_quantity as TEXT ) as service_unit_quantity\n\t, cast(med.hcpcs_code as TEXT ) as hcpcs_code\n\t, cast(med.hcpcs_modifier_1 as TEXT ) as hcpcs_modifier_1\n\t, cast(med.hcpcs_modifier_2 as TEXT ) as hcpcs_modifier_2\n\t, cast(med.hcpcs_modifier_3 as TEXT ) as hcpcs_modifier_3\n\t, cast(med.hcpcs_modifier_4 as TEXT ) as hcpcs_modifier_4\n\t, cast(med.hcpcs_modifier_5 as TEXT ) as hcpcs_modifier_5\n\t, cast(coalesce(med_npi.normalized_rendering_npi, undetermined.rendering_npi) as TEXT ) as rendering_npi\n\t, cast(coalesce(med_npi.normalized_billing_npi, undetermined.billing_npi) as TEXT ) as billing_npi\n\t, cast(coalesce(med_npi.normalized_facility_npi, undetermined.facility_npi) as TEXT ) as facility_npi\n\t, cast(med.paid_date as date ) as paid_date\n\t, cast(med.paid_amount as numeric(28,6) ) as paid_amount\n\t, cast(med.allowed_amount as numeric(28,6) ) as allowed_amount\n\t, cast(med.charge_amount as numeric(28,6) ) as charge_amount\n\t, cast(med.coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n\t, cast(med.copayment_amount as numeric(28,6) ) as copayment_amount\n\t, cast(med.deductible_amount as numeric(28,6) ) as deductible_amount\n\t, cast(med.total_cost_amount as numeric(28,6) ) as total_cost_amount\n\t, cast(med.diagnosis_code_type as TEXT ) as diagnosis_code_type\n\t, cast(coalesce(dx_code.diagnosis_code_1, undetermined.diagnosis_code_1) as TEXT ) as diagnosis_code_1\n\t, cast(coalesce(dx_code.diagnosis_code_2, undetermined.diagnosis_code_2) as TEXT ) as diagnosis_code_2\n\t, cast(coalesce(dx_code.diagnosis_code_3, undetermined.diagnosis_code_3) as TEXT ) as diagnosis_code_3\n\t, cast(coalesce(dx_code.diagnosis_code_4, undetermined.diagnosis_code_4) as TEXT ) as diagnosis_code_4\n\t, cast(coalesce(dx_code.diagnosis_code_5, undetermined.diagnosis_code_5) as TEXT ) as diagnosis_code_5\n\t, cast(coalesce(dx_code.diagnosis_code_6, undetermined.diagnosis_code_6) as TEXT ) as diagnosis_code_6\n\t, cast(coalesce(dx_code.diagnosis_code_7, undetermined.diagnosis_code_7) as TEXT ) as diagnosis_code_7\n\t, cast(coalesce(dx_code.diagnosis_code_8, undetermined.diagnosis_code_8) as TEXT ) as diagnosis_code_8\n\t, cast(coalesce(dx_code.diagnosis_code_9, undetermined.diagnosis_code_9) as TEXT ) as diagnosis_code_9\n\t, cast(coalesce(dx_code.diagnosis_code_10, undetermined.diagnosis_code_10) as TEXT ) as diagnosis_code_10\n\t, cast(coalesce(dx_code.diagnosis_code_11, undetermined.diagnosis_code_11) as TEXT ) as diagnosis_code_11\n\t, cast(coalesce(dx_code.diagnosis_code_12, undetermined.diagnosis_code_12) as TEXT ) as diagnosis_code_12\n\t, cast(coalesce(dx_code.diagnosis_code_13, undetermined.diagnosis_code_13) as TEXT ) as diagnosis_code_13\n\t, cast(coalesce(dx_code.diagnosis_code_14, undetermined.diagnosis_code_14) as TEXT ) as diagnosis_code_14\n\t, cast(coalesce(dx_code.diagnosis_code_15, undetermined.diagnosis_code_15) as TEXT ) as diagnosis_code_15\n\t, cast(coalesce(dx_code.diagnosis_code_16, undetermined.diagnosis_code_16) as TEXT ) as diagnosis_code_16\n\t, cast(coalesce(dx_code.diagnosis_code_17, undetermined.diagnosis_code_17) as TEXT ) as diagnosis_code_17\n\t, cast(coalesce(dx_code.diagnosis_code_18, undetermined.diagnosis_code_18) as TEXT ) as diagnosis_code_18\n\t, cast(coalesce(dx_code.diagnosis_code_19, undetermined.diagnosis_code_19) as TEXT ) as diagnosis_code_19\n\t, cast(coalesce(dx_code.diagnosis_code_20, undetermined.diagnosis_code_20) as TEXT ) as diagnosis_code_20\n\t, cast(coalesce(dx_code.diagnosis_code_21, undetermined.diagnosis_code_21) as TEXT ) as diagnosis_code_21\n\t, cast(coalesce(dx_code.diagnosis_code_22, undetermined.diagnosis_code_22) as TEXT ) as diagnosis_code_22\n\t, cast(coalesce(dx_code.diagnosis_code_23, undetermined.diagnosis_code_23) as TEXT ) as diagnosis_code_23\n\t, cast(coalesce(dx_code.diagnosis_code_24, undetermined.diagnosis_code_24) as TEXT ) as diagnosis_code_24\n\t, cast(coalesce(dx_code.diagnosis_code_25, undetermined.diagnosis_code_25) as TEXT ) as diagnosis_code_25\n\t, cast(coalesce(poa.diagnosis_poa_1, undetermined.diagnosis_poa_1) as TEXT ) as diagnosis_poa_1\n\t, cast(coalesce(poa.diagnosis_poa_2, undetermined.diagnosis_poa_2) as TEXT ) as diagnosis_poa_2\n\t, cast(coalesce(poa.diagnosis_poa_3, undetermined.diagnosis_poa_3) as TEXT ) as diagnosis_poa_3\n\t, cast(coalesce(poa.diagnosis_poa_4, undetermined.diagnosis_poa_4) as TEXT ) as diagnosis_poa_4\n\t, cast(coalesce(poa.diagnosis_poa_5, undetermined.diagnosis_poa_5) as TEXT ) as diagnosis_poa_5\n\t, cast(coalesce(poa.diagnosis_poa_6, undetermined.diagnosis_poa_6) as TEXT ) as diagnosis_poa_6\n\t, cast(coalesce(poa.diagnosis_poa_7, undetermined.diagnosis_poa_7) as TEXT ) as diagnosis_poa_7\n\t, cast(coalesce(poa.diagnosis_poa_8, undetermined.diagnosis_poa_8) as TEXT ) as diagnosis_poa_8\n\t, cast(coalesce(poa.diagnosis_poa_9, undetermined.diagnosis_poa_9) as TEXT ) as diagnosis_poa_9\n\t, cast(coalesce(poa.diagnosis_poa_10, undetermined.diagnosis_poa_10) as TEXT ) as diagnosis_poa_10\n\t, cast(coalesce(poa.diagnosis_poa_11, undetermined.diagnosis_poa_11) as TEXT ) as diagnosis_poa_11\n\t, cast(coalesce(poa.diagnosis_poa_12, undetermined.diagnosis_poa_12) as TEXT ) as diagnosis_poa_12\n\t, cast(coalesce(poa.diagnosis_poa_13, undetermined.diagnosis_poa_13) as TEXT ) as diagnosis_poa_13\n\t, cast(coalesce(poa.diagnosis_poa_14, undetermined.diagnosis_poa_14) as TEXT ) as diagnosis_poa_14\n\t, cast(coalesce(poa.diagnosis_poa_15, undetermined.diagnosis_poa_15) as TEXT ) as diagnosis_poa_15\n\t, cast(coalesce(poa.diagnosis_poa_16, undetermined.diagnosis_poa_16) as TEXT ) as diagnosis_poa_16\n\t, cast(coalesce(poa.diagnosis_poa_17, undetermined.diagnosis_poa_17) as TEXT ) as diagnosis_poa_17\n\t, cast(coalesce(poa.diagnosis_poa_18, undetermined.diagnosis_poa_18) as TEXT ) as diagnosis_poa_18\n\t, cast(coalesce(poa.diagnosis_poa_19, undetermined.diagnosis_poa_19) as TEXT ) as diagnosis_poa_19\n\t, cast(coalesce(poa.diagnosis_poa_20, undetermined.diagnosis_poa_20) as TEXT ) as diagnosis_poa_20\n\t, cast(coalesce(poa.diagnosis_poa_21, undetermined.diagnosis_poa_21) as TEXT ) as diagnosis_poa_21\n\t, cast(coalesce(poa.diagnosis_poa_22, undetermined.diagnosis_poa_22) as TEXT ) as diagnosis_poa_22\n\t, cast(coalesce(poa.diagnosis_poa_23, undetermined.diagnosis_poa_23) as TEXT ) as diagnosis_poa_23\n\t, cast(coalesce(poa.diagnosis_poa_24, undetermined.diagnosis_poa_24) as TEXT ) as diagnosis_poa_24\n\t, cast(coalesce(poa.diagnosis_poa_25, undetermined.diagnosis_poa_25) as TEXT ) as diagnosis_poa_25\n\t, cast(med.procedure_code_type as TEXT ) as procedure_code_type\n\t, cast(coalesce(px_code.procedure_code_1, undetermined.procedure_code_1) as TEXT ) as procedure_code_1\n\t, cast(coalesce(px_code.procedure_code_2, undetermined.procedure_code_2) as TEXT ) as procedure_code_2\n\t, cast(coalesce(px_code.procedure_code_3, undetermined.procedure_code_3) as TEXT ) as procedure_code_3\n\t, cast(coalesce(px_code.procedure_code_4, undetermined.procedure_code_4) as TEXT ) as procedure_code_4\n\t, cast(coalesce(px_code.procedure_code_5, undetermined.procedure_code_5) as TEXT ) as procedure_code_5\n\t, cast(coalesce(px_code.procedure_code_6, undetermined.procedure_code_6) as TEXT ) as procedure_code_6\n\t, cast(coalesce(px_code.procedure_code_7, undetermined.procedure_code_7) as TEXT ) as procedure_code_7\n\t, cast(coalesce(px_code.procedure_code_8, undetermined.procedure_code_8) as TEXT ) as procedure_code_8\n\t, cast(coalesce(px_code.procedure_code_9, undetermined.procedure_code_9) as TEXT ) as procedure_code_9\n\t, cast(coalesce(px_code.procedure_code_10, undetermined.procedure_code_10) as TEXT ) as procedure_code_10\n\t, cast(coalesce(px_code.procedure_code_11, undetermined.procedure_code_11) as TEXT ) as procedure_code_11\n\t, cast(coalesce(px_code.procedure_code_12, undetermined.procedure_code_12) as TEXT ) as procedure_code_12\n\t, cast(coalesce(px_code.procedure_code_13, undetermined.procedure_code_13) as TEXT ) as procedure_code_13\n\t, cast(coalesce(px_code.procedure_code_14, undetermined.procedure_code_14) as TEXT ) as procedure_code_14\n\t, cast(coalesce(px_code.procedure_code_15, undetermined.procedure_code_15) as TEXT ) as procedure_code_15\n\t, cast(coalesce(px_code.procedure_code_16, undetermined.procedure_code_16) as TEXT ) as procedure_code_16\n\t, cast(coalesce(px_code.procedure_code_17, undetermined.procedure_code_17) as TEXT ) as procedure_code_17\n\t, cast(coalesce(px_code.procedure_code_18, undetermined.procedure_code_18) as TEXT ) as procedure_code_18\n\t, cast(coalesce(px_code.procedure_code_19, undetermined.procedure_code_19) as TEXT ) as procedure_code_19\n\t, cast(coalesce(px_code.procedure_code_20, undetermined.procedure_code_20) as TEXT ) as procedure_code_20\n\t, cast(coalesce(px_code.procedure_code_21, undetermined.procedure_code_21) as TEXT ) as procedure_code_21\n\t, cast(coalesce(px_code.procedure_code_22, undetermined.procedure_code_22) as TEXT ) as procedure_code_22\n\t, cast(coalesce(px_code.procedure_code_23, undetermined.procedure_code_23) as TEXT ) as procedure_code_23\n\t, cast(coalesce(px_code.procedure_code_24, undetermined.procedure_code_24) as TEXT ) as procedure_code_24\n\t, cast(coalesce(px_code.procedure_code_25, undetermined.procedure_code_25) as TEXT ) as procedure_code_25\n\t, cast(coalesce(px_date.procedure_date_1, undetermined.procedure_date_1) as date ) as procedure_date_1\n\t, cast(coalesce(px_date.procedure_date_2, undetermined.procedure_date_2) as date ) as procedure_date_2\n\t, cast(coalesce(px_date.procedure_date_3, undetermined.procedure_date_3) as date ) as procedure_date_3\n\t, cast(coalesce(px_date.procedure_date_4, undetermined.procedure_date_4) as date ) as procedure_date_4\n\t, cast(coalesce(px_date.procedure_date_5, undetermined.procedure_date_5) as date ) as procedure_date_5\n\t, cast(coalesce(px_date.procedure_date_6, undetermined.procedure_date_6) as date ) as procedure_date_6\n\t, cast(coalesce(px_date.procedure_date_7, undetermined.procedure_date_7) as date ) as procedure_date_7\n\t, cast(coalesce(px_date.procedure_date_8, undetermined.procedure_date_8) as date ) as procedure_date_8\n\t, cast(coalesce(px_date.procedure_date_9, undetermined.procedure_date_9) as date ) as procedure_date_9\n\t, cast(coalesce(px_date.procedure_date_10, undetermined.procedure_date_10) as date ) as procedure_date_10\n\t, cast(coalesce(px_date.procedure_date_11, undetermined.procedure_date_11) as date ) as procedure_date_11\n\t, cast(coalesce(px_date.procedure_date_12, undetermined.procedure_date_12) as date ) as procedure_date_12\n\t, cast(coalesce(px_date.procedure_date_13, undetermined.procedure_date_13) as date ) as procedure_date_13\n\t, cast(coalesce(px_date.procedure_date_14, undetermined.procedure_date_14) as date ) as procedure_date_14\n\t, cast(coalesce(px_date.procedure_date_15, undetermined.procedure_date_15) as date ) as procedure_date_15\n\t, cast(coalesce(px_date.procedure_date_16, undetermined.procedure_date_16) as date ) as procedure_date_16\n\t, cast(coalesce(px_date.procedure_date_17, undetermined.procedure_date_17) as date ) as procedure_date_17\n\t, cast(coalesce(px_date.procedure_date_18, undetermined.procedure_date_18) as date ) as procedure_date_18\n\t, cast(coalesce(px_date.procedure_date_19, undetermined.procedure_date_19) as date ) as procedure_date_19\n\t, cast(coalesce(px_date.procedure_date_20, undetermined.procedure_date_20) as date ) as procedure_date_20\n\t, cast(coalesce(px_date.procedure_date_21, undetermined.procedure_date_21) as date ) as procedure_date_21\n\t, cast(coalesce(px_date.procedure_date_22, undetermined.procedure_date_22) as date ) as procedure_date_22\n\t, cast(coalesce(px_date.procedure_date_23, undetermined.procedure_date_23) as date ) as procedure_date_23\n\t, cast(coalesce(px_date.procedure_date_24, undetermined.procedure_date_24) as date ) as procedure_date_24\n\t, cast(coalesce(px_date.procedure_date_25, undetermined.procedure_date_25) as date ) as procedure_date_25\n\t, cast(med.data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_final ad_source\n on med.claim_id = ad_source.claim_id\n and med.data_source = ad_source.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_final ad_type\n on med.claim_id = ad_type.claim_id\n and med.data_source = ad_type.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_final apr\n on med.claim_id = apr.claim_id\n and med.data_source = apr.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_final bill\n on med.claim_id = bill.claim_id\n and med.data_source = bill.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize claim_line_dates\n on med.claim_id = claim_line_dates.claim_id\n and med.claim_line_number = claim_line_dates.claim_line_number\n and med.data_source = claim_line_dates.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_date_aggregation dates\n on med.claim_id = dates.claim_id\n and med.data_source = dates.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_medical_npi_normalize med_npi\n on med.claim_id = med_npi.claim_id\n and med.claim_line_number = med_npi.claim_line_number\n and med.data_source = med_npi.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_final disch_disp\n on med.claim_id = disch_disp.claim_id\n and med.data_source = disch_disp.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_final ms\n on med.claim_id = ms.claim_id\n and med.data_source = ms.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_place_of_service_normalize pos\n on med.claim_id = pos.claim_id\n and med.claim_line_number = pos.claim_line_number\n and med.data_source = pos.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_final dx_code\n on med.claim_id = dx_code.claim_id\n and med.data_source = dx_code.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_final poa\n on med.claim_id = poa.claim_id\n and med.data_source = poa.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_final px_code\n on med.claim_id = px_code.claim_id\n and med.data_source = px_code.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_final px_date\n on med.claim_id = px_date.claim_id\n and med.data_source = px_date.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_revenue_center_normalize rev\n on med.claim_id = rev.claim_id\n and med.claim_line_number = rev.claim_line_number\n and med.data_source = rev.data_source\nleft join dev_thuxuan.claims_preprocessing._int_normalized_input_undetermined_claim_type undetermined\n on med.claim_id = undetermined.claim_id\n and med.claim_line_number = undetermined.claim_line_number\n and med.data_source = undetermined.data_source", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__pharmacy_claim": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "final", "normalized_input__pharmacy_claim"], "alias": "normalized_input_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "13c54d60fafd00a820faf57ad03bb7af8d54c4cb4d2be5296dce9c50e24ce695"}, "config": {"enabled": true, "alias": "normalized_input_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "The pharmacy claim table contains information on prescription drugs that \nwere filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "normalized_input_pharmacy_claim", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9101236, "relation_name": "dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(claim_line_number as int ) as claim_line_number\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\r\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\r\n , cast(dispensing_date as date ) as dispensing_date\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(quantity as int ) as quantity\r\n , cast(days_supply as int ) as days_supply\r\n , cast(refills as int ) as refills\r\n , cast(paid_date as date ) as paid_date\r\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_pharmacy_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.normalized_input__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\final\\normalized_input__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_pharmacy_claim as (\n\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim\n)select\n cast(claim_id as TEXT ) as claim_id\n , cast(claim_line_number as int ) as claim_line_number\n , cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(payer as TEXT ) as payer\n , cast(plan as TEXT ) as plan\n , cast(prescribing_provider_npi as TEXT ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as TEXT ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(quantity as int ) as quantity\n , cast(days_supply as int ) as days_supply\n , cast(refills as int ) as refills\n , cast(paid_date as date ) as paid_date\n , cast(paid_amount as numeric(28,6) ) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TEXT ) as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_pharmacy_claim", "sql": " __dbt__cte__normalized_input__stg_pharmacy_claim as (\n\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_source_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_source_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_source_final"], "alias": "_int_normalized_input_admit_source_final", "checksum": {"name": "sha256", "checksum": "2475b1e651f4f5625932a6cc3215210a21b0f627b55cfec1dbc612adcb7e3608"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_source_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_source_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.913124, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_admit_source_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_admit_source_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_admit_source_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_source_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_source_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_source_voting"], "alias": "_int_normalized_input_admit_source_voting", "checksum": {"name": "sha256", "checksum": "5012935391e6295a3d2f9718345960a0e3fb07767fe11dbe8f11f54e9277d838"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_source_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_source_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.916124, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_source_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , admit.admit_source_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__admit_source') }} admit\r\n on med.admit_source_code = admit.admit_source_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , admit_source_code\r\n , count(*) as admit_source_occurrence_count\r\n from normalize\r\n where admit_source_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , admit_source_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'admit_source_code' as column_name\r\n , admit_source_code as normalized_code\r\n , admit_source_occurrence_count as occurrence_count\r\n , coalesce(lead(admit_source_occurrence_count) \r\n over (partition by claim_id, data_source order by admit_source_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by admit_source_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_source_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , admit.admit_source_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.admit_source admit\n on med.admit_source_code = admit.admit_source_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , admit_source_code\n , count(*) as admit_source_occurrence_count\n from normalize\n where admit_source_code is not null\n group by \n claim_id\n , data_source\n , admit_source_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'admit_source_code' as column_name\n , admit_source_code as normalized_code\n , admit_source_occurrence_count as occurrence_count\n , coalesce(lead(admit_source_occurrence_count) \n over (partition by claim_id, data_source order by admit_source_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by admit_source_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_type_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_type_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_type_final"], "alias": "_int_normalized_input_admit_type_final", "checksum": {"name": "sha256", "checksum": "edd86fb649c6c6e0ddf44f6bcf1f59af59fbb1b1e918f85eece29b831e8de407"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_type_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_type_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9206734, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_admit_type_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_admit_type_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_admit_type_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_normalize_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_admit_type_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_admit_type_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_admit_type_voting"], "alias": "_int_normalized_input_admit_type_normalize_voting", "checksum": {"name": "sha256", "checksum": "f26fa7d7618bbaac0dec8ac1f90956683478f4118a6eb2d73428c4f6f88e5963"}, "config": {"enabled": true, "alias": "_int_normalized_input_admit_type_normalize_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_admit_type_normalize_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9236474, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_admit_type_normalize_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , admit.admit_type_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__admit_type') }} admit\r\n on med.admit_type_code = admit.admit_type_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , admit_type_code\r\n , count(*) as admit_type_occurrence_count\r\n from normalize\r\n where admit_type_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , admit_type_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'admit_type_code' as column_name\r\n , admit_type_code as normalized_code\r\n , admit_type_occurrence_count as occurrence_count\r\n , coalesce(lead(admit_type_occurrence_count) \r\n over (partition by claim_id, data_source order by admit_type_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by admit_type_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_admit_type_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , admit.admit_type_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.admit_type admit\n on med.admit_type_code = admit.admit_type_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , admit_type_code\n , count(*) as admit_type_occurrence_count\n from normalize\n where admit_type_code is not null\n group by \n claim_id\n , data_source\n , admit_type_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'admit_type_code' as column_name\n , admit_type_code as normalized_code\n , admit_type_occurrence_count as occurrence_count\n , coalesce(lead(admit_type_occurrence_count) \n over (partition by claim_id, data_source order by admit_type_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by admit_type_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_apr_drg_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_apr_drg_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_apr_drg_final"], "alias": "_int_normalized_input_apr_drg_final", "checksum": {"name": "sha256", "checksum": "a90855fe902608f5c0cf01cb732fb912458f5c16759bcff83a39735658b9ffd8"}, "config": {"enabled": true, "alias": "_int_normalized_input_apr_drg_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_apr_drg_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9266367, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_apr_drg_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_apr_drg_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_apr_drg_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_apr_drg_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_apr_drg_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_apr_drg_voting"], "alias": "_int_normalized_input_apr_drg_voting", "checksum": {"name": "sha256", "checksum": "2df14baa50bbb4051d883fabdbd8a751c600b6e857fe9bb615bc979d36b88f93"}, "config": {"enabled": true, "alias": "_int_normalized_input_apr_drg_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_apr_drg_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9292822, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_apr_drg_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , apr.apr_drg_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__apr_drg') }} apr\r\n on med.apr_drg_code = apr.apr_drg_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , apr_drg_code\r\n , count(*) as apr_drg_occurrence_count\r\n from normalize\r\n where apr_drg_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , apr_drg_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'apr_drg_code' as column_name\r\n , apr_drg_code as normalized_code\r\n , apr_drg_occurrence_count as occurrence_count\r\n , coalesce(lead(apr_drg_occurrence_count) \r\n over (partition by claim_id, data_source order by apr_drg_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by apr_drg_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_apr_drg_voting.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , apr.apr_drg_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.apr_drg apr\n on med.apr_drg_code = apr.apr_drg_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , apr_drg_code\n , count(*) as apr_drg_occurrence_count\n from normalize\n where apr_drg_code is not null\n group by \n claim_id\n , data_source\n , apr_drg_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'apr_drg_code' as column_name\n , apr_drg_code as normalized_code\n , apr_drg_occurrence_count as occurrence_count\n , coalesce(lead(apr_drg_occurrence_count) \n over (partition by claim_id, data_source order by apr_drg_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by apr_drg_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_bill_type_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_bill_type_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_bill_type_final"], "alias": "_int_normalized_input_bill_type_final", "checksum": {"name": "sha256", "checksum": "613755ac1c13b9565f83331aa2e3e1af630fa08df24f17e13e1eaada2429e0b8"}, "config": {"enabled": true, "alias": "_int_normalized_input_bill_type_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_bill_type_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9322932, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_bill_type_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_bill_type_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_bill_type_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_bill_type_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_bill_type_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_bill_type_voting"], "alias": "_int_normalized_input_bill_type_voting", "checksum": {"name": "sha256", "checksum": "82ff0b4320f830aa22cf095830c6b7e0293d8ca774d0278dbb37d4e5159e95e3"}, "config": {"enabled": true, "alias": "_int_normalized_input_bill_type_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_bill_type_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9353278, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_bill_type_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , bill.bill_type_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__bill_type') }} bill\r\n on ltrim(med.bill_type_code,'0') = bill.bill_type_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , bill_type_code\r\n , count(*) as bill_type_occurrence_count\r\n from normalize\r\n where bill_type_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , bill_type_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'bill_type_code' as column_name\r\n , bill_type_code as normalized_code\r\n , bill_type_occurrence_count as occurrence_count\r\n , coalesce(lead(bill_type_occurrence_count) \r\n over (partition by claim_id, data_source order by bill_type_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by bill_type_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_bill_type_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , bill.bill_type_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.bill_type bill\n on ltrim(med.bill_type_code,'0') = bill.bill_type_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , bill_type_code\n , count(*) as bill_type_occurrence_count\n from normalize\n where bill_type_code is not null\n group by \n claim_id\n , data_source\n , bill_type_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_name\n , bill_type_code as normalized_code\n , bill_type_occurrence_count as occurrence_count\n , coalesce(lead(bill_type_occurrence_count) \n over (partition by claim_id, data_source order by bill_type_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by bill_type_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_final"], "alias": "_int_normalized_input_diagnosis_code_final", "checksum": {"name": "sha256", "checksum": "833f3dc13b44d2155cc4bfe573841485e4c4b44a1d6cf6ecf9d0b39f91712fcf"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9393358, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'diagnosis_code_1' then normalized_code else null end) as diagnosis_code_1\r\n , max(case when lower(column_name) = 'diagnosis_code_2' then normalized_code else null end) as diagnosis_code_2\r\n , max(case when lower(column_name) = 'diagnosis_code_3' then normalized_code else null end) as diagnosis_code_3\r\n , max(case when lower(column_name) = 'diagnosis_code_4' then normalized_code else null end) as diagnosis_code_4\r\n , max(case when lower(column_name) = 'diagnosis_code_5' then normalized_code else null end) as diagnosis_code_5\r\n , max(case when lower(column_name) = 'diagnosis_code_6' then normalized_code else null end) as diagnosis_code_6\r\n , max(case when lower(column_name) = 'diagnosis_code_7' then normalized_code else null end) as diagnosis_code_7\r\n , max(case when lower(column_name) = 'diagnosis_code_8' then normalized_code else null end) as diagnosis_code_8\r\n , max(case when lower(column_name) = 'diagnosis_code_9' then normalized_code else null end) as diagnosis_code_9\r\n , max(case when lower(column_name) = 'diagnosis_code_10' then normalized_code else null end) as diagnosis_code_10\r\n , max(case when lower(column_name) = 'diagnosis_code_11' then normalized_code else null end) as diagnosis_code_11\r\n , max(case when lower(column_name) = 'diagnosis_code_12' then normalized_code else null end) as diagnosis_code_12\r\n , max(case when lower(column_name) = 'diagnosis_code_13' then normalized_code else null end) as diagnosis_code_13\r\n , max(case when lower(column_name) = 'diagnosis_code_14' then normalized_code else null end) as diagnosis_code_14\r\n , max(case when lower(column_name) = 'diagnosis_code_15' then normalized_code else null end) as diagnosis_code_15\r\n , max(case when lower(column_name) = 'diagnosis_code_16' then normalized_code else null end) as diagnosis_code_16\r\n , max(case when lower(column_name) = 'diagnosis_code_17' then normalized_code else null end) as diagnosis_code_17\r\n , max(case when lower(column_name) = 'diagnosis_code_18' then normalized_code else null end) as diagnosis_code_18\r\n , max(case when lower(column_name) = 'diagnosis_code_19' then normalized_code else null end) as diagnosis_code_19\r\n , max(case when lower(column_name) = 'diagnosis_code_20' then normalized_code else null end) as diagnosis_code_20\r\n , max(case when lower(column_name) = 'diagnosis_code_21' then normalized_code else null end) as diagnosis_code_21\r\n , max(case when lower(column_name) = 'diagnosis_code_22' then normalized_code else null end) as diagnosis_code_22\r\n , max(case when lower(column_name) = 'diagnosis_code_23' then normalized_code else null end) as diagnosis_code_23\r\n , max(case when lower(column_name) = 'diagnosis_code_24' then normalized_code else null end) as diagnosis_code_24\r\n , max(case when lower(column_name) = 'diagnosis_code_25' then normalized_code else null end) as diagnosis_code_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_diagnosis_code_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_diagnosis_code_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'diagnosis_code_1' then normalized_code else null end) as diagnosis_code_1\n , max(case when lower(column_name) = 'diagnosis_code_2' then normalized_code else null end) as diagnosis_code_2\n , max(case when lower(column_name) = 'diagnosis_code_3' then normalized_code else null end) as diagnosis_code_3\n , max(case when lower(column_name) = 'diagnosis_code_4' then normalized_code else null end) as diagnosis_code_4\n , max(case when lower(column_name) = 'diagnosis_code_5' then normalized_code else null end) as diagnosis_code_5\n , max(case when lower(column_name) = 'diagnosis_code_6' then normalized_code else null end) as diagnosis_code_6\n , max(case when lower(column_name) = 'diagnosis_code_7' then normalized_code else null end) as diagnosis_code_7\n , max(case when lower(column_name) = 'diagnosis_code_8' then normalized_code else null end) as diagnosis_code_8\n , max(case when lower(column_name) = 'diagnosis_code_9' then normalized_code else null end) as diagnosis_code_9\n , max(case when lower(column_name) = 'diagnosis_code_10' then normalized_code else null end) as diagnosis_code_10\n , max(case when lower(column_name) = 'diagnosis_code_11' then normalized_code else null end) as diagnosis_code_11\n , max(case when lower(column_name) = 'diagnosis_code_12' then normalized_code else null end) as diagnosis_code_12\n , max(case when lower(column_name) = 'diagnosis_code_13' then normalized_code else null end) as diagnosis_code_13\n , max(case when lower(column_name) = 'diagnosis_code_14' then normalized_code else null end) as diagnosis_code_14\n , max(case when lower(column_name) = 'diagnosis_code_15' then normalized_code else null end) as diagnosis_code_15\n , max(case when lower(column_name) = 'diagnosis_code_16' then normalized_code else null end) as diagnosis_code_16\n , max(case when lower(column_name) = 'diagnosis_code_17' then normalized_code else null end) as diagnosis_code_17\n , max(case when lower(column_name) = 'diagnosis_code_18' then normalized_code else null end) as diagnosis_code_18\n , max(case when lower(column_name) = 'diagnosis_code_19' then normalized_code else null end) as diagnosis_code_19\n , max(case when lower(column_name) = 'diagnosis_code_20' then normalized_code else null end) as diagnosis_code_20\n , max(case when lower(column_name) = 'diagnosis_code_21' then normalized_code else null end) as diagnosis_code_21\n , max(case when lower(column_name) = 'diagnosis_code_22' then normalized_code else null end) as diagnosis_code_22\n , max(case when lower(column_name) = 'diagnosis_code_23' then normalized_code else null end) as diagnosis_code_23\n , max(case when lower(column_name) = 'diagnosis_code_24' then normalized_code else null end) as diagnosis_code_24\n , max(case when lower(column_name) = 'diagnosis_code_25' then normalized_code else null end) as diagnosis_code_25\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_normalize"], "alias": "_int_normalized_input_diagnosis_code_normalize", "checksum": {"name": "sha256", "checksum": "179014e4821ac7e90ccc56a81480f28b3eaa3e970b84d32dc4c046820f42d2c8"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9423342, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_diagnosis as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_1' as diagnosis_column\r\n , diagnosis_code_1 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_2' as diagnosis_column\r\n , diagnosis_code_2 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_3' as diagnosis_column\r\n , diagnosis_code_3 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_4' as diagnosis_column\r\n , diagnosis_code_4 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_5' as diagnosis_column\r\n , diagnosis_code_5 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_6' as diagnosis_column\r\n , diagnosis_code_6 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_7' as diagnosis_column\r\n , diagnosis_code_7 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_8' as diagnosis_column\r\n , diagnosis_code_8 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_9' as diagnosis_column\r\n , diagnosis_code_9 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_10' as diagnosis_column\r\n , diagnosis_code_10 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_11' as diagnosis_column\r\n , diagnosis_code_11 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_12' as diagnosis_column\r\n , diagnosis_code_12 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_13' as diagnosis_column\r\n , diagnosis_code_13 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_14' as diagnosis_column\r\n , diagnosis_code_14 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_15' as diagnosis_column\r\n , diagnosis_code_15 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_16' as diagnosis_column\r\n , diagnosis_code_16 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_17' as diagnosis_column\r\n , diagnosis_code_17 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_18' as diagnosis_column\r\n , diagnosis_code_18 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_19' as diagnosis_column\r\n , diagnosis_code_19 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_20' as diagnosis_column\r\n , diagnosis_code_20 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_21' as diagnosis_column\r\n , diagnosis_code_21 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_22' as diagnosis_column\r\n , diagnosis_code_22 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_23' as diagnosis_column\r\n , diagnosis_code_24 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_24' as diagnosis_column\r\n , diagnosis_code_24 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , diagnosis_code_type\r\n , 'diagnosis_code_25' as diagnosis_column\r\n , diagnosis_code_25 as diagnosis_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , diagnosis_code_type\r\n , diagnosis_column\r\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm) as normalized_diagnosis_code\r\n , count(*) as diagnosis_code_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_diagnosis piv\r\nleft join {{ ref('terminology__icd_10_cm') }} icd_10\r\n on replace(piv.diagnosis_code,'.','') = icd_10.icd_10_cm\r\n and piv.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm') }} icd_9\r\n on replace(piv.diagnosis_code,'.','') = icd_9.icd_9_cm\r\n and piv.diagnosis_code_type = 'icd-9-cm'\r\nwhere claim_type <> 'undetermined'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , diagnosis_code_type\r\n , diagnosis_column\r\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm)", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_diagnosis as(\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_1' as diagnosis_column\n , diagnosis_code_1 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_2' as diagnosis_column\n , diagnosis_code_2 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_3' as diagnosis_column\n , diagnosis_code_3 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_4' as diagnosis_column\n , diagnosis_code_4 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_5' as diagnosis_column\n , diagnosis_code_5 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_6' as diagnosis_column\n , diagnosis_code_6 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_7' as diagnosis_column\n , diagnosis_code_7 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_8' as diagnosis_column\n , diagnosis_code_8 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_9' as diagnosis_column\n , diagnosis_code_9 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_10' as diagnosis_column\n , diagnosis_code_10 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_11' as diagnosis_column\n , diagnosis_code_11 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_12' as diagnosis_column\n , diagnosis_code_12 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_13' as diagnosis_column\n , diagnosis_code_13 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_14' as diagnosis_column\n , diagnosis_code_14 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_15' as diagnosis_column\n , diagnosis_code_15 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_16' as diagnosis_column\n , diagnosis_code_16 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_17' as diagnosis_column\n , diagnosis_code_17 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_18' as diagnosis_column\n , diagnosis_code_18 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_19' as diagnosis_column\n , diagnosis_code_19 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_20' as diagnosis_column\n , diagnosis_code_20 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_21' as diagnosis_column\n , diagnosis_code_21 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_22' as diagnosis_column\n , diagnosis_code_22 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_23' as diagnosis_column\n , diagnosis_code_24 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_24' as diagnosis_column\n , diagnosis_code_24 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , diagnosis_code_type\n , 'diagnosis_code_25' as diagnosis_column\n , diagnosis_code_25 as diagnosis_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , diagnosis_code_type\n , diagnosis_column\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm) as normalized_diagnosis_code\n , count(*) as diagnosis_code_occurrence_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pivot_diagnosis piv\nleft join dev_thuxuan.terminology.icd_10_cm icd_10\n on replace(piv.diagnosis_code,'.','') = icd_10.icd_10_cm\n and piv.diagnosis_code_type = 'icd-10-cm'\nleft join dev_thuxuan.terminology.icd_9_cm icd_9\n on replace(piv.diagnosis_code,'.','') = icd_9.icd_9_cm\n and piv.diagnosis_code_type = 'icd-9-cm'\nwhere claim_type <> 'undetermined'\ngroup by \n claim_id\n , data_source\n , diagnosis_code_type\n , diagnosis_column\n , coalesce(icd_9.icd_9_cm,icd_10.icd_10_cm)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_diagnosis_code_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_diagnosis_code_voting"], "alias": "_int_normalized_input_diagnosis_code_voting", "checksum": {"name": "sha256", "checksum": "d19ae69e58ccaffcf91a85e79d9dde2e838c628acf597b917be7bf34823bd738"}, "config": {"enabled": true, "alias": "_int_normalized_input_diagnosis_code_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_diagnosis_code_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.945333, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_diagnosis_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.diagnosis_column as column_name\r\n , norm.normalized_diagnosis_code as normalized_code\r\n , norm.diagnosis_code_occurrence_count as occurrence_count\r\n , coalesce(lead(diagnosis_code_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_diagnosis_code_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.diagnosis_column = dist.diagnosis_column", "language": "sql", "refs": [{"name": "normalized_input__int_diagnosis_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_diagnosis_code_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_diagnosis_code_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , diagnosis_column\n , count(*) as distinct_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize\n group by\n claim_id\n , data_source\n , diagnosis_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.diagnosis_column as column_name\n , norm.normalized_diagnosis_code as normalized_code\n , norm.diagnosis_code_occurrence_count as occurrence_count\n , coalesce(lead(diagnosis_code_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by diagnosis_code_occurrence_count desc) as occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_diagnosis_code_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.diagnosis_column = dist.diagnosis_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_discharge_disposition_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_discharge_disposition_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_discharge_disposition_final"], "alias": "_int_normalized_input_discharge_disposition_final", "checksum": {"name": "sha256", "checksum": "99855def1a775dd424f7920e48f0eeb5e5023b8b0a4a3f731d604355b070966b"}, "config": {"enabled": true, "alias": "_int_normalized_input_discharge_disposition_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_discharge_disposition_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9484131, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_discharge_disposition_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_discharge_disposition_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_discharge_disposition_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_discharge_disposition_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_discharge_disposition_voting"], "alias": "_int_normalized_input_discharge_disposition_voting", "checksum": {"name": "sha256", "checksum": "9418dbe038eefb1601fb79feb657bf1634b0094cb81a5d2dc48150f8efccc7a2"}, "config": {"enabled": true, "alias": "_int_normalized_input_discharge_disposition_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_discharge_disposition_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9520495, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_discharge_disposition_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , disch.discharge_disposition_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__discharge_disposition') }} disch\r\n on med.discharge_disposition_code = disch.discharge_disposition_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , discharge_disposition_code\r\n , count(*) as discharge_disposition_occurrence_count\r\n from normalize\r\n where discharge_disposition_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , discharge_disposition_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'discharge_disposition_code' as column_name\r\n , discharge_disposition_code as normalized_code\r\n , discharge_disposition_occurrence_count as occurrence_count\r\n , coalesce(lead(discharge_disposition_occurrence_count) \r\n over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__discharge_disposition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_discharge_disposition_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , disch.discharge_disposition_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.discharge_disposition disch\n on med.discharge_disposition_code = disch.discharge_disposition_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , discharge_disposition_code\n , count(*) as discharge_disposition_occurrence_count\n from normalize\n where discharge_disposition_code is not null\n group by \n claim_id\n , data_source\n , discharge_disposition_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'discharge_disposition_code' as column_name\n , discharge_disposition_code as normalized_code\n , discharge_disposition_occurrence_count as occurrence_count\n , coalesce(lead(discharge_disposition_occurrence_count) \n over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by discharge_disposition_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_eligibility_dates_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_eligibility_dates_normalize"], "alias": "_int_normalized_input_eligibility_dates_normalize", "checksum": {"name": "sha256", "checksum": "c92624d552627264d7ebd960e9acca0ac9fe1dd389d1af326f634e9564bdb67a"}, "config": {"enabled": true, "alias": "_int_normalized_input_eligibility_dates_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_eligibility_dates_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9560578, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_eligibility_dates_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n elig.patient_id\r\n , elig.patient_id||coalesce(elig.data_source,'')||coalesce(elig.payer,'')||coalesce(elig.plan,'')||coalesce(cast(elig.enrollment_start_date as {{ dbt.type_string() }}),'')||coalesce(cast(elig.enrollment_end_date as {{ dbt.type_string() }}),'') as patient_id_key\r\n , cal_dob.full_date as normalized_birth_date\r\n , cal_death.full_date as normalized_death_date\r\n , cal_enroll_start.full_date as normalized_enrollment_start_date\r\n , cal_enroll_end.full_date as normalized_enrollment_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_eligibility') }} elig\r\nleft join {{ ref('terminology__calendar') }} cal_dob\r\n on elig.birth_date = cal_dob.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_death\r\n on elig.death_date = cal_death.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_enroll_start\r\n on elig.enrollment_start_date = cal_enroll_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_enroll_end\r\n on elig.enrollment_end_date = cal_enroll_end.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_eligibility", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__stg_eligibility", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_eligibility_dates_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)select distinct\n elig.patient_id\n , elig.patient_id||coalesce(elig.data_source,'')||coalesce(elig.payer,'')||coalesce(elig.plan,'')||coalesce(cast(elig.enrollment_start_date as TEXT),'')||coalesce(cast(elig.enrollment_end_date as TEXT),'') as patient_id_key\n , cal_dob.full_date as normalized_birth_date\n , cal_death.full_date as normalized_death_date\n , cal_enroll_start.full_date as normalized_enrollment_start_date\n , cal_enroll_end.full_date as normalized_enrollment_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_eligibility elig\nleft join dev_thuxuan.terminology.calendar cal_dob\n on elig.birth_date = cal_dob.full_date\nleft join dev_thuxuan.terminology.calendar cal_death\n on elig.death_date = cal_death.full_date\nleft join dev_thuxuan.terminology.calendar cal_enroll_start\n on elig.enrollment_start_date = cal_enroll_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_enroll_end\n on elig.enrollment_end_date = cal_enroll_end.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_eligibility", "sql": " __dbt__cte__normalized_input__stg_eligibility as (\n\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_claim_date_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_claim_date_normalize"], "alias": "_int_normalized_input_medical_claim_date_normalize", "checksum": {"name": "sha256", "checksum": "292c6f782f96f5a0ced02279e441286ffca95714ad1794062bd147095c29d56a"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_claim_date_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_claim_date_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9591331, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n med.claim_id\r\n , med.claim_line_number\r\n , med.claim_type\r\n , med.data_source\r\n , cal_claim_start.full_date as normalized_claim_start_date\r\n , cal_claim_end.full_date as normalized_claim_end_date\r\n , cal_claim_line_start.full_date as normalized_claim_line_start_date\r\n , cal_claim_line_end.full_date as normalized_claim_line_end_date\r\n , cal_admission.full_date as normalized_admission_date\r\n , cal_discharge.full_date as normalized_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__calendar') }} cal_claim_start\r\n on med.claim_start_date = cal_claim_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_end\r\n on med.claim_end_Date = cal_claim_end.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_line_start\r\n on med.claim_line_start_date = cal_claim_line_start.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_claim_line_end\r\n on med.claim_line_end_date = cal_claim_line_end.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_admission\r\n on med.admission_date = cal_admission.full_date\r\nleft join {{ ref('terminology__calendar') }} cal_discharge\r\n on med.discharge_date = cal_discharge.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_claim_date_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select distinct\n med.claim_id\n , med.claim_line_number\n , med.claim_type\n , med.data_source\n , cal_claim_start.full_date as normalized_claim_start_date\n , cal_claim_end.full_date as normalized_claim_end_date\n , cal_claim_line_start.full_date as normalized_claim_line_start_date\n , cal_claim_line_end.full_date as normalized_claim_line_end_date\n , cal_admission.full_date as normalized_admission_date\n , cal_discharge.full_date as normalized_discharge_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.calendar cal_claim_start\n on med.claim_start_date = cal_claim_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_end\n on med.claim_end_Date = cal_claim_end.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_line_start\n on med.claim_line_start_date = cal_claim_line_start.full_date\nleft join dev_thuxuan.terminology.calendar cal_claim_line_end\n on med.claim_line_end_date = cal_claim_line_end.full_date\nleft join dev_thuxuan.terminology.calendar cal_admission\n on med.admission_date = cal_admission.full_date\nleft join dev_thuxuan.terminology.calendar cal_discharge\n on med.discharge_date = cal_discharge.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_date_aggregation": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_date_aggregation", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_date_aggregation"], "alias": "_int_normalized_input_medical_date_aggregation", "checksum": {"name": "sha256", "checksum": "5596dbf9586a54cac39aaf04d1f8e561dae60f0be82b9e6c0b069182267831f0"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_date_aggregation", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_date_aggregation", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9621763, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_date_aggregation", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , min(normalized_claim_start_date) as minimum_claim_start_date\r\n , max(normalized_claim_end_date) as maximum_claim_end_date\r\n , min(normalized_admission_date) as minimum_admission_date\r\n , max(normalized_discharge_date) as maximum_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_medical_claim_date_normalize') }}\r\nwhere claim_type = 'institutional'\r\ngroup by\r\n claim_id\r\n , data_source\r\n\r\nunion all\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , min(normalized_claim_start_date) as minimum_claim_start_date\r\n , max(normalized_claim_end_date) as maximum_claim_end_date\r\n , null as minimum_admission_date\r\n , null as maximum_discharge_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_medical_claim_date_normalize') }}\r\nwhere claim_type = 'professional'\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}, {"name": "normalized_input__int_medical_claim_date_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_date_aggregation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , min(normalized_claim_start_date) as minimum_claim_start_date\n , max(normalized_claim_end_date) as maximum_claim_end_date\n , min(normalized_admission_date) as minimum_admission_date\n , max(normalized_discharge_date) as maximum_discharge_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize\nwhere claim_type = 'institutional'\ngroup by\n claim_id\n , data_source\n\nunion all\n\nselect\n claim_id\n , data_source\n , min(normalized_claim_start_date) as minimum_claim_start_date\n , max(normalized_claim_end_date) as maximum_claim_end_date\n , null as minimum_admission_date\n , null as maximum_discharge_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_medical_claim_date_normalize\nwhere claim_type = 'professional'\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_medical_npi_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_medical_npi_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_medical_npi_normalize"], "alias": "_int_normalized_input_medical_npi_normalize", "checksum": {"name": "sha256", "checksum": "51301b9b002b2cfa625a083b03b6d10cfc9168091672ef20c7fce2daa7085af3"}, "config": {"enabled": true, "alias": "_int_normalized_input_medical_npi_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_medical_npi_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9651637, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_medical_npi_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n med.claim_id\r\n , med.claim_line_number\r\n , med.claim_type\r\n , med.data_source\r\n , rend_prov.npi as normalized_rendering_npi\r\n , bill_prov.npi as normalized_billing_npi\r\n , fac_prov.npi as normalized_facility_npi\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__provider') }} rend_prov\r\n on med.rendering_npi = rend_prov.npi\r\n and rend_prov.entity_type_description = 'Individual'\r\nleft join {{ ref('terminology__provider') }} bill_prov\r\n on med.billing_npi = bill_prov.npi\r\nleft join {{ ref('terminology__provider') }} fac_prov\r\n on med.facility_npi = fac_prov.npi\r\n and fac_prov.entity_type_description = 'Organization'\r\n and med.claim_type = 'institutional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_medical_npi_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select distinct\n med.claim_id\n , med.claim_line_number\n , med.claim_type\n , med.data_source\n , rend_prov.npi as normalized_rendering_npi\n , bill_prov.npi as normalized_billing_npi\n , fac_prov.npi as normalized_facility_npi\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.provider rend_prov\n on med.rendering_npi = rend_prov.npi\n and rend_prov.entity_type_description = 'Individual'\nleft join dev_thuxuan.terminology.provider bill_prov\n on med.billing_npi = bill_prov.npi\nleft join dev_thuxuan.terminology.provider fac_prov\n on med.facility_npi = fac_prov.npi\n and fac_prov.entity_type_description = 'Organization'\n and med.claim_type = 'institutional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_ms_drg_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_ms_drg_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_ms_drg_final"], "alias": "_int_normalized_input_ms_drg_final", "checksum": {"name": "sha256", "checksum": "61a83f81464eda87788caee16eca359b72d450e0b8ff68b8313fc695b27d1048"}, "config": {"enabled": true, "alias": "_int_normalized_input_ms_drg_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_ms_drg_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.969626, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_ms_drg_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)", "language": "sql", "refs": [{"name": "normalized_input__int_ms_drg_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_ms_drg_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_final.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_ms_drg_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_ms_drg_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_ms_drg_voting"], "alias": "_int_normalized_input_ms_drg_voting", "checksum": {"name": "sha256", "checksum": "5bb09e3b17ef640dac97c8b1ffd92249b7cb2b40df4495cd3a5a2fbdaf72f2d0"}, "config": {"enabled": true, "alias": "_int_normalized_input_ms_drg_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_ms_drg_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.973631, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_ms_drg_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith normalize as(\r\n select \r\n med.claim_id\r\n , med.data_source\r\n , ms.ms_drg_code\r\n from {{ ref('normalized_input__stg_medical_claim') }} med\r\n inner join {{ ref('terminology__ms_drg') }} ms\r\n on med.ms_drg_code = ms.ms_drg_code\r\n where claim_type = 'institutional'\r\n)\r\n, distinct_counts as(\r\n select \r\n claim_id\r\n , data_source\r\n , ms_drg_code\r\n , count(*) as ms_drg_occurrence_count\r\n from normalize\r\n where ms_drg_code is not null\r\n group by \r\n claim_id\r\n , data_source\r\n , ms_drg_code\r\n)\r\n\r\n, occurence_comparison as(\r\n select\r\n claim_id\r\n , data_source\r\n , 'ms_drg_code' as column_name\r\n , ms_drg_code as normalized_code\r\n , ms_drg_occurrence_count as occurrence_count\r\n , coalesce(lead(ms_drg_occurrence_count) \r\n over (partition by claim_id, data_source order by ms_drg_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by claim_id, data_source order by ms_drg_occurrence_count desc) as occurrence_row_count\r\n from distinct_counts dist\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , column_name\r\n , normalized_code\r\n , occurrence_count\r\n , next_occurrence_count\r\n , occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom occurence_comparison", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_ms_drg_voting.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),normalize as(\n select \n med.claim_id\n , med.data_source\n , ms.ms_drg_code\n from __dbt__cte__normalized_input__stg_medical_claim med\n inner join dev_thuxuan.terminology.ms_drg ms\n on med.ms_drg_code = ms.ms_drg_code\n where claim_type = 'institutional'\n)\n, distinct_counts as(\n select \n claim_id\n , data_source\n , ms_drg_code\n , count(*) as ms_drg_occurrence_count\n from normalize\n where ms_drg_code is not null\n group by \n claim_id\n , data_source\n , ms_drg_code\n)\n\n, occurence_comparison as(\n select\n claim_id\n , data_source\n , 'ms_drg_code' as column_name\n , ms_drg_code as normalized_code\n , ms_drg_occurrence_count as occurrence_count\n , coalesce(lead(ms_drg_occurrence_count) \n over (partition by claim_id, data_source order by ms_drg_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by claim_id, data_source order by ms_drg_occurrence_count desc) as occurrence_row_count\n from distinct_counts dist\n)\n\nselect\n claim_id\n , data_source\n , column_name\n , normalized_code\n , occurrence_count\n , next_occurrence_count\n , occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom occurence_comparison", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_place_of_service_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_place_of_service_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_place_of_service_normalize"], "alias": "_int_normalized_input_place_of_service_normalize", "checksum": {"name": "sha256", "checksum": "512e6ee5ec6f421460061e6639bfa12903c77eaeaa6e4e9617ffbc28ab0287c4"}, "config": {"enabled": true, "alias": "_int_normalized_input_place_of_service_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_place_of_service_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9766307, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_place_of_service_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , pos.place_of_service_code as normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__place_of_service') }} pos\r\n on lpad(med.place_of_service_code, 2, '0') = pos.place_of_service_code\r\nwhere claim_type = 'professional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_place_of_service_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , data_source\n , pos.place_of_service_code as normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.place_of_service pos\n on lpad(med.place_of_service_code, 2, '0') = pos.place_of_service_code\nwhere claim_type = 'professional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_final"], "alias": "_int_normalized_input_present_on_admit_final", "checksum": {"name": "sha256", "checksum": "ffd6b269b3f66e12d285c19dd8ef53c79e00a531b6bff27fd7dead01dd0852fb"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9796307, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when column_name = 'DIAGNOSIS_POA_1' then normalized_code else null end) as diagnosis_poa_1\r\n , max(case when column_name = 'DIAGNOSIS_POA_2' then normalized_code else null end) as diagnosis_poa_2\r\n , max(case when column_name = 'DIAGNOSIS_POA_3' then normalized_code else null end) as diagnosis_poa_3\r\n , max(case when column_name = 'DIAGNOSIS_POA_4' then normalized_code else null end) as diagnosis_poa_4\r\n , max(case when column_name = 'DIAGNOSIS_POA_5' then normalized_code else null end) as diagnosis_poa_5\r\n , max(case when column_name = 'DIAGNOSIS_POA_6' then normalized_code else null end) as diagnosis_poa_6\r\n , max(case when column_name = 'DIAGNOSIS_POA_7' then normalized_code else null end) as diagnosis_poa_7\r\n , max(case when column_name = 'DIAGNOSIS_POA_8' then normalized_code else null end) as diagnosis_poa_8\r\n , max(case when column_name = 'DIAGNOSIS_POA_9' then normalized_code else null end) as diagnosis_poa_9\r\n , max(case when column_name = 'DIAGNOSIS_POA_10' then normalized_code else null end) as diagnosis_poa_10\r\n , max(case when column_name = 'DIAGNOSIS_POA_11' then normalized_code else null end) as diagnosis_poa_11\r\n , max(case when column_name = 'DIAGNOSIS_POA_12' then normalized_code else null end) as diagnosis_poa_12\r\n , max(case when column_name = 'DIAGNOSIS_POA_13' then normalized_code else null end) as diagnosis_poa_13\r\n , max(case when column_name = 'DIAGNOSIS_POA_14' then normalized_code else null end) as diagnosis_poa_14\r\n , max(case when column_name = 'DIAGNOSIS_POA_15' then normalized_code else null end) as diagnosis_poa_15\r\n , max(case when column_name = 'DIAGNOSIS_POA_16' then normalized_code else null end) as diagnosis_poa_16\r\n , max(case when column_name = 'DIAGNOSIS_POA_17' then normalized_code else null end) as diagnosis_poa_17\r\n , max(case when column_name = 'DIAGNOSIS_POA_18' then normalized_code else null end) as diagnosis_poa_18\r\n , max(case when column_name = 'DIAGNOSIS_POA_19' then normalized_code else null end) as diagnosis_poa_19\r\n , max(case when column_name = 'DIAGNOSIS_POA_20' then normalized_code else null end) as diagnosis_poa_20\r\n , max(case when column_name = 'DIAGNOSIS_POA_21' then normalized_code else null end) as diagnosis_poa_21\r\n , max(case when column_name = 'DIAGNOSIS_POA_22' then normalized_code else null end) as diagnosis_poa_22\r\n , max(case when column_name = 'DIAGNOSIS_POA_23' then normalized_code else null end) as diagnosis_poa_23\r\n , max(case when column_name = 'DIAGNOSIS_POA_24' then normalized_code else null end) as diagnosis_poa_24\r\n , max(case when column_name = 'DIAGNOSIS_POA_25' then normalized_code else null end) as diagnosis_poa_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_present_on_admit_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_present_on_admit_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when column_name = 'DIAGNOSIS_POA_1' then normalized_code else null end) as diagnosis_poa_1\n , max(case when column_name = 'DIAGNOSIS_POA_2' then normalized_code else null end) as diagnosis_poa_2\n , max(case when column_name = 'DIAGNOSIS_POA_3' then normalized_code else null end) as diagnosis_poa_3\n , max(case when column_name = 'DIAGNOSIS_POA_4' then normalized_code else null end) as diagnosis_poa_4\n , max(case when column_name = 'DIAGNOSIS_POA_5' then normalized_code else null end) as diagnosis_poa_5\n , max(case when column_name = 'DIAGNOSIS_POA_6' then normalized_code else null end) as diagnosis_poa_6\n , max(case when column_name = 'DIAGNOSIS_POA_7' then normalized_code else null end) as diagnosis_poa_7\n , max(case when column_name = 'DIAGNOSIS_POA_8' then normalized_code else null end) as diagnosis_poa_8\n , max(case when column_name = 'DIAGNOSIS_POA_9' then normalized_code else null end) as diagnosis_poa_9\n , max(case when column_name = 'DIAGNOSIS_POA_10' then normalized_code else null end) as diagnosis_poa_10\n , max(case when column_name = 'DIAGNOSIS_POA_11' then normalized_code else null end) as diagnosis_poa_11\n , max(case when column_name = 'DIAGNOSIS_POA_12' then normalized_code else null end) as diagnosis_poa_12\n , max(case when column_name = 'DIAGNOSIS_POA_13' then normalized_code else null end) as diagnosis_poa_13\n , max(case when column_name = 'DIAGNOSIS_POA_14' then normalized_code else null end) as diagnosis_poa_14\n , max(case when column_name = 'DIAGNOSIS_POA_15' then normalized_code else null end) as diagnosis_poa_15\n , max(case when column_name = 'DIAGNOSIS_POA_16' then normalized_code else null end) as diagnosis_poa_16\n , max(case when column_name = 'DIAGNOSIS_POA_17' then normalized_code else null end) as diagnosis_poa_17\n , max(case when column_name = 'DIAGNOSIS_POA_18' then normalized_code else null end) as diagnosis_poa_18\n , max(case when column_name = 'DIAGNOSIS_POA_19' then normalized_code else null end) as diagnosis_poa_19\n , max(case when column_name = 'DIAGNOSIS_POA_20' then normalized_code else null end) as diagnosis_poa_20\n , max(case when column_name = 'DIAGNOSIS_POA_21' then normalized_code else null end) as diagnosis_poa_21\n , max(case when column_name = 'DIAGNOSIS_POA_22' then normalized_code else null end) as diagnosis_poa_22\n , max(case when column_name = 'DIAGNOSIS_POA_23' then normalized_code else null end) as diagnosis_poa_23\n , max(case when column_name = 'DIAGNOSIS_POA_24' then normalized_code else null end) as diagnosis_poa_24\n , max(case when column_name = 'DIAGNOSIS_POA_25' then normalized_code else null end) as diagnosis_poa_25\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_normalize"], "alias": "_int_normalized_input_present_on_admit_normalize", "checksum": {"name": "sha256", "checksum": "bddfc433eda6677655f5ce0809136b91f5451863ff74e71b69b55e02f7321643"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.982631, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_poa as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_1' as diagnosis_column\r\n , diagnosis_poa_1 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_2' as diagnosis_column\r\n , diagnosis_poa_2 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_3' as diagnosis_column\r\n , diagnosis_poa_3 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_4' as diagnosis_column\r\n , diagnosis_poa_4 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_5' as diagnosis_column\r\n , diagnosis_poa_5 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_6' as diagnosis_column\r\n , diagnosis_poa_6 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_7' as diagnosis_column\r\n , diagnosis_poa_7 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_8' as diagnosis_column\r\n , diagnosis_poa_8 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_9' as diagnosis_column\r\n , diagnosis_poa_9 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_10' as diagnosis_column\r\n , diagnosis_poa_10 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_11' as diagnosis_column\r\n , diagnosis_poa_11 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_12' as diagnosis_column\r\n , diagnosis_poa_12 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_13' as diagnosis_column\r\n , diagnosis_poa_13 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_14' as diagnosis_column\r\n , diagnosis_poa_14 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_15' as diagnosis_column\r\n , diagnosis_poa_15 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_16' as diagnosis_column\r\n , diagnosis_poa_16 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_17' as diagnosis_column\r\n , diagnosis_poa_17 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_18' as diagnosis_column\r\n , diagnosis_poa_18 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_19' as diagnosis_column\r\n , diagnosis_poa_19 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_20' as diagnosis_column\r\n , diagnosis_poa_20 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_21' as diagnosis_column\r\n , diagnosis_poa_21 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_22' as diagnosis_column\r\n , diagnosis_poa_22 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_23' as diagnosis_column\r\n , diagnosis_poa_24 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_24' as diagnosis_column\r\n , diagnosis_poa_24 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'diagnosis_poa_25' as diagnosis_column\r\n , diagnosis_poa_25 as present_on_admit_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , poa.present_on_admit_code as normalized_present_on_admit_code\r\n , count(*) as present_on_admit_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_poa piv\r\nleft join {{ ref('terminology__present_on_admission') }} poa\r\n on replace(piv.present_on_admit_code,'.','') = poa.present_on_admit_code\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , poa.present_on_admit_code", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__present_on_admission"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_poa as(\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_1' as diagnosis_column\n , diagnosis_poa_1 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_2' as diagnosis_column\n , diagnosis_poa_2 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_3' as diagnosis_column\n , diagnosis_poa_3 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_4' as diagnosis_column\n , diagnosis_poa_4 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_5' as diagnosis_column\n , diagnosis_poa_5 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_6' as diagnosis_column\n , diagnosis_poa_6 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_7' as diagnosis_column\n , diagnosis_poa_7 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_8' as diagnosis_column\n , diagnosis_poa_8 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_9' as diagnosis_column\n , diagnosis_poa_9 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_10' as diagnosis_column\n , diagnosis_poa_10 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_11' as diagnosis_column\n , diagnosis_poa_11 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_12' as diagnosis_column\n , diagnosis_poa_12 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_13' as diagnosis_column\n , diagnosis_poa_13 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_14' as diagnosis_column\n , diagnosis_poa_14 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_15' as diagnosis_column\n , diagnosis_poa_15 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_16' as diagnosis_column\n , diagnosis_poa_16 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_17' as diagnosis_column\n , diagnosis_poa_17 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_18' as diagnosis_column\n , diagnosis_poa_18 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_19' as diagnosis_column\n , diagnosis_poa_19 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_20' as diagnosis_column\n , diagnosis_poa_20 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_21' as diagnosis_column\n , diagnosis_poa_21 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_22' as diagnosis_column\n , diagnosis_poa_22 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_23' as diagnosis_column\n , diagnosis_poa_24 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_24' as diagnosis_column\n , diagnosis_poa_24 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'diagnosis_poa_25' as diagnosis_column\n , diagnosis_poa_25 as present_on_admit_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , diagnosis_column\n , poa.present_on_admit_code as normalized_present_on_admit_code\n , count(*) as present_on_admit_occurrence_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pivot_poa piv\nleft join dev_thuxuan.terminology.present_on_admission poa\n on replace(piv.present_on_admit_code,'.','') = poa.present_on_admit_code\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , diagnosis_column\n , poa.present_on_admit_code", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_present_on_admit_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_present_on_admit_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_present_on_admit_voting"], "alias": "_int_normalized_input_present_on_admit_voting", "checksum": {"name": "sha256", "checksum": "eb0123290dd8ea0f0222f45ce161e6163f5db9b1bedb124f334a8419b2fa9e9a"}, "config": {"enabled": true, "alias": "_int_normalized_input_present_on_admit_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_present_on_admit_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9863963, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_present_on_admit_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , diagnosis_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.diagnosis_column as column_name\r\n , norm.normalized_present_on_admit_code as normalized_code\r\n , norm.present_on_admit_occurrence_count as occurrence_count\r\n , coalesce(lead(present_on_admit_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_present_on_admit_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.diagnosis_column = dist.diagnosis_column", "language": "sql", "refs": [{"name": "normalized_input__int_present_on_admit_normalize", "package": null, "version": null}, {"name": "normalized_input__int_present_on_admit_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_present_on_admit_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , diagnosis_column\n , count(*) as distinct_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize\n group by\n claim_id\n , data_source\n , diagnosis_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.diagnosis_column as column_name\n , norm.normalized_present_on_admit_code as normalized_code\n , norm.present_on_admit_occurrence_count as occurrence_count\n , coalesce(lead(present_on_admit_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.diagnosis_column order by present_on_admit_occurrence_count desc) as occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_present_on_admit_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.diagnosis_column = dist.diagnosis_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_final"], "alias": "_int_normalized_input_procedure_code_final", "checksum": {"name": "sha256", "checksum": "24f85b787305661b747fa11eddb504b1161fa9f48eb6f4360b8843962308f713"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9893248, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'procedure_code_1' then normalized_code else null end) as procedure_code_1\r\n , max(case when lower(column_name) = 'procedure_code_2' then normalized_code else null end) as procedure_code_2\r\n , max(case when lower(column_name) = 'procedure_code_3' then normalized_code else null end) as procedure_code_3\r\n , max(case when lower(column_name) = 'procedure_code_4' then normalized_code else null end) as procedure_code_4\r\n , max(case when lower(column_name) = 'procedure_code_5' then normalized_code else null end) as procedure_code_5\r\n , max(case when lower(column_name) = 'procedure_code_6' then normalized_code else null end) as procedure_code_6\r\n , max(case when lower(column_name) = 'procedure_code_7' then normalized_code else null end) as procedure_code_7\r\n , max(case when lower(column_name) = 'procedure_code_8' then normalized_code else null end) as procedure_code_8\r\n , max(case when lower(column_name) = 'procedure_code_9' then normalized_code else null end) as procedure_code_9\r\n , max(case when lower(column_name) = 'procedure_code_10' then normalized_code else null end) as procedure_code_10\r\n , max(case when lower(column_name) = 'procedure_code_11' then normalized_code else null end) as procedure_code_11\r\n , max(case when lower(column_name) = 'procedure_code_12' then normalized_code else null end) as procedure_code_12\r\n , max(case when lower(column_name) = 'procedure_code_13' then normalized_code else null end) as procedure_code_13\r\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_14\r\n , max(case when lower(column_name) = 'procedure_code_15' then normalized_code else null end) as procedure_code_15\r\n , max(case when lower(column_name) = 'procedure_code_16' then normalized_code else null end) as procedure_code_16\r\n , max(case when lower(column_name) = 'procedure_code_17' then normalized_code else null end) as procedure_code_17\r\n , max(case when lower(column_name) = 'procedure_code_18' then normalized_code else null end) as procedure_code_18\r\n , max(case when lower(column_name) = 'procedure_code_19' then normalized_code else null end) as procedure_code_19\r\n , max(case when lower(column_name) = 'procedure_code_20' then normalized_code else null end) as procedure_code_20\r\n , max(case when lower(column_name) = 'procedure_code_21' then normalized_code else null end) as procedure_code_21\r\n , max(case when lower(column_name) = 'procedure_code_22' then normalized_code else null end) as procedure_code_22\r\n , max(case when lower(column_name) = 'procedure_code_23' then normalized_code else null end) as procedure_code_23\r\n , max(case when lower(column_name) = 'procedure_code_24' then normalized_code else null end) as procedure_code_24\r\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_code_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'procedure_code_1' then normalized_code else null end) as procedure_code_1\n , max(case when lower(column_name) = 'procedure_code_2' then normalized_code else null end) as procedure_code_2\n , max(case when lower(column_name) = 'procedure_code_3' then normalized_code else null end) as procedure_code_3\n , max(case when lower(column_name) = 'procedure_code_4' then normalized_code else null end) as procedure_code_4\n , max(case when lower(column_name) = 'procedure_code_5' then normalized_code else null end) as procedure_code_5\n , max(case when lower(column_name) = 'procedure_code_6' then normalized_code else null end) as procedure_code_6\n , max(case when lower(column_name) = 'procedure_code_7' then normalized_code else null end) as procedure_code_7\n , max(case when lower(column_name) = 'procedure_code_8' then normalized_code else null end) as procedure_code_8\n , max(case when lower(column_name) = 'procedure_code_9' then normalized_code else null end) as procedure_code_9\n , max(case when lower(column_name) = 'procedure_code_10' then normalized_code else null end) as procedure_code_10\n , max(case when lower(column_name) = 'procedure_code_11' then normalized_code else null end) as procedure_code_11\n , max(case when lower(column_name) = 'procedure_code_12' then normalized_code else null end) as procedure_code_12\n , max(case when lower(column_name) = 'procedure_code_13' then normalized_code else null end) as procedure_code_13\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_14\n , max(case when lower(column_name) = 'procedure_code_15' then normalized_code else null end) as procedure_code_15\n , max(case when lower(column_name) = 'procedure_code_16' then normalized_code else null end) as procedure_code_16\n , max(case when lower(column_name) = 'procedure_code_17' then normalized_code else null end) as procedure_code_17\n , max(case when lower(column_name) = 'procedure_code_18' then normalized_code else null end) as procedure_code_18\n , max(case when lower(column_name) = 'procedure_code_19' then normalized_code else null end) as procedure_code_19\n , max(case when lower(column_name) = 'procedure_code_20' then normalized_code else null end) as procedure_code_20\n , max(case when lower(column_name) = 'procedure_code_21' then normalized_code else null end) as procedure_code_21\n , max(case when lower(column_name) = 'procedure_code_22' then normalized_code else null end) as procedure_code_22\n , max(case when lower(column_name) = 'procedure_code_23' then normalized_code else null end) as procedure_code_23\n , max(case when lower(column_name) = 'procedure_code_24' then normalized_code else null end) as procedure_code_24\n , max(case when lower(column_name) = 'procedure_code_14' then normalized_code else null end) as procedure_code_25\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_normalize"], "alias": "_int_normalized_input_procedure_code_normalize", "checksum": {"name": "sha256", "checksum": "aee921d2a050a6d48f127551e1ab2743965d58caa67f7b67ec1e7fa00731fc27"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9923568, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_procedure as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_1' as procedure_column\r\n , procedure_code_1 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_2' as procedure_column\r\n , procedure_code_2 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_3' as procedure_column\r\n , procedure_code_3 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_4' as procedure_column\r\n , procedure_code_4 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_5' as procedure_column\r\n , procedure_code_5 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_6' as procedure_column\r\n , procedure_code_6 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_7' as procedure_column\r\n , procedure_code_7 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_8' as procedure_column\r\n , procedure_code_8 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_9' as procedure_column\r\n , procedure_code_9 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_10' as procedure_column\r\n , procedure_code_10 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_11' as procedure_column\r\n , procedure_code_11 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_12' as procedure_column\r\n , procedure_code_12 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_13' as procedure_column\r\n , procedure_code_13 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_14' as procedure_column\r\n , procedure_code_14 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_15' as procedure_column\r\n , procedure_code_15 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_16' as procedure_column\r\n , procedure_code_16 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_17' as procedure_column\r\n , procedure_code_17 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_18' as procedure_column\r\n , procedure_code_18 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_19' as procedure_column\r\n , procedure_code_19 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_20' as procedure_column\r\n , procedure_code_20 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_21' as procedure_column\r\n , procedure_code_21 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_22' as procedure_column\r\n , procedure_code_22 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_23' as procedure_column\r\n , procedure_code_24 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_24' as procedure_column\r\n , procedure_code_24 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , procedure_code_type\r\n , 'procedure_code_25' as procedure_column\r\n , procedure_code_25 as procedure_code\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , procedure_code_type\r\n , procedure_column\r\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs) as normalized_procedure_code\r\n , count(*) as procedure_code_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_procedure piv\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd_10\r\n on replace(piv.procedure_code,'.','') = icd_10.icd_10_pcs\r\n and piv.procedure_code_type = 'icd-10-pcs'\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd_9\r\n on replace(piv.procedure_code,'.','') = icd_9.icd_9_pcs\r\n and piv.procedure_code_type = 'icd-9-pcs'\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , procedure_code_type\r\n , procedure_column\r\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs)", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__icd_9_pcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_procedure as(\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_1' as procedure_column\n , procedure_code_1 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_2' as procedure_column\n , procedure_code_2 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_3' as procedure_column\n , procedure_code_3 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_4' as procedure_column\n , procedure_code_4 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_5' as procedure_column\n , procedure_code_5 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_6' as procedure_column\n , procedure_code_6 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_7' as procedure_column\n , procedure_code_7 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_8' as procedure_column\n , procedure_code_8 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_9' as procedure_column\n , procedure_code_9 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_10' as procedure_column\n , procedure_code_10 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_11' as procedure_column\n , procedure_code_11 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_12' as procedure_column\n , procedure_code_12 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_13' as procedure_column\n , procedure_code_13 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_14' as procedure_column\n , procedure_code_14 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_15' as procedure_column\n , procedure_code_15 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_16' as procedure_column\n , procedure_code_16 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_17' as procedure_column\n , procedure_code_17 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_18' as procedure_column\n , procedure_code_18 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_19' as procedure_column\n , procedure_code_19 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_20' as procedure_column\n , procedure_code_20 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_21' as procedure_column\n , procedure_code_21 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_22' as procedure_column\n , procedure_code_22 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_23' as procedure_column\n , procedure_code_24 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_24' as procedure_column\n , procedure_code_24 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , procedure_code_type\n , 'procedure_code_25' as procedure_column\n , procedure_code_25 as procedure_code\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , procedure_code_type\n , procedure_column\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs) as normalized_procedure_code\n , count(*) as procedure_code_occurrence_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pivot_procedure piv\nleft join dev_thuxuan.terminology.icd_10_pcs icd_10\n on replace(piv.procedure_code,'.','') = icd_10.icd_10_pcs\n and piv.procedure_code_type = 'icd-10-pcs'\nleft join dev_thuxuan.terminology.icd_9_pcs icd_9\n on replace(piv.procedure_code,'.','') = icd_9.icd_9_pcs\n and piv.procedure_code_type = 'icd-9-pcs'\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , procedure_code_type\n , procedure_column\n , coalesce(icd_9.icd_9_pcs,icd_10.icd_10_pcs)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_code_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_code_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_code_voting"], "alias": "_int_normalized_input_procedure_code_voting", "checksum": {"name": "sha256", "checksum": "bece822a93f1ddeb86cf9da2b160d157ccaae782c9f481d29e2f8725bfff79ef"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_code_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_code_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.995421, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_procedure_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.procedure_column as column_name\r\n , norm.normalized_procedure_code as normalized_code\r\n , norm.procedure_code_occurrence_count as occurrence_count\r\n , coalesce(lead(procedure_code_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_code_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.procedure_column = dist.procedure_column", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_code_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , procedure_column\n , count(*) as distinct_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize\n group by\n claim_id\n , data_source\n , procedure_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.procedure_column as column_name\n , norm.normalized_procedure_code as normalized_code\n , norm.procedure_code_occurrence_count as occurrence_count\n , coalesce(lead(procedure_code_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_code_occurrence_count desc) as occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.procedure_column = dist.procedure_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_final": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_final", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_final"], "alias": "_int_normalized_input_procedure_date_final", "checksum": {"name": "sha256", "checksum": "0dfe233529b22190cd7775a61ec0852d25c2c93a1d296dfccf62c8546800acf1"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_final", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_final", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.9994166, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_final", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , max(case when lower(column_name) = 'procedure_date_1' then normalized_code else null end) as procedure_date_1\r\n , max(case when lower(column_name) = 'procedure_date_2' then normalized_code else null end) as procedure_date_2\r\n , max(case when lower(column_name) = 'procedure_date_3' then normalized_code else null end) as procedure_date_3\r\n , max(case when lower(column_name) = 'procedure_date_4' then normalized_code else null end) as procedure_date_4\r\n , max(case when lower(column_name) = 'procedure_date_5' then normalized_code else null end) as procedure_date_5\r\n , max(case when lower(column_name) = 'procedure_date_6' then normalized_code else null end) as procedure_date_6\r\n , max(case when lower(column_name) = 'procedure_date_7' then normalized_code else null end) as procedure_date_7\r\n , max(case when lower(column_name) = 'procedure_date_8' then normalized_code else null end) as procedure_date_8\r\n , max(case when lower(column_name) = 'procedure_date_9' then normalized_code else null end) as procedure_date_9\r\n , max(case when lower(column_name) = 'procedure_date_10' then normalized_code else null end) as procedure_date_10\r\n , max(case when lower(column_name) = 'procedure_date_11' then normalized_code else null end) as procedure_date_11\r\n , max(case when lower(column_name) = 'procedure_date_12' then normalized_code else null end) as procedure_date_12\r\n , max(case when lower(column_name) = 'procedure_date_13' then normalized_code else null end) as procedure_date_13\r\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_14\r\n , max(case when lower(column_name) = 'procedure_date_15' then normalized_code else null end) as procedure_date_15\r\n , max(case when lower(column_name) = 'procedure_date_16' then normalized_code else null end) as procedure_date_16\r\n , max(case when lower(column_name) = 'procedure_date_17' then normalized_code else null end) as procedure_date_17\r\n , max(case when lower(column_name) = 'procedure_date_18' then normalized_code else null end) as procedure_date_18\r\n , max(case when lower(column_name) = 'procedure_date_19' then normalized_code else null end) as procedure_date_19\r\n , max(case when lower(column_name) = 'procedure_date_20' then normalized_code else null end) as procedure_date_20\r\n , max(case when lower(column_name) = 'procedure_date_21' then normalized_code else null end) as procedure_date_21\r\n , max(case when lower(column_name) = 'procedure_date_22' then normalized_code else null end) as procedure_date_22\r\n , max(case when lower(column_name) = 'procedure_date_23' then normalized_code else null end) as procedure_date_23\r\n , max(case when lower(column_name) = 'procedure_date_24' then normalized_code else null end) as procedure_date_24\r\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_25\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_date_voting') }}\r\nwhere (occurrence_row_count = 1\r\n and occurrence_count > next_occurrence_count)\r\ngroup by\r\n claim_id\r\n , data_source", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_date_voting", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_final.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , data_source\n , max(case when lower(column_name) = 'procedure_date_1' then normalized_code else null end) as procedure_date_1\n , max(case when lower(column_name) = 'procedure_date_2' then normalized_code else null end) as procedure_date_2\n , max(case when lower(column_name) = 'procedure_date_3' then normalized_code else null end) as procedure_date_3\n , max(case when lower(column_name) = 'procedure_date_4' then normalized_code else null end) as procedure_date_4\n , max(case when lower(column_name) = 'procedure_date_5' then normalized_code else null end) as procedure_date_5\n , max(case when lower(column_name) = 'procedure_date_6' then normalized_code else null end) as procedure_date_6\n , max(case when lower(column_name) = 'procedure_date_7' then normalized_code else null end) as procedure_date_7\n , max(case when lower(column_name) = 'procedure_date_8' then normalized_code else null end) as procedure_date_8\n , max(case when lower(column_name) = 'procedure_date_9' then normalized_code else null end) as procedure_date_9\n , max(case when lower(column_name) = 'procedure_date_10' then normalized_code else null end) as procedure_date_10\n , max(case when lower(column_name) = 'procedure_date_11' then normalized_code else null end) as procedure_date_11\n , max(case when lower(column_name) = 'procedure_date_12' then normalized_code else null end) as procedure_date_12\n , max(case when lower(column_name) = 'procedure_date_13' then normalized_code else null end) as procedure_date_13\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_14\n , max(case when lower(column_name) = 'procedure_date_15' then normalized_code else null end) as procedure_date_15\n , max(case when lower(column_name) = 'procedure_date_16' then normalized_code else null end) as procedure_date_16\n , max(case when lower(column_name) = 'procedure_date_17' then normalized_code else null end) as procedure_date_17\n , max(case when lower(column_name) = 'procedure_date_18' then normalized_code else null end) as procedure_date_18\n , max(case when lower(column_name) = 'procedure_date_19' then normalized_code else null end) as procedure_date_19\n , max(case when lower(column_name) = 'procedure_date_20' then normalized_code else null end) as procedure_date_20\n , max(case when lower(column_name) = 'procedure_date_21' then normalized_code else null end) as procedure_date_21\n , max(case when lower(column_name) = 'procedure_date_22' then normalized_code else null end) as procedure_date_22\n , max(case when lower(column_name) = 'procedure_date_23' then normalized_code else null end) as procedure_date_23\n , max(case when lower(column_name) = 'procedure_date_24' then normalized_code else null end) as procedure_date_24\n , max(case when lower(column_name) = 'procedure_date_14' then normalized_code else null end) as procedure_date_25\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_voting\nwhere (occurrence_row_count = 1\n and occurrence_count > next_occurrence_count)\ngroup by\n claim_id\n , data_source", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_normalize"], "alias": "_int_normalized_input_procedure_date_normalize", "checksum": {"name": "sha256", "checksum": "dead03b9149aeead8299ce32e628b73efa345724ad584dc73ed5d78861a051d1"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0020065, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith pivot_procedure as(\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_1' as procedure_column\r\n , procedure_date_1 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_2' as procedure_column\r\n , procedure_date_2 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_3' as procedure_column\r\n , procedure_date_3 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_4' as procedure_column\r\n , procedure_date_4 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_5' as procedure_column\r\n , procedure_date_5 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_6' as procedure_column\r\n , procedure_date_6 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_7' as procedure_column\r\n , procedure_date_7 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_8' as procedure_column\r\n , procedure_date_8 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_9' as procedure_column\r\n , procedure_date_9 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_10' as procedure_column\r\n , procedure_date_10 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_11' as procedure_column\r\n , procedure_date_11 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_12' as procedure_column\r\n , procedure_date_12 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_13' as procedure_column\r\n , procedure_date_13 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_14' as procedure_column\r\n , procedure_date_14 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_15' as procedure_column\r\n , procedure_date_15 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_16' as procedure_column\r\n , procedure_date_16 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_17' as procedure_column\r\n , procedure_date_17 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_18' as procedure_column\r\n , procedure_date_18 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_19' as procedure_column\r\n , procedure_date_19 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_20' as procedure_column\r\n , procedure_date_20 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_21' as procedure_column\r\n , procedure_date_21 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_22' as procedure_column\r\n , procedure_date_22 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_23' as procedure_column\r\n , procedure_date_24 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_24' as procedure_column\r\n , procedure_date_24 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n\r\n union all\r\n\r\n select\r\n claim_id\r\n , claim_type\r\n , data_source\r\n , 'procedure_date_25' as procedure_column\r\n , procedure_date_25 as procedure_date\r\n from {{ ref('normalized_input__stg_medical_claim') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , cal.full_date as procedure_date\r\n , count(*) as procedure_date_occurrence_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pivot_procedure piv\r\nleft join {{ ref('terminology__calendar') }} cal\r\n on piv.procedure_date = cal.full_date\r\nwhere claim_type = 'institutional'\r\ngroup by \r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , cal.full_date", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n),pivot_procedure as(\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_1' as procedure_column\n , procedure_date_1 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_2' as procedure_column\n , procedure_date_2 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_3' as procedure_column\n , procedure_date_3 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_4' as procedure_column\n , procedure_date_4 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_5' as procedure_column\n , procedure_date_5 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_6' as procedure_column\n , procedure_date_6 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_7' as procedure_column\n , procedure_date_7 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_8' as procedure_column\n , procedure_date_8 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_9' as procedure_column\n , procedure_date_9 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_10' as procedure_column\n , procedure_date_10 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_11' as procedure_column\n , procedure_date_11 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_12' as procedure_column\n , procedure_date_12 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_13' as procedure_column\n , procedure_date_13 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_14' as procedure_column\n , procedure_date_14 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_15' as procedure_column\n , procedure_date_15 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_16' as procedure_column\n , procedure_date_16 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_17' as procedure_column\n , procedure_date_17 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_18' as procedure_column\n , procedure_date_18 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_19' as procedure_column\n , procedure_date_19 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_20' as procedure_column\n , procedure_date_20 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_21' as procedure_column\n , procedure_date_21 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_22' as procedure_column\n , procedure_date_22 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_23' as procedure_column\n , procedure_date_24 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_24' as procedure_column\n , procedure_date_24 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n\n union all\n\n select\n claim_id\n , claim_type\n , data_source\n , 'procedure_date_25' as procedure_column\n , procedure_date_25 as procedure_date\n from __dbt__cte__normalized_input__stg_medical_claim\n)\n\nselect\n claim_id\n , data_source\n , procedure_column\n , cal.full_date as procedure_date\n , count(*) as procedure_date_occurrence_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pivot_procedure piv\nleft join dev_thuxuan.terminology.calendar cal\n on piv.procedure_date = cal.full_date\nwhere claim_type = 'institutional'\ngroup by \n claim_id\n , data_source\n , procedure_column\n , cal.full_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_procedure_date_voting": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_procedure_date_voting", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_procedure_date_voting"], "alias": "_int_normalized_input_procedure_date_voting", "checksum": {"name": "sha256", "checksum": "9f8af8bbcf17e5d4f8a3fd263c0c407a6cb6e47d6899b36f60fea55e72a94981"}, "config": {"enabled": true, "alias": "_int_normalized_input_procedure_date_voting", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_procedure_date_voting", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.006097, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_voting", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith distinct_count as(\r\n select\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n , count(*) as distinct_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__int_procedure_code_normalize') }}\r\n group by\r\n claim_id\r\n , data_source\r\n , procedure_column\r\n)\r\n\r\nselect \r\n norm.claim_id\r\n , norm.data_source\r\n , norm.procedure_column as column_name\r\n , norm.procedure_date as normalized_code\r\n , norm.procedure_date_occurrence_count as occurrence_count\r\n , coalesce(lead(procedure_date_occurrence_count) \r\n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc),0) as next_occurrence_count\r\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc) as occurrence_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__int_procedure_date_normalize') }} norm\r\ninner join distinct_count dist\r\n on norm.claim_id = dist.claim_id\r\n and norm.data_source = dist.data_source\r\n and norm.procedure_column = dist.procedure_column", "language": "sql", "refs": [{"name": "normalized_input__int_procedure_code_normalize", "package": null, "version": null}, {"name": "normalized_input__int_procedure_date_normalize", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_procedure_date_voting.sql", "compiled": true, "compiled_code": "\n\nwith distinct_count as(\n select\n claim_id\n , data_source\n , procedure_column\n , count(*) as distinct_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_code_normalize\n group by\n claim_id\n , data_source\n , procedure_column\n)\n\nselect \n norm.claim_id\n , norm.data_source\n , norm.procedure_column as column_name\n , norm.procedure_date as normalized_code\n , norm.procedure_date_occurrence_count as occurrence_count\n , coalesce(lead(procedure_date_occurrence_count) \n over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc),0) as next_occurrence_count\n , row_number() over (partition by norm.claim_id, norm.data_source, norm.procedure_column order by procedure_date_occurrence_count desc) as occurrence_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_normalized_input_procedure_date_normalize norm\ninner join distinct_count dist\n on norm.claim_id = dist.claim_id\n and norm.data_source = dist.data_source\n and norm.procedure_column = dist.procedure_column", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_revenue_center_normalize": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_revenue_center_normalize", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_revenue_center_normalize"], "alias": "_int_normalized_input_revenue_center_normalize", "checksum": {"name": "sha256", "checksum": "39f9ff18d84f98d851dd18fc596f8ac25e72ba314cc8887e2e924814c6b233df"}, "config": {"enabled": true, "alias": "_int_normalized_input_revenue_center_normalize", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_revenue_center_normalize", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0100758, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_revenue_center_normalize", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , rev.revenue_center_code as normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }} med\r\nleft join {{ ref('terminology__revenue_center') }} rev\r\n on lpad(med.revenue_center_code, 4, '0') = rev.revenue_center_code\r\nwhere claim_type = 'institutional'", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_revenue_center_normalize.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , data_source\n , rev.revenue_center_code as normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim med\nleft join dev_thuxuan.terminology.revenue_center rev\n on lpad(med.revenue_center_code, 4, '0') = rev.revenue_center_code\nwhere claim_type = 'institutional'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__int_undetermined_claim_type": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "normalized_input__int_undetermined_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "intermediate", "normalized_input__int_undetermined_claim_type"], "alias": "_int_normalized_input_undetermined_claim_type", "checksum": {"name": "sha256", "checksum": "57003790094627655a77691bae71f407052d3924b32f664b315c74741faca20e"}, "config": {"enabled": true, "alias": "_int_normalized_input_undetermined_claim_type", "schema": "claims_preprocessing", "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_normalized_input_undetermined_claim_type", "materialized": "table", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0130923, "relation_name": "dev_thuxuan.claims_preprocessing._int_normalized_input_undetermined_claim_type", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__stg_medical_claim') }}\r\nwhere claim_type in ('undetermined')", "language": "sql", "refs": [{"name": "normalized_input__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\intermediate\\normalized_input__int_undetermined_claim_type.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__normalized_input__stg_medical_claim\nwhere claim_type in ('undetermined')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.normalized_input__stg_medical_claim", "sql": " __dbt__cte__normalized_input__stg_medical_claim as (\n\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_eligibility"], "alias": "normalized_input__stg_eligibility", "checksum": {"name": "sha256", "checksum": "0a02d79203d86d4a579a67c8a4bb171e97b47fcc54c732444406fee521bc99e0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0150294, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n patient_id\r\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as {{ dbt.type_string() }}),'')||coalesce(cast(enrollment_end_date as {{ dbt.type_string() }}),'') as patient_id_key\r\n , member_id\r\n , subscriber_id\r\n , gender\r\n , race\r\n , birth_date\r\n , death_date\r\n , death_flag\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\n , plan\r\n , subscriber_relation\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , first_name\r\n , last_name\r\n , social_security_number\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , phone\r\n , data_source\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [{"name": "eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect\n patient_id\n , patient_id||coalesce(data_source,'')||coalesce(payer,'')||coalesce(plan,'')||coalesce(cast(enrollment_start_date as TEXT),'')||coalesce(cast(enrollment_end_date as TEXT),'') as patient_id_key\n , member_id\n , subscriber_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , subscriber_relation\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , social_security_number\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom tuva.input_layer.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_medical_claim"], "alias": "normalized_input__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "354dad4e69d61472ae25a9928ccfc486c8766cf980473a677d898256d04fa2db"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.017625, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [{"name": "medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.normalized_input__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "normalized_input__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.normalized_input__stg_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "normalized_input", "staging", "normalized_input__stg_pharmacy_claim"], "alias": "normalized_input__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "0919d418145d666b8a15bae1dc34c35e0bcf5cf66e8457da482e8606e6638e24"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["normalized_input", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized_input", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["normalized_input", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.019737, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , prescribing_provider_npi\r\n , dispensing_provider_npi\r\n , dispensing_date\r\n , ndc_code\r\n , quantity\r\n , days_supply\r\n , refills\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , data_source\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [{"name": "pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\normalized_input\\staging\\normalized_input__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_results": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_input_layer_results", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_results"], "alias": "_dq_input_layer_results", "checksum": {"name": "sha256", "checksum": "995a3677da266d7e96e2f758bf689ecf0a2c9fe540b4a3578696e490027d9640"}, "config": {"enabled": true, "alias": "_dq_input_layer_results", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_results", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8627837, "relation_name": "dev_thuxuan.claims_preprocessing._dq_input_layer_results", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n dq_problem\r\n, count(distinct claim_id) as distinct_claims\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__dq_input_layer_tests') }}\r\ngroup by 1", "language": "sql", "refs": [{"name": "service_category__dq_input_layer_tests", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "compiled": true, "compiled_code": "\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_input_layer_tests", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_tests"], "alias": "_dq_input_layer_tests", "checksum": {"name": "sha256", "checksum": "474eb8a7e0921b7201879cd03fc932e87db60dcacf7f3cd8b3971692d6b89ca3"}, "config": {"enabled": true, "alias": "_dq_input_layer_tests", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_tests", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.865782, "relation_name": "dev_thuxuan.claims_preprocessing._dq_input_layer_tests", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct claim_type) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__claim_type') }} b\r\n on a.claim_type = b.claim_type\r\nwhere b.claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__place_of_service') }} b\r\n on a.place_of_service_code = b.place_of_service_code\r\nwhere a.claim_type = 'professional'\r\n and b.place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__bill_type') }} b\r\n on a.bill_type_code = b.bill_type_code\r\nwhere a.claim_type = 'institutional'\r\n and b.bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__revenue_center') }} b\r\n on a.revenue_center_code = b.revenue_center_code\r\nwhere a.claim_type = 'institutional'\r\n and b.revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__hcpcs_level_2') }} b\r\n on a.hcpcs_code = b.hcpcs\r\nwhere a.claim_type = 'professional'\r\n and b.hcpcs is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid ms_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__ms_drg') }} b\r\n on a.ms_drg_code = b.ms_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.ms_drg_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid apr_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__apr_drg') }} b\r\n on a.apr_drg_code = b.apr_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.apr_drg_code is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__claim_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct claim_type) > 1\n\nunion all\n\nselect distinct \n claim_id\n, 'Multiple bill_type_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct bill_type_code) > 1\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing claim_type' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing place_of_service_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing bill_type_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and bill_type_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing revenue_center_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Missing hcpcs_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and hcpcs_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid claim_type' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.claim_type b\n on a.claim_type = b.claim_type\nwhere b.claim_type is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid place_of_service_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.place_of_service b\n on a.place_of_service_code = b.place_of_service_code\nwhere a.claim_type = 'professional'\n and b.place_of_service_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid bill_type_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.bill_type b\n on a.bill_type_code = b.bill_type_code\nwhere a.claim_type = 'institutional'\n and b.bill_type_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid revenue_center_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.revenue_center b\n on a.revenue_center_code = b.revenue_center_code\nwhere a.claim_type = 'institutional'\n and b.revenue_center_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid hcpcs_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.hcpcs_level_2 b\n on a.hcpcs_code = b.hcpcs\nwhere a.claim_type = 'professional'\n and b.hcpcs is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid ms_drg_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.ms_drg b\n on a.ms_drg_code = b.ms_drg_code\nwhere a.claim_type = 'institutional'\n and b.ms_drg_code is null\n\nunion all\n\nselect distinct \n claim_id\n, 'Invalid apr_drg_code' as dq_problem\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join dev_thuxuan.terminology.apr_drg b\n on a.apr_drg_code = b.apr_drg_code\nwhere a.claim_type = 'institutional'\n and b.apr_drg_code is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_multiple_service_categories_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_institutional"], "alias": "_dq_multiple_service_categories_institutional", "checksum": {"name": "sha256", "checksum": "2f864f8da22fb47284e7c35e20dffe888a8c76bf360fc06733d77bd266a0ec70"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8683138, "relation_name": "dev_thuxuan.claims_preprocessing._dq_multiple_service_categories_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_institutional') }}\r\ngroup by 1\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [{"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_combined_institutional\ngroup by 1\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dq_multiple_service_categories_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_professional"], "alias": "_dq_multiple_service_categories_professional", "checksum": {"name": "sha256", "checksum": "e444b43251b83d6aa2efc8edf1b495019b285e990c4f4fedbef7d8e32fcb6c66"}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.87232, "relation_name": "dev_thuxuan.claims_preprocessing._dq_multiple_service_categories_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, claim_line_number\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_professional') }}\r\ngroup by 1,2\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [{"name": "service_category__combined_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_combined_professional\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__service_category_grouper": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__service_category_grouper", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "unique_id": "model.the_tuva_project.service_category__service_category_grouper", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "final", "service_category__service_category_grouper"], "alias": "service_category_grouper", "checksum": {"name": "sha256", "checksum": "62d8fd7986ddf6530853d40cee54f8509de18f895bd1ef85a165a2e1eeab61a1"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Assigns every claim line into a unique service category.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "service_category_grouper", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7661517, "relation_name": "dev_thuxuan.claims_preprocessing.service_category_grouper", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith service_category_1_mapping as(\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulance' then 'Ancillary'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n where a.claim_type = 'professional'\r\n\r\n union all\r\n\r\n select distinct \r\n a.claim_id\r\n , a.claim_line_number\r\n , a.claim_type\r\n , case\r\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\r\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\r\n when service_category_2 = 'Dialysis' then 'Outpatient'\r\n when service_category_2 = 'Emergency Department' then 'Outpatient'\r\n when service_category_2 = 'Home Health' then 'Outpatient'\r\n when service_category_2 = 'Hospice' then 'Outpatient'\r\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\r\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\r\n when service_category_2 = 'Lab' then 'Ancillary'\r\n when service_category_2 = 'Office Visit' then 'Office Visit'\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\r\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\r\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\r\n when service_category_2 = 'Urgent Care' then 'Outpatient'\r\n when service_category_2 is null then 'Other'\r\n end service_category_1\r\n , case\r\n when service_category_2 is null then 'Other'\r\n else service_category_2\r\n end service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('service_category__stg_medical_claim') }} a\r\n left join {{ ref('service_category__combined_institutional') }} b\r\n on a.claim_id = b.claim_id\r\n where a.claim_type = 'institutional'\r\n)\r\n, service_category_2_deduplication as(\r\n select \r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\n , row_number() over (partition by claim_id, claim_line_number order by \r\n case\r\n when service_category_2 = 'Acute Inpatient' then 3\r\n when service_category_2 = 'Ambulance' then 7\r\n when service_category_2 = 'Ambulatory Surgery' then 8\r\n when service_category_2 = 'Dialysis' then 17\r\n when service_category_2 = 'Durable Medical Equipment' then 1\r\n when service_category_2 = 'Emergency Department' then 5\r\n when service_category_2 = 'Home Health' then 9\r\n when service_category_2 = 'Hospice' then 10\r\n when service_category_2 = 'Inpatient Psychiatric' then 11\r\n when service_category_2 = 'Inpatient Rehabilitation' then 12\r\n when service_category_2 = 'Lab' then 13\r\n when service_category_2 = 'Office Visit' then 4\r\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\r\n when service_category_2 = 'Outpatient Psychiatric' then 15\r\n when service_category_2 = 'Outpatient Rehabilitation' then 16\r\n when service_category_2 = 'Skilled Nursing' then 6\r\n when service_category_2 = 'Urgent Care' then 2\r\n when service_category_2 is null then 18\r\n else 99 end) as duplicate_row_number\r\n from service_category_1_mapping\r\n)\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\nfrom service_category_2_deduplication\r\nwhere duplicate_row_number = 1", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_professional", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__combined_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),service_category_1_mapping as(\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulance' then 'Ancillary'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Durable Medical Equipment' then 'Ancillary'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Outpatient Rehabilitation' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join dev_thuxuan.claims_preprocessing._int_combined_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n where a.claim_type = 'professional'\n\n union all\n\n select distinct \n a.claim_id\n , a.claim_line_number\n , a.claim_type\n , case\n when service_category_2 = 'Acute Inpatient' then 'Inpatient'\n when service_category_2 = 'Ambulatory Surgery' then 'Outpatient'\n when service_category_2 = 'Dialysis' then 'Outpatient'\n when service_category_2 = 'Emergency Department' then 'Outpatient'\n when service_category_2 = 'Home Health' then 'Outpatient'\n when service_category_2 = 'Hospice' then 'Outpatient'\n when service_category_2 = 'Inpatient Psychiatric' then 'Inpatient'\n when service_category_2 = 'Inpatient Rehabilitation' then 'Inpatient'\n when service_category_2 = 'Lab' then 'Ancillary'\n when service_category_2 = 'Office Visit' then 'Office Visit'\n when service_category_2 = 'Outpatient Hospital or Clinic' then 'Outpatient'\n when service_category_2 = 'Outpatient Psychiatric' then 'Outpatient'\n when service_category_2 = 'Skilled Nursing' then 'Inpatient'\n when service_category_2 = 'Urgent Care' then 'Outpatient'\n when service_category_2 is null then 'Other'\n end service_category_1\n , case\n when service_category_2 is null then 'Other'\n else service_category_2\n end service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join dev_thuxuan.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\n where a.claim_type = 'institutional'\n)\n, service_category_2_deduplication as(\n select \n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\n , row_number() over (partition by claim_id, claim_line_number order by \n case\n when service_category_2 = 'Acute Inpatient' then 3\n when service_category_2 = 'Ambulance' then 7\n when service_category_2 = 'Ambulatory Surgery' then 8\n when service_category_2 = 'Dialysis' then 17\n when service_category_2 = 'Durable Medical Equipment' then 1\n when service_category_2 = 'Emergency Department' then 5\n when service_category_2 = 'Home Health' then 9\n when service_category_2 = 'Hospice' then 10\n when service_category_2 = 'Inpatient Psychiatric' then 11\n when service_category_2 = 'Inpatient Rehabilitation' then 12\n when service_category_2 = 'Lab' then 13\n when service_category_2 = 'Office Visit' then 4\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\n when service_category_2 = 'Outpatient Psychiatric' then 15\n when service_category_2 = 'Outpatient Rehabilitation' then 16\n when service_category_2 = 'Skilled Nursing' then 6\n when service_category_2 = 'Urgent Care' then 2\n when service_category_2 is null then 18\n else 99 end) as duplicate_row_number\n from service_category_1_mapping\n)\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\nfrom service_category_2_deduplication\nwhere duplicate_row_number = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__acute_inpatient_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_institutional"], "alias": "_int_acute_inpatient_institutional", "checksum": {"name": "sha256", "checksum": "45448b22cdb8a33fda5a064935b99740b7273da6c46768e362b043118cd13bcb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7756662, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith room_and_board_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code in\r\n ('0100','0101',\r\n '0110','0111','0112','0113','0114','0116','0117','0118','0119',\r\n '0120','0121','0122','0123','0124','0126','0127','0128','0129',\r\n '0130','0131','0132','0133','0134','0136','0137','0138','0139',\r\n '0140','0141','0142','0143','0144','0146','0147','0148','0149',\r\n '0150','0151','0152','0153','0154','0156','0157','0158','0159',\r\n '0160','0164','0167','0169',\r\n '0170','0171','0172','0173','0174','0179',\r\n '0190','0191','0192','0193','0194','0199',\r\n '0200','0201','0202','0203','0204','0206','0207','0208','0209',\r\n '0210','0211','0212','0213','0214','0219',\r\n '1000','1001','1002')\r\n)\r\n\r\n, drg_requirement as (\r\nselect distinct \r\n mc.claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }} mc\r\nleft join {{ ref('terminology__ms_drg')}} msdrg\r\n on mc.ms_drg_code = msdrg.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg')}} aprdrg\r\n on mc.apr_drg_code = aprdrg.apr_drg_code\r\nwhere claim_type = 'institutional'\r\n and (msdrg.ms_drg_code is not null or aprdrg.apr_drg_code is not null)\r\n)\r\n\r\n, bill_type_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('11','12') \r\n)\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join room_and_board_requirement b\r\n on a.claim_id = b.claim_id\r\ninner join drg_requirement c\r\n on a.claim_id = c.claim_id\r\ninner join bill_type_requirement d\r\n on a.claim_id = d.claim_id", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n),room_and_board_requirement as (\nselect distinct \n claim_id\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and revenue_center_code in\n ('0100','0101',\n '0110','0111','0112','0113','0114','0116','0117','0118','0119',\n '0120','0121','0122','0123','0124','0126','0127','0128','0129',\n '0130','0131','0132','0133','0134','0136','0137','0138','0139',\n '0140','0141','0142','0143','0144','0146','0147','0148','0149',\n '0150','0151','0152','0153','0154','0156','0157','0158','0159',\n '0160','0164','0167','0169',\n '0170','0171','0172','0173','0174','0179',\n '0190','0191','0192','0193','0194','0199',\n '0200','0201','0202','0203','0204','0206','0207','0208','0209',\n '0210','0211','0212','0213','0214','0219',\n '1000','1001','1002')\n)\n\n, drg_requirement as (\nselect distinct \n mc.claim_id\nfrom __dbt__cte__service_category__stg_medical_claim mc\nleft join dev_thuxuan.terminology.ms_drg msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join dev_thuxuan.terminology.apr_drg aprdrg\n on mc.apr_drg_code = aprdrg.apr_drg_code\nwhere claim_type = 'institutional'\n and (msdrg.ms_drg_code is not null or aprdrg.apr_drg_code is not null)\n)\n\n, bill_type_requirement as (\nselect distinct \n claim_id\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('11','12') \n)\n\nselect distinct \n a.claim_id\n, 'Acute Inpatient' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join room_and_board_requirement b\n on a.claim_id = b.claim_id\ninner join drg_requirement c\n on a.claim_id = c.claim_id\ninner join bill_type_requirement d\n on a.claim_id = d.claim_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__acute_inpatient_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_professional"], "alias": "_int_acute_inpatient_professional", "checksum": {"name": "sha256", "checksum": "3d6946eec496f4e26d0ff37dce15f9fbd2d521922d2f59c55a1a630c778d8f29"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.778667, "relation_name": "dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n claim_id\r\n, claim_line_number\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '21'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '21'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__ambulance_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "unique_id": "model.the_tuva_project.service_category__ambulance_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulance_professional"], "alias": "_int_ambulance_professional", "checksum": {"name": "sha256", "checksum": "9a180fa157cc7e6697b4bdff3c8ace56d436a3225005542ad040e6b41fe681ce"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulance_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7816665, "relation_name": "dev_thuxuan.claims_preprocessing._int_ambulance_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Ambulance' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and (hcpcs_code between 'A0425' and 'A0436' or place_of_service_code in ('41','42'))", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and (hcpcs_code between 'A0425' and 'A0436' or place_of_service_code in ('41','42'))", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__ambulatory_surgery_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulatory_surgery_professional"], "alias": "_int_ambulatory_surgery_professional", "checksum": {"name": "sha256", "checksum": "5132c1e9fb0afaf2c9d2cc3e43c79a9f5e4659dc3a26b85f89eaaeee2fe3466b"}, "config": {"enabled": true, "alias": "_int_ambulatory_surgery_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulatory_surgery_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7841713, "relation_name": "dev_thuxuan.claims_preprocessing._int_ambulatory_surgery_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Ambulatory Surgery' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('24')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere a.claim_type = 'professional'\n and a.place_of_service_code in ('24')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__combined_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "unique_id": "model.the_tuva_project.service_category__combined_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_institutional"], "alias": "_int_combined_institutional", "checksum": {"name": "sha256", "checksum": "6b586aac1db9cb5169af1b6a31ee51e56371b33871c5af89752ad32a9ce97df2"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7726667, "relation_name": "dev_thuxuan.claims_preprocessing._int_combined_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith duplicate_bill_types as (\r\nselect distinct\r\n claim_id\r\n, 'Other' as service_category_2\r\nfrom {{ ref('service_category__duplicate_bill_types') }}\r\n)\r\n\r\n, combine as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_institutional') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n, service_category_2\r\nfrom duplicate_bill_types\r\n\r\nunion all\r\n\r\nselect\r\n a.claim_id\r\n, a.service_category_2\r\nfrom combine a\r\nleft join duplicate_bill_types b\r\n on a.claim_id = b.claim_id\r\nwhere b.claim_id is null", "language": "sql", "refs": [{"name": "service_category__duplicate_bill_types", "package": null, "version": null}, {"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}, {"name": "service_category__dialysis_institutional", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__home_health_institutional", "package": null, "version": null}, {"name": "service_category__hospice_institutional", "package": null, "version": null}, {"name": "service_category__lab_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_institutional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_institutional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "compiled": true, "compiled_code": "\n\nwith duplicate_bill_types as (\nselect distinct\n claim_id\n, 'Other' as service_category_2\nfrom dev_thuxuan.claims_preprocessing._int_duplicate_bill_types\n)\n\n, combine as (\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_dialysis_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_home_health_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_hospice_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_lab_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_skilled_nursing_institutional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_urgent_care_institutional\n)\n\nselect\n claim_id\n, service_category_2\nfrom duplicate_bill_types\n\nunion all\n\nselect\n a.claim_id\n, a.service_category_2\nfrom combine a\nleft join duplicate_bill_types b\n on a.claim_id = b.claim_id\nwhere b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__combined_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__combined_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "unique_id": "model.the_tuva_project.service_category__combined_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_professional"], "alias": "_int_combined_professional", "checksum": {"name": "sha256", "checksum": "aa2935b0a4b30bf3b309127c4ff3974eebe516c7a7ff0869112c848cc2dc2031"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7696662, "relation_name": "dev_thuxuan.claims_preprocessing._int_combined_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith combined as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__ambulatory_surgery_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__office_visit_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_professional') }}\r\n)\r\n\r\nselect \r\n claim_id\r\n, claim_line_number\r\n, service_category_2\r\n, tuva_last_run\r\nfrom {{ ref('service_category__dme_professional') }}\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom {{ ref('service_category__ambulance_professional') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom combined a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nleft join {{ ref('service_category__ambulance_professional') }} c\r\n on a.claim_id = c.claim_id\r\n and a.claim_line_number = c.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n and (c.claim_id is null and c.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__acute_inpatient_professional", "package": null, "version": null}, {"name": "service_category__ambulatory_surgery_professional", "package": null, "version": null}, {"name": "service_category__dialysis_professional", "package": null, "version": null}, {"name": "service_category__emergency_department_professional", "package": null, "version": null}, {"name": "service_category__home_health_professional", "package": null, "version": null}, {"name": "service_category__hospice_professional", "package": null, "version": null}, {"name": "service_category__inpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__inpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__lab_professional", "package": null, "version": null}, {"name": "service_category__office_visit_professional", "package": null, "version": null}, {"name": "service_category__outpatient_hospital_or_clinic_professional", "package": null, "version": null}, {"name": "service_category__outpatient_psychiatric_professional", "package": null, "version": null}, {"name": "service_category__outpatient_rehab_professional", "package": null, "version": null}, {"name": "service_category__skilled_nursing_professional", "package": null, "version": null}, {"name": "service_category__urgent_care_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}, {"name": "service_category__ambulance_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "compiled": true, "compiled_code": "\n\nwith combined as (\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_acute_inpatient_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_ambulatory_surgery_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_dialysis_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_emergency_department_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_home_health_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_hospice_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_inpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_inpatient_rehab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_lab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_office_visit_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_outpatient_rehab_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_skilled_nursing_professional\n\nunion all\n\nselect *\nfrom dev_thuxuan.claims_preprocessing._int_urgent_care_professional\n)\n\nselect \n claim_id\n, claim_line_number\n, service_category_2\n, tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_dme_professional\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom dev_thuxuan.claims_preprocessing._int_ambulance_professional a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom combined a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_ambulance_professional c\n on a.claim_id = c.claim_id\n and a.claim_line_number = c.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n and (c.claim_id is null and c.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dialysis_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_institutional"], "alias": "_int_dialysis_institutional", "checksum": {"name": "sha256", "checksum": "53a54afb920b8af8a86e3dd8b0f7767d1b072a5d8b0b06d36df8891b0e5c6df1"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7881901, "relation_name": "dev_thuxuan.claims_preprocessing._int_dialysis_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('72')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('72')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dialysis_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_professional"], "alias": "_int_dialysis_professional", "checksum": {"name": "sha256", "checksum": "f72ea80a80c59536c72040b42e646d51e9aac2ac3d21fc806bc4c40d2b8bb286"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7911904, "relation_name": "dev_thuxuan.claims_preprocessing._int_dialysis_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('65')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('65')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__dme_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__dme_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "unique_id": "model.the_tuva_project.service_category__dme_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dme_professional"], "alias": "_int_dme_professional", "checksum": {"name": "sha256", "checksum": "0133c48459f92ce84f6c5d81612864d7f8d635bd350f0010bd14af2b83f3fe17"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dme_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7941906, "relation_name": "dev_thuxuan.claims_preprocessing._int_dme_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Durable Medical Equipment' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code between 'E0100' and 'E8002'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and hcpcs_code between 'E0100' and 'E8002'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__duplicate_bill_types": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__duplicate_bill_types", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__duplicate_bill_types"], "alias": "_int_duplicate_bill_types", "checksum": {"name": "sha256", "checksum": "5bd727d92e88b8c292df5113cda3c5f8598d68a99f1369229daa4880e3e00e07"}, "config": {"enabled": true, "alias": "_int_duplicate_bill_types", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_duplicate_bill_types", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.856821, "relation_name": "dev_thuxuan.claims_preprocessing._int_duplicate_bill_types", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n claim_id\r\n, count(distinct bill_type_code) as cnt\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct\n claim_id\n, count(distinct bill_type_code) as cnt\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct bill_type_code) > 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__emergency_department_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_institutional"], "alias": "_int_emergency_department_institutional", "checksum": {"name": "sha256", "checksum": "d79b109000698551879ece14b396e2a33452e66ee680842d65b5d5163318c615"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7971904, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n med.claim_id\r\n , 'Emergency Department' as service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} med\r\nleft join {{ ref('service_category__acute_inpatient_institutional') }} inpatient\r\n on med.claim_id = inpatient.claim_id\r\nwhere claim_type = 'institutional'\r\nand revenue_center_code in ('0450','0451','0452','0459','0981')\r\nand inpatient.claim_id is null\r\n-- 0456, urgent care, is included in most published definitions\r\n-- that also include a requirement of a bill type code for\r\n-- inpatient or outpatient hospital.", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__acute_inpatient_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__acute_inpatient_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n med.claim_id\n , 'Emergency Department' as service_category_2\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim med\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_institutional inpatient\n on med.claim_id = inpatient.claim_id\nwhere claim_type = 'institutional'\nand revenue_center_code in ('0450','0451','0452','0459','0981')\nand inpatient.claim_id is null\n-- 0456, urgent care, is included in most published definitions\n-- that also include a requirement of a bill type code for\n-- inpatient or outpatient hospital.", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__emergency_department_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "unique_id": "model.the_tuva_project.service_category__emergency_department_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_professional"], "alias": "_int_emergency_department_professional", "checksum": {"name": "sha256", "checksum": "b580a63fbab372247bd06ea2f0caa741d0b0bb08f882d1f451f77b67a5211e6a"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.7991903, "relation_name": "dev_thuxuan.claims_preprocessing._int_emergency_department_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Emergency Department' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '23'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '23'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__home_health_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_institutional"], "alias": "_int_home_health_institutional", "checksum": {"name": "sha256", "checksum": "ebd81a79d14801ed4c0af878ce7dc23da8cc751f7d283e9beea5973116689559"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8027048, "relation_name": "dev_thuxuan.claims_preprocessing._int_home_health_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('31','32','33')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Home Health' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('31','32','33')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__home_health_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__home_health_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_professional"], "alias": "_int_home_health_professional", "checksum": {"name": "sha256", "checksum": "e3e4cc0fb7ae937d0ecc34b62fabd17150be8e71149e41005e12f8d8bf578f19"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8057046, "relation_name": "dev_thuxuan.claims_preprocessing._int_home_health_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('12')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere a.claim_type = 'professional'\n and a.place_of_service_code in ('12')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__hospice_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_institutional"], "alias": "_int_hospice_institutional", "checksum": {"name": "sha256", "checksum": "198820bc2d29eea3366ecc8a92644499cb01f51d6de7f07ba814eca2b9fb5cbf"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8087049, "relation_name": "dev_thuxuan.claims_preprocessing._int_hospice_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('81','82')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Hospice' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('81','82')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__hospice_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__hospice_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_professional"], "alias": "_int_hospice_professional", "checksum": {"name": "sha256", "checksum": "7865625a277befde407037864c2a6b33ccf5b50c76ecff7345804a08a209023f"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8117046, "relation_name": "dev_thuxuan.claims_preprocessing._int_hospice_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('34')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('34')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__inpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_psychiatric_professional"], "alias": "_int_inpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "d68ac752e0e2399538aa77a0f07dfe7accd03642ef783d6017276d299c081ba4"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8147044, "relation_name": "dev_thuxuan.claims_preprocessing._int_inpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('51','55','56')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('51','55','56')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__inpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_rehab_professional"], "alias": "_int_inpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "62fda1a740ee7c667c1578eb29b029fdb0e37e361e779c4bd593dc5b7b9ab67c"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8172092, "relation_name": "dev_thuxuan.claims_preprocessing._int_inpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('61')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('61')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__lab_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "unique_id": "model.the_tuva_project.service_category__lab_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_institutional"], "alias": "_int_lab_institutional", "checksum": {"name": "sha256", "checksum": "f8ecb80b0b86a95c0c65ea2a648c129005d4924eac086e5b749ff64b89a8b442"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8202147, "relation_name": "dev_thuxuan.claims_preprocessing._int_lab_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('14')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Lab' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('14')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__lab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__lab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "unique_id": "model.the_tuva_project.service_category__lab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_professional"], "alias": "_int_lab_professional", "checksum": {"name": "sha256", "checksum": "312d673baaf32a48761bb3ba8ad9239c7eae2075932053ac5b2dabc3a5ad67f1"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8232148, "relation_name": "dev_thuxuan.claims_preprocessing._int_lab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '81'", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code = '81'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__office_visit_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "unique_id": "model.the_tuva_project.service_category__office_visit_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__office_visit_professional"], "alias": "_int_office_visit_professional", "checksum": {"name": "sha256", "checksum": "d78727437a58eb4a800d23c44f98919922b46bbca26fab212332a3758d4c4626"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_office_visit_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8262153, "relation_name": "dev_thuxuan.claims_preprocessing._int_office_visit_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Office Visit' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('11','02')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('11','02')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_institutional"], "alias": "_int_outpatient_hospital_or_clinic_institutional", "checksum": {"name": "sha256", "checksum": "88a8421850d8e7f1411e236a4b3a32c8568d10bb60db0a49b73de19b2b2da255"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.828725, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nleft join {{ ref('service_category__urgent_care_institutional') }} c\r\n on a.claim_id = c.claim_id\r\nwhere a.claim_type = 'institutional'\r\n and left(a.bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null\r\n and c.claim_id is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}, {"name": "service_category__urgent_care_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_urgent_care_institutional c\n on a.claim_id = c.claim_id\nwhere a.claim_type = 'institutional'\n and left(a.bill_type_code,2) in ('13','71','73')\n and b.claim_id is null\n and c.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_professional"], "alias": "_int_outpatient_hospital_or_clinic_professional", "checksum": {"name": "sha256", "checksum": "ae41a464978d3b87254bb65ba72ee2db48781353647af9c054662d22ad4946a7"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8317251, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_hospital_or_clinic_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('15','17','19','22','49','50','60','71','72')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('15','17','19','22','49','50','60','71','72')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_institutional"], "alias": "_int_outpatient_psychiatric_institutional", "checksum": {"name": "sha256", "checksum": "03de370b5eaf1bc916100d279c3414cdb0ecc561f9f733c7c7a7e996f632049a"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8342297, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('52')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('52')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_professional"], "alias": "_int_outpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "975f15bc122b7093a2adb339025bfa5bb4df63f03ae980bcb2943ad9f78c3a97"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8372405, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('52','53','57','58')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('52','53','57','58')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__outpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_rehab_professional"], "alias": "_int_outpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "04d17dc69eacfcf77b47b4dac4e12662543f8d29b876eff10482ea1309136d3a"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8402407, "relation_name": "dev_thuxuan.claims_preprocessing._int_outpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('62')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('62')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_institutional"], "alias": "_int_skilled_nursing_institutional", "checksum": {"name": "sha256", "checksum": "61078103bec3d91addc18be1dc25b1a4b6057f9027778743555fbd84cdb0ac7d"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8432438, "relation_name": "dev_thuxuan.claims_preprocessing._int_skilled_nursing_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('21','22')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('21','22')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_professional"], "alias": "_int_skilled_nursing_professional", "checksum": {"name": "sha256", "checksum": "a0ed39cf33ed23eb4deb15b642f09928cfa3ee10df31ec1af53a00a11613e27b"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8462436, "relation_name": "dev_thuxuan.claims_preprocessing._int_skilled_nursing_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('31','32')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__dme_professional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere claim_type = 'professional'\n and place_of_service_code in ('31','32')\n and (b.claim_id is null and b.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__urgent_care_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_institutional"], "alias": "_int_urgent_care_institutional", "checksum": {"name": "sha256", "checksum": "a285051f080554005f2a4853edc72d229f115a2a6b87ab6391cc2abd13fba901"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8492439, "relation_name": "dev_thuxuan.claims_preprocessing._int_urgent_care_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code = '0456'\r\n and left(bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}, {"name": "service_category__emergency_department_institutional", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n a.claim_id\n, 'Urgent Care' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')\n and b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__urgent_care_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "unique_id": "model.the_tuva_project.service_category__urgent_care_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_professional"], "alias": "_int_urgent_care_professional", "checksum": {"name": "sha256", "checksum": "895cc40f7c935fb2e43fd16cf23b912589558fd452317658d7184ebcdbe9053b"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8527849, "relation_name": "dev_thuxuan.claims_preprocessing._int_urgent_care_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('20')", "language": "sql", "refs": [{"name": "service_category__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim\nwhere claim_type = 'professional'\n and place_of_service_code in ('20')", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "service_category__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.service_category__stg_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "staging", "service_category__stg_medical_claim"], "alias": "service_category__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "3ea2fb3af455a48075ea492797a8ed1f3da6997ff73dcaa4b7c60faeb1012aa8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884193.8597665, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\nAPR_DRG_CODE,\r\nBILL_TYPE_CODE,\r\nCLAIM_ID,\r\nCLAIM_LINE_NUMBER,\r\nCLAIM_TYPE,\r\nHCPCS_CODE,\r\nMS_DRG_CODE,\r\nPLACE_OF_SERVICE_CODE,\r\nREVENUE_CENTER_CODE,\r\n'{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\staging\\service_category__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.value_set_member_relevant_fields": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "value_set_member_relevant_fields", "resource_type": "model", "package_name": "the_tuva_project", "path": "clinical_concept_library\\value_set_member_relevant_fields.sql", "original_file_path": "models\\clinical_concept_library\\value_set_member_relevant_fields.sql", "unique_id": "model.the_tuva_project.value_set_member_relevant_fields", "fqn": ["the_tuva_project", "clinical_concept_library", "value_set_member_relevant_fields"], "alias": "value_set_member_relevant_fields", "checksum": {"name": "sha256", "checksum": "320cea5b4108a9b6991e407e58ac5f78c090d5c4c6395b1f098c631301a9cd86"}, "config": {"enabled": true, "alias": "value_set_member_relevant_fields", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "This model creates one record per value set member, but it includes relevant fields for each value set member taken from the clnical_concepts and coding_systems tables.\n", "columns": {"concept_id": {"name": "concept_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "concept_name": {"name": "concept_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "concept_type": {"name": "concept_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "value_set_member_id": {"name": "value_set_member_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coding_system_id": {"name": "coding_system_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "include_descendants": {"name": "include_descendants", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coding_system_name": {"name": "coding_system_name", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\clinical_concept_library\\clinical_concept_library_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "clinical_concept_library", "alias": "value_set_member_relevant_fields", "tags": ["clinical_concept_library"], "materialized": "table", "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0276725, "relation_name": "dev_thuxuan.clinical_concept_library.value_set_member_relevant_fields", "raw_code": "with value_set_member_relevant_fields as (\r\nselect \r\n aa.concept_id,\r\n aa.concept_name,\r\n aa.concept_type,\r\n \r\n bb.value_set_member_id,\r\n bb.code,\r\n bb.coding_system_id,\r\n bb.include_descendants,\r\n\r\n cc.coding_system_name\r\n \r\nfrom {{ ref('clinical_concepts') }} aa\r\n\r\nleft join {{ ref('value_set_members') }} bb\r\non aa.concept_id = bb.concept_id\r\n\r\nleft join {{ ref('coding_systems') }} cc\r\non bb.coding_system_id = cc.coding_system_id\r\n)\r\n\r\n\r\nselect *\r\nfrom value_set_member_relevant_fields", "language": "sql", "refs": [{"name": "clinical_concepts", "package": null, "version": null}, {"name": "value_set_members", "package": null, "version": null}, {"name": "coding_systems", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.clinical_concepts", "seed.the_tuva_project.value_set_members", "seed.the_tuva_project.coding_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\clinical_concept_library\\value_set_member_relevant_fields.sql", "compiled": true, "compiled_code": "with value_set_member_relevant_fields as (\nselect \n aa.concept_id,\n aa.concept_name,\n aa.concept_type,\n \n bb.value_set_member_id,\n bb.code,\n bb.coding_system_id,\n bb.include_descendants,\n\n cc.coding_system_name\n \nfrom dev_thuxuan.clinical_concept_library.clinical_concepts aa\n\nleft join dev_thuxuan.clinical_concept_library.value_set_members bb\non aa.concept_id = bb.concept_id\n\nleft join dev_thuxuan.clinical_concept_library.coding_systems cc\non bb.coding_system_id = cc.coding_system_id\n)\n\n\nselect *\nfrom value_set_member_relevant_fields", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "original_file_path": "models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_factors"], "alias": "patient_risk_factors", "checksum": {"name": "sha256", "checksum": "1f814b9d282b840bcb1b41cbb8b23dc5f18466bff4aa56ff04b2d3f88aa708c5"}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0323536, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith demographic_factors as (\r\n\r\n select\r\n patient_id\r\n /* concatenate demographic risk factors */\r\n , gender\r\n || ', '\r\n || age_group\r\n || ' Years'\r\n || ', '\r\n || enrollment_status\r\n || ' Enrollee'\r\n || ', '\r\n || case\r\n when medicaid_status = 'Yes' then 'Medicaid'\r\n else 'Non-Medicaid'\r\n end\r\n || ', '\r\n || dual_status\r\n || ' Dual'\r\n || ', '\r\n || orec\r\n || ', '\r\n || case\r\n when institutional_status = 'Yes' then 'Institutional'\r\n else 'Non-Institutional'\r\n end\r\n as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, demographic_defaults as (\r\n\r\n select\r\n patient_id\r\n , model_version\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, disease_factors as (\r\n\r\n select\r\n patient_id\r\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_factors') }}\r\n\r\n)\r\n\r\n, enrollment_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_enrollment_interaction_factors') }}\r\n\r\n)\r\n\r\n, disabled_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disabled_interaction_factors') }}\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_interaction_factors') }}\r\n\r\n)\r\n\r\n, hcc_counts as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_hcc_count_factors') }}\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from demographic_factors\r\n union all\r\n select * from disease_factors\r\n union all\r\n select * from enrollment_interactions\r\n union all\r\n select * from disabled_interactions\r\n union all\r\n select * from disease_interactions\r\n union all\r\n select * from hcc_counts\r\n\r\n)\r\n\r\n, add_defaults as (\r\n\r\n select\r\n unioned.patient_id\r\n , demographic_defaults.enrollment_status_default\r\n , demographic_defaults.medicaid_dual_status_default\r\n , demographic_defaults.orec_default\r\n , demographic_defaults.institutional_status_default\r\n , unioned.description as risk_factor_description\r\n , unioned.coefficient\r\n , unioned.factor_type\r\n , unioned.model_version\r\n , unioned.payment_year\r\n from unioned\r\n left join demographic_defaults\r\n on unioned.patient_id = demographic_defaults.patient_id\r\n and unioned.model_version = demographic_defaults.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(risk_factor_description as {{ dbt.type_string() }}) as risk_factor_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from add_defaults\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , factor_type\r\n , risk_factor_description\r\n , coefficient\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_factors", "package": null, "version": null}, {"name": "cms_hcc__int_enrollment_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disabled_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_disease_interaction_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_count_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "compiled": true, "compiled_code": "\nwith demographic_factors as (\n\n select\n patient_id\n /* concatenate demographic risk factors */\n , gender\n || ', '\n || age_group\n || ' Years'\n || ', '\n || enrollment_status\n || ' Enrollee'\n || ', '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ', '\n || dual_status\n || ' Dual'\n || ', '\n || orec\n || ', '\n || case\n when institutional_status = 'Yes' then 'Institutional'\n else 'Non-Institutional'\n end\n as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, demographic_defaults as (\n\n select\n patient_id\n , model_version\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, disease_factors as (\n\n select\n patient_id\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disease_factors\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_enrollment_interaction_factors\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disabled_interaction_factors\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_disease_interaction_factors\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_hcc_count_factors\n\n)\n\n, unioned as (\n\n select * from demographic_factors\n union all\n select * from disease_factors\n union all\n select * from enrollment_interactions\n union all\n select * from disabled_interactions\n union all\n select * from disease_interactions\n union all\n select * from hcc_counts\n\n)\n\n, add_defaults as (\n\n select\n unioned.patient_id\n , demographic_defaults.enrollment_status_default\n , demographic_defaults.medicaid_dual_status_default\n , demographic_defaults.orec_default\n , demographic_defaults.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\n , unioned.factor_type\n , unioned.model_version\n , unioned.payment_year\n from unioned\n left join demographic_defaults\n on unioned.patient_id = demographic_defaults.patient_id\n and unioned.model_version = demographic_defaults.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast(factor_type as TEXT) as factor_type\n , cast(risk_factor_description as TEXT) as risk_factor_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , factor_type\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_scores", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "original_file_path": "models\\cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_scores"], "alias": "patient_risk_scores", "checksum": {"name": "sha256", "checksum": "899fcdcb2df1cc232c5a28c279758bd98f6def70ec107d11e0abfdd7f5757560"}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model calculates the CMS HCC raw risk score, blended risk score, normalized risk score, and payment risk score for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "v24_risk_score": {"name": "v24_risk_score", "description": "The sum of all patient risk factors from model version CMS-HCC-V24. If payment year >= 2024 then the score may be weighted following CMS's transition plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "v28_risk_score": {"name": "v28_risk_score", "description": "The sum of all patient risk factors from model version CMS-HCC-V28. If payment year >= 2024 then the score may be weighted following CMS's transition plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "blended_risk_score": {"name": "blended_risk_score", "description": "The of sum v24_risk_score and v28_risk_score.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The blended risk score divided by the normalization adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_scores", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0401623, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_scores", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith seed_adjustment_rates as (\r\n\r\n select\r\n model_version\r\n , payment_year\r\n , normalization_factor\r\n , ma_coding_pattern_adjustment\r\n from {{ ref('cms_hcc__adjustment_rates') }}\r\n\r\n)\r\n\r\n, risk_factors as (\r\n\r\n select\r\n patient_id\r\n , coefficient\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n)\r\n\r\n, raw_score as (\r\n\r\n select\r\n patient_id\r\n , sum(coefficient) as risk_score\r\n , model_version\r\n , payment_year\r\n from risk_factors\r\n group by\r\n patient_id\r\n , model_version\r\n , payment_year\r\n\r\n)\r\n\r\n/*\r\n CMS Guidance for the transition from v24 to v28:\r\n\r\n PY2024 risk scores will be blended using 67% of the risk score calculated\r\n from v24 and 33% from v28.\r\n\r\n PY2025 risk scores will be blended using 33% of the risk score calculated\r\n from v24 and 67% from v28.\r\n\r\n PY2026 risk scores will be 100% from v28.\r\n\r\n Prior payment years will still be calculated from v24 only.\r\n*/\r\n, transition_scores as (\r\n\r\n select\r\n patient_id\r\n , risk_score\r\n , case\r\n when payment_year <= 2023 and model_version = 'CMS-HCC-V24' then risk_score\r\n when payment_year = 2024 and model_version = 'CMS-HCC-V24' then risk_score * 0.67\r\n when payment_year = 2025 and model_version = 'CMS-HCC-V24' then risk_score * 0.33\r\n when payment_year >= 2026 and model_version = 'CMS-HCC-V24' then 0\r\n end as v24_risk_score\r\n , case\r\n when payment_year <= 2023 and model_version = 'CMS-HCC-V28' then 0\r\n when payment_year = 2024 and model_version = 'CMS-HCC-V28' then risk_score * 0.33\r\n when payment_year = 2025 and model_version = 'CMS-HCC-V28' then risk_score * 0.67\r\n when payment_year >= 2026 and model_version = 'CMS-HCC-V28' then risk_score\r\n end as v28_risk_score\r\n , model_version\r\n , payment_year\r\n from raw_score\r\n\r\n)\r\n\r\n/*\r\n Grouping by patient to create a single row per patient.\r\n*/\r\n, transition_scores_grouped as (\r\n\r\n select\r\n patient_id\r\n , max(v24_risk_score) as v24_risk_score\r\n , max(v28_risk_score) as v28_risk_score\r\n , payment_year\r\n from transition_scores\r\n group by\r\n patient_id\r\n , payment_year\r\n\r\n)\r\n\r\n, blended as (\r\n\r\n select\r\n patient_id\r\n , v24_risk_score\r\n , v28_risk_score\r\n , v24_risk_score + v28_risk_score as blended_risk_score\r\n , payment_year\r\n from transition_scores_grouped\r\n\r\n)\r\n\r\n, normalized as (\r\n\r\n select\r\n blended.patient_id\r\n , blended.v24_risk_score\r\n , blended.v28_risk_score\r\n , blended.blended_risk_score\r\n , blended.blended_risk_score / seed_adjustment_rates.normalization_factor as normalized_risk_score\r\n , blended.payment_year\r\n from blended\r\n left join seed_adjustment_rates\r\n on blended.payment_year = seed_adjustment_rates.payment_year\r\n\r\n)\r\n\r\n, payment as (\r\n\r\n select\r\n normalized.patient_id\r\n , normalized.v24_risk_score\r\n , normalized.v28_risk_score\r\n , normalized.blended_risk_score\r\n , normalized.normalized_risk_score\r\n , normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as payment_risk_score\r\n , normalized.payment_year\r\n from normalized\r\n left join seed_adjustment_rates\r\n on normalized.payment_year = seed_adjustment_rates.payment_year\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , round(cast(v24_risk_score as {{ dbt.type_numeric() }}),3) as v24_risk_score\r\n , round(cast(v28_risk_score as {{ dbt.type_numeric() }}),3) as v28_risk_score\r\n , round(cast(blended_risk_score as {{ dbt.type_numeric() }}),3) as blended_risk_score\r\n , round(cast(normalized_risk_score as {{ dbt.type_numeric() }}),3) as normalized_risk_score\r\n , round(cast(payment_risk_score as {{ dbt.type_numeric() }}),3) as payment_risk_score\r\n , cast(payment_year as integer) as payment_year\r\n from payment\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , v24_risk_score\r\n , v28_risk_score\r\n , blended_risk_score\r\n , normalized_risk_score\r\n , payment_risk_score\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__adjustment_rates", "package": null, "version": null}, {"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["seed.the_tuva_project.cms_hcc__adjustment_rates", "model.the_tuva_project.cms_hcc__patient_risk_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_scores.sql", "compiled": true, "compiled_code": "\nwith seed_adjustment_rates as (\n\n select\n model_version\n , payment_year\n , normalization_factor\n , ma_coding_pattern_adjustment\n from dev_thuxuan.cms_hcc._value_set_adjustment_rates\n\n)\n\n, risk_factors as (\n\n select\n patient_id\n , coefficient\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc.patient_risk_factors\n\n)\n\n, raw_score as (\n\n select\n patient_id\n , sum(coefficient) as risk_score\n , model_version\n , payment_year\n from risk_factors\n group by\n patient_id\n , model_version\n , payment_year\n\n)\n\n/*\n CMS Guidance for the transition from v24 to v28:\n\n PY2024 risk scores will be blended using 67% of the risk score calculated\n from v24 and 33% from v28.\n\n PY2025 risk scores will be blended using 33% of the risk score calculated\n from v24 and 67% from v28.\n\n PY2026 risk scores will be 100% from v28.\n\n Prior payment years will still be calculated from v24 only.\n*/\n, transition_scores as (\n\n select\n patient_id\n , risk_score\n , case\n when payment_year <= 2023 and model_version = 'CMS-HCC-V24' then risk_score\n when payment_year = 2024 and model_version = 'CMS-HCC-V24' then risk_score * 0.67\n when payment_year = 2025 and model_version = 'CMS-HCC-V24' then risk_score * 0.33\n when payment_year >= 2026 and model_version = 'CMS-HCC-V24' then 0\n end as v24_risk_score\n , case\n when payment_year <= 2023 and model_version = 'CMS-HCC-V28' then 0\n when payment_year = 2024 and model_version = 'CMS-HCC-V28' then risk_score * 0.33\n when payment_year = 2025 and model_version = 'CMS-HCC-V28' then risk_score * 0.67\n when payment_year >= 2026 and model_version = 'CMS-HCC-V28' then risk_score\n end as v28_risk_score\n , model_version\n , payment_year\n from raw_score\n\n)\n\n/*\n Grouping by patient to create a single row per patient.\n*/\n, transition_scores_grouped as (\n\n select\n patient_id\n , max(v24_risk_score) as v24_risk_score\n , max(v28_risk_score) as v28_risk_score\n , payment_year\n from transition_scores\n group by\n patient_id\n , payment_year\n\n)\n\n, blended as (\n\n select\n patient_id\n , v24_risk_score\n , v28_risk_score\n , v24_risk_score + v28_risk_score as blended_risk_score\n , payment_year\n from transition_scores_grouped\n\n)\n\n, normalized as (\n\n select\n blended.patient_id\n , blended.v24_risk_score\n , blended.v28_risk_score\n , blended.blended_risk_score\n , blended.blended_risk_score / seed_adjustment_rates.normalization_factor as normalized_risk_score\n , blended.payment_year\n from blended\n left join seed_adjustment_rates\n on blended.payment_year = seed_adjustment_rates.payment_year\n\n)\n\n, payment as (\n\n select\n normalized.patient_id\n , normalized.v24_risk_score\n , normalized.v28_risk_score\n , normalized.blended_risk_score\n , normalized.normalized_risk_score\n , normalized.normalized_risk_score * (1 - seed_adjustment_rates.ma_coding_pattern_adjustment) as payment_risk_score\n , normalized.payment_year\n from normalized\n left join seed_adjustment_rates\n on normalized.payment_year = seed_adjustment_rates.payment_year\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , round(cast(v24_risk_score as numeric(28,6)),3) as v24_risk_score\n , round(cast(v28_risk_score as numeric(28,6)),3) as v28_risk_score\n , round(cast(blended_risk_score as numeric(28,6)),3) as blended_risk_score\n , round(cast(normalized_risk_score as numeric(28,6)),3) as normalized_risk_score\n , round(cast(payment_risk_score as numeric(28,6)),3) as payment_risk_score\n , cast(payment_year as integer) as payment_year\n from payment\n\n)\n\nselect\n patient_id\n , v24_risk_score\n , v28_risk_score\n , blended_risk_score\n , normalized_risk_score\n , payment_risk_score\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_demographic_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_demographic_factors"], "alias": "_int_demographic_factors", "checksum": {"name": "sha256", "checksum": "1995fd5afcd5d0be7b7fd04ea806beecbecee294c92e57a761a2d173b74f5e96"}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_demographic_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0481496, "relation_name": "dev_thuxuan.cms_hcc._int_demographic_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith members as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , payment_year\r\n from {{ ref('cms_hcc__int_members') }}\r\n\r\n)\r\n\r\n, seed_demographic_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , coefficient\r\n from {{ ref('cms_hcc__demographic_factors') }}\r\n where plan_segment is null /* data not available */\r\n\r\n)\r\n\r\n, v24_new_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.orec = seed_demographic_factors.orec\r\n where members.enrollment_status = 'New'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\r\n\r\n)\r\n\r\n, v24_continuining_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.dual_status = seed_demographic_factors.dual_status\r\n and members.orec = seed_demographic_factors.orec\r\n and members.institutional_status = seed_demographic_factors.institutional_status\r\n where members.enrollment_status = 'Continuing'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\r\n\r\n)\r\n\r\n, v28_new_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.orec = seed_demographic_factors.orec\r\n where members.enrollment_status = 'New'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\r\n\r\n)\r\n\r\n, v28_continuining_enrollees as (\r\n\r\n select\r\n members.patient_id\r\n , members.enrollment_status\r\n , members.gender\r\n , members.age_group\r\n , members.medicaid_status\r\n , members.dual_status\r\n , members.orec\r\n , members.institutional_status\r\n , members.enrollment_status_default\r\n , members.medicaid_dual_status_default\r\n , members.orec_default\r\n , members.institutional_status_default\r\n , members.payment_year\r\n , seed_demographic_factors.model_version\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.dual_status = seed_demographic_factors.dual_status\r\n and members.orec = seed_demographic_factors.orec\r\n and members.institutional_status = seed_demographic_factors.institutional_status\r\n where members.enrollment_status = 'Continuing'\r\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from v24_new_enrollees\r\n union all\r\n select * from v24_continuining_enrollees\r\n union all\r\n select * from v28_new_enrollees\r\n union all\r\n select * from v28_continuining_enrollees\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}, {"name": "cms_hcc__demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "compiled": true, "compiled_code": "\n\nwith members as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , payment_year\n from dev_thuxuan.cms_hcc._int_members\n\n)\n\n, seed_demographic_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_demographic_factors\n where plan_segment is null /* data not available */\n\n)\n\n, v24_new_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\n\n)\n\n, v24_continuining_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n and seed_demographic_factors.model_version = 'CMS-HCC-V24'\n\n)\n\n, v28_new_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\n\n)\n\n, v28_continuining_enrollees as (\n\n select\n members.patient_id\n , members.enrollment_status\n , members.gender\n , members.age_group\n , members.medicaid_status\n , members.dual_status\n , members.orec\n , members.institutional_status\n , members.enrollment_status_default\n , members.medicaid_dual_status_default\n , members.orec_default\n , members.institutional_status_default\n , members.payment_year\n , seed_demographic_factors.model_version\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n and seed_demographic_factors.model_version = 'CMS-HCC-V28'\n\n)\n\n, unioned as (\n\n select * from v24_new_enrollees\n union all\n select * from v24_continuining_enrollees\n union all\n select * from v28_new_enrollees\n union all\n select * from v28_continuining_enrollees\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disabled_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disabled_interaction_factors"], "alias": "_int_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "bb7334a46c4c24e1b5ec730fea92ae01b26f86829fcd3b9c6f3cb214fcc23f5e"}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disabled_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0528235, "relation_name": "dev_thuxuan.cms_hcc._int_disabled_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code\r\n , coefficient\r\n from {{ ref('cms_hcc__disabled_interaction_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, interactions as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors\r\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\r\n and demographics_with_hccs.model_version = seed_interaction_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\nfrom interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disabled_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disabled_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disabled_interaction_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, interactions as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\n and demographics_with_hccs.model_version = seed_interaction_factors.model_version\n\n)\n\n, add_data_types as (\n\nselect\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disease_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_factors"], "alias": "_int_disease_factors", "checksum": {"name": "sha256", "checksum": "60cc48c746b9acb0f084556be562643b95bf8c385a39f02666dfd29d103b4d7c"}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0599043, "relation_name": "dev_thuxuan.cms_hcc._int_disease_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_disease_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , hcc_code\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.gender\r\n , demographics.age_group\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, disease_factors as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.hcc_code\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , seed_disease_factors.factor_type\r\n , seed_disease_factors.description\r\n , seed_disease_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_disease_factors\r\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\r\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\r\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\r\n and demographics_with_hccs.orec = seed_disease_factors.orec\r\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\r\n and demographics_with_hccs.model_version = seed_disease_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(description as {{ dbt.type_string() }}) as hcc_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_factors\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disease_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.gender\n , demographics.age_group\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, disease_factors as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.hcc_code\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , seed_disease_factors.factor_type\n , seed_disease_factors.description\n , seed_disease_factors.coefficient\n from demographics_with_hccs\n inner join seed_disease_factors\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\n and demographics_with_hccs.orec = seed_disease_factors.orec\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\n and demographics_with_hccs.model_version = seed_disease_factors.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code as TEXT) as hcc_code\n , cast(description as TEXT) as hcc_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_disease_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_interaction_factors"], "alias": "_int_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "77782562a534045d65be9e12788f9a96823f349ae7654c3ff6780ce1e7248062"}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0649076, "relation_name": "dev_thuxuan.cms_hcc._int_disease_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code_1\r\n , hcc_code_2\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_interaction_factors') }}\r\n\r\n)\r\n\r\n, demographics_with_hccs as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , hcc_hierarchy.hcc_code\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n, demographics_with_interactions as (\r\n\r\n select\r\n demographics_with_hccs.patient_id\r\n , demographics_with_hccs.model_version\r\n , demographics_with_hccs.payment_year\r\n , interactions_code_1.factor_type\r\n , interactions_code_1.description\r\n , interactions_code_1.hcc_code_1\r\n , interactions_code_1.hcc_code_2\r\n , interactions_code_1.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors as interactions_code_1\r\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\r\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\r\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\r\n and demographics_with_hccs.orec = interactions_code_1.orec\r\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\r\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\r\n and demographics_with_hccs.model_version = interactions_code_1.model_version\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n demographics_with_interactions.patient_id\r\n , demographics_with_interactions.factor_type\r\n , demographics_with_interactions.hcc_code_1\r\n , demographics_with_interactions.hcc_code_2\r\n , demographics_with_interactions.description\r\n , demographics_with_interactions.coefficient\r\n , demographics_with_interactions.model_version\r\n , demographics_with_interactions.payment_year\r\n from demographics_with_interactions\r\n inner join demographics_with_hccs as interactions_code_2\r\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\r\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\r\n and demographics_with_interactions.model_version = interactions_code_2.model_version\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code_1 as {{ dbt.type_string() }}) as hcc_code_1\r\n , cast(hcc_code_2 as {{ dbt.type_string() }}) as hcc_code_2\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code_1\r\n , hcc_code_2\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}, {"name": "cms_hcc__disease_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_disease_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , short_name\n , description\n , hcc_code_1\n , hcc_code_2\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_disease_interaction_factors\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n\n)\n\n, demographics_with_interactions as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , interactions_code_1.factor_type\n , interactions_code_1.description\n , interactions_code_1.hcc_code_1\n , interactions_code_1.hcc_code_2\n , interactions_code_1.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors as interactions_code_1\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\n and demographics_with_hccs.orec = interactions_code_1.orec\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\n and demographics_with_hccs.model_version = interactions_code_1.model_version\n\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\n , demographics_with_interactions.factor_type\n , demographics_with_interactions.hcc_code_1\n , demographics_with_interactions.hcc_code_2\n , demographics_with_interactions.description\n , demographics_with_interactions.coefficient\n , demographics_with_interactions.model_version\n , demographics_with_interactions.payment_year\n from demographics_with_interactions\n inner join demographics_with_hccs as interactions_code_2\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\n and demographics_with_interactions.model_version = interactions_code_2.model_version\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code_1 as TEXT) as hcc_code_1\n , cast(hcc_code_2 as TEXT) as hcc_code_2\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_eligible_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_eligible_conditions"], "alias": "_int_eligible_conditions", "checksum": {"name": "sha256", "checksum": "44306b4f6eede93be3d7b6eb2d26d7983a68d54b0c24d303cd9e5086da0badc4"}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_eligible_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0686014, "relation_name": "dev_thuxuan.cms_hcc._int_eligible_conditions", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for staging condition data:\r\n 1) Filter to risk-adjustable claims per claim type for the collection year.\r\n 2) Gather diagnosis codes from condition for the eligible claims.\r\n 3) Map and filter diagnosis codes to HCCs\r\n\r\nClaims filtering logic:\r\n - Professional:\r\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\r\n - Inpatient:\r\n - Bill type code in (11X, 41X)\r\n - Outpatient:\r\n - Bill type code in (12X, 13X, 43X, 71X, 73X, 76X, 77X, 85X)\r\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\r\n\r\nJinja is used to set payment year variable.\r\n - The payment_year var has been set here so it gets compiled.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set payment_year = var('cms_hcc_payment_year') | int() -%}\r\n{% set collection_year = payment_year - 1 -%}\r\n\r\nwith medical_claims as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , bill_type_code\r\n , hcpcs_code\r\n from {{ ref('cms_hcc__stg_core__medical_claim') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n claim_id\r\n , patient_id\r\n , code\r\n from {{ ref('cms_hcc__stg_core__condition') }}\r\n where code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, cpt_hcpcs_list as (\r\n\r\n select\r\n payment_year\r\n , hcpcs_cpt_code\r\n from {{ ref('cms_hcc__cpt_hcpcs') }}\r\n\r\n)\r\n\r\n, professional_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n inner join cpt_hcpcs_list\r\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\r\n where claim_type = 'professional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and cpt_hcpcs_list.payment_year = {{ payment_year }}\r\n\r\n)\r\n\r\n, inpatient_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n where claim_type = 'institutional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and left(bill_type_code,2) in ('11','41')\r\n\r\n)\r\n\r\n, outpatient_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n inner join cpt_hcpcs_list\r\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\r\n where claim_type = 'institutional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and cpt_hcpcs_list.payment_year = {{ payment_year }}\r\n and left(bill_type_code,2) in ('12','13','43','71','73','76','77','85')\r\n\r\n)\r\n\r\n, eligible_claims as (\r\n\r\n select * from professional_claims\r\n union all\r\n select * from inpatient_claims\r\n union all\r\n select * from outpatient_claims\r\n\r\n)\r\n\r\n, eligible_conditions as (\r\n\r\n select distinct\r\n eligible_claims.claim_id\r\n , eligible_claims.patient_id\r\n , conditions.code\r\n from eligible_claims\r\n inner join conditions\r\n on eligible_claims.claim_id = conditions.claim_id\r\n and eligible_claims.patient_id = conditions.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(code as {{ dbt.type_string() }}) as condition_code\r\n , cast('{{ payment_year }}' as integer) as payment_year\r\n from eligible_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__stg_core__medical_claim", "package": null, "version": null}, {"name": "cms_hcc__stg_core__condition", "package": null, "version": null}, {"name": "cms_hcc__cpt_hcpcs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "compiled": true, "compiled_code": "\n/*\nSteps for staging condition data:\n 1) Filter to risk-adjustable claims per claim type for the collection year.\n 2) Gather diagnosis codes from condition for the eligible claims.\n 3) Map and filter diagnosis codes to HCCs\n\nClaims filtering logic:\n - Professional:\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n - Inpatient:\n - Bill type code in (11X, 41X)\n - Outpatient:\n - Bill type code in (12X, 13X, 43X, 71X, 73X, 76X, 77X, 85X)\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n\nJinja is used to set payment year variable.\n - The payment_year var has been set here so it gets compiled.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n), __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n),medical_claims as (\n\n select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n from __dbt__cte__cms_hcc__stg_core__medical_claim\n\n)\n\n, conditions as (\n\n select\n claim_id\n , patient_id\n , code\n from __dbt__cte__cms_hcc__stg_core__condition\n where code_type = 'icd-10-cm'\n\n)\n\n, cpt_hcpcs_list as (\n\n select\n payment_year\n , hcpcs_cpt_code\n from dev_thuxuan.cms_hcc._value_set_cpt_hcpcs\n\n)\n\n, professional_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n inner join cpt_hcpcs_list\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\n where claim_type = 'professional'\n and extract(year from claim_end_date) = 2023\n and cpt_hcpcs_list.payment_year = 2024\n\n)\n\n, inpatient_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n where claim_type = 'institutional'\n and extract(year from claim_end_date) = 2023\n and left(bill_type_code,2) in ('11','41')\n\n)\n\n, outpatient_claims as (\n\n select\n medical_claims.claim_id\n , medical_claims.claim_line_number\n , medical_claims.claim_type\n , medical_claims.patient_id\n , medical_claims.claim_start_date\n , medical_claims.claim_end_date\n , medical_claims.bill_type_code\n , medical_claims.hcpcs_code\n from medical_claims\n inner join cpt_hcpcs_list\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\n where claim_type = 'institutional'\n and extract(year from claim_end_date) = 2023\n and cpt_hcpcs_list.payment_year = 2024\n and left(bill_type_code,2) in ('12','13','43','71','73','76','77','85')\n\n)\n\n, eligible_claims as (\n\n select * from professional_claims\n union all\n select * from inpatient_claims\n union all\n select * from outpatient_claims\n\n)\n\n, eligible_conditions as (\n\n select distinct\n eligible_claims.claim_id\n , eligible_claims.patient_id\n , conditions.code\n from eligible_claims\n inner join conditions\n on eligible_claims.claim_id = conditions.claim_id\n and eligible_claims.patient_id = conditions.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(code as TEXT) as condition_code\n , cast('2024' as integer) as payment_year\n from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "sql": " __dbt__cte__cms_hcc__stg_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__condition", "sql": " __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_enrollment_interaction_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_enrollment_interaction_factors"], "alias": "_int_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "1da4291b9f54c5779672c3849bf0113ca14c1b9589d340e7e227ed4022b2ba78"}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_enrollment_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0746067, "relation_name": "dev_thuxuan.cms_hcc._int_enrollment_interaction_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , gender\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , institutional_status\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\r\n\r\n)\r\n\r\n/*\r\n Originally disabled interactions for non-institutional members >= 65\r\n*/\r\n, non_institutional_interactions as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.gender = seed_interaction_factors.gender\r\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\r\n and demographics.dual_status = seed_interaction_factors.dual_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics.model_version = seed_interaction_factors.model_version\r\n where demographics.institutional_status = 'No'\r\n and demographics.orec = 'Disabled'\r\n and demographics.age_group in (\r\n '65-69'\r\n , '70-74'\r\n , '75-79'\r\n , '80-84'\r\n , '85-89'\r\n , '90-94'\r\n , '>=95'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Medicaid interactions for institutional members\r\n*/\r\n, institutional_interactions as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics.model_version = seed_interaction_factors.model_version\r\n where demographics.institutional_status = 'Yes'\r\n and demographics.medicaid_status = 'Yes'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from non_institutional_interactions\r\n union all\r\n select * from institutional_interactions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__enrollment_interaction_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , institutional_status\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_enrollment_interaction_factors\n\n)\n\n/*\n Originally disabled interactions for non-institutional members >= 65\n*/\n, non_institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.gender = seed_interaction_factors.gender\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\n and demographics.dual_status = seed_interaction_factors.dual_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n and demographics.model_version = seed_interaction_factors.model_version\n where demographics.institutional_status = 'No'\n and demographics.orec = 'Disabled'\n and demographics.age_group in (\n '65-69'\n , '70-74'\n , '75-79'\n , '80-84'\n , '85-89'\n , '90-94'\n , '>=95'\n )\n\n)\n\n/*\n Medicaid interactions for institutional members\n*/\n, institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n and demographics.model_version = seed_interaction_factors.model_version\n where demographics.institutional_status = 'Yes'\n and demographics.medicaid_status = 'Yes'\n\n)\n\n, unioned as (\n\n select * from non_institutional_interactions\n union all\n select * from institutional_interactions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_count_factors", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_count_factors"], "alias": "_int_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "57f02526327cfa6caad5937fc0bdbab5f920ddc66be0eb606788ea916a572a29"}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_count_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0797138, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_count_factors", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith demographics as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, seed_payment_hcc_count_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , payment_hcc_count\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__payment_hcc_count_factors') }}\r\n\r\n)\r\n\r\n, hcc_hierarchy as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\r\n\r\n)\r\n\r\n, demographics_with_hcc_counts as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , count(hcc_hierarchy.hcc_code) as hcc_count\r\n from demographics\r\n inner join hcc_hierarchy\r\n on demographics.patient_id = hcc_hierarchy.patient_id\r\n and demographics.model_version = hcc_hierarchy.model_version\r\n group by\r\n demographics.patient_id\r\n , demographics.enrollment_status\r\n , demographics.medicaid_status\r\n , demographics.dual_status\r\n , demographics.orec\r\n , demographics.institutional_status\r\n , demographics.model_version\r\n , demographics.payment_year\r\n\r\n)\r\n\r\n, hcc_counts_normalized as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , model_version\r\n , payment_year\r\n , case\r\n when hcc_count >= 10 then '>=10'\r\n else cast(hcc_count as {{ dbt.type_string() }})\r\n end as hcc_count_string\r\n from demographics_with_hcc_counts\r\n\r\n)\r\n\r\n, hcc_counts as (\r\n\r\n select\r\n hcc_counts_normalized.patient_id\r\n , hcc_counts_normalized.model_version\r\n , hcc_counts_normalized.payment_year\r\n , seed_payment_hcc_count_factors.factor_type\r\n , seed_payment_hcc_count_factors.description\r\n , seed_payment_hcc_count_factors.coefficient\r\n from hcc_counts_normalized\r\n inner join seed_payment_hcc_count_factors\r\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\r\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\r\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\r\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\r\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\r\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\r\n and hcc_counts_normalized.model_version = seed_payment_hcc_count_factors.model_version\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from hcc_counts\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}, {"name": "cms_hcc__payment_hcc_count_factors", "package": null, "version": null}, {"name": "cms_hcc__int_hcc_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_count_factors.sql", "compiled": true, "compiled_code": "\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_demographic_factors\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from dev_thuxuan.cms_hcc._value_set_payment_hcc_count_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n , model_version\n from dev_thuxuan.cms_hcc._int_hcc_hierarchy\n\n)\n\n, demographics_with_hcc_counts as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , count(hcc_hierarchy.hcc_code) as hcc_count\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n and demographics.model_version = hcc_hierarchy.model_version\n group by\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n\n)\n\n, hcc_counts_normalized as (\n\n select\n patient_id\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n , case\n when hcc_count >= 10 then '>=10'\n else cast(hcc_count as TEXT)\n end as hcc_count_string\n from demographics_with_hcc_counts\n\n)\n\n, hcc_counts as (\n\n select\n hcc_counts_normalized.patient_id\n , hcc_counts_normalized.model_version\n , hcc_counts_normalized.payment_year\n , seed_payment_hcc_count_factors.factor_type\n , seed_payment_hcc_count_factors.description\n , seed_payment_hcc_count_factors.coefficient\n from hcc_counts_normalized\n inner join seed_payment_hcc_count_factors\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\n and hcc_counts_normalized.model_version = seed_payment_hcc_count_factors.model_version\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_hierarchy", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_hierarchy"], "alias": "_int_hcc_hierarchy", "checksum": {"name": "sha256", "checksum": "f47263e7e8e60e98764011666f8b61adb8c85f3ce58114b85171c23c599cffc9"}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_hierarchy", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0842824, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_hierarchy", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Staging HCCs that will be used in disease factor calculations.\r\n Final output for each CMS model version includes:\r\n - hccs without a hierarchy\r\n - lower-level hccs with hierarchy where top-level hcc is missing\r\n - top-level hccs from hierarchy\r\n*/\r\n\r\nwith hcc_mapping as (\r\n\r\n select distinct\r\n patient_id\r\n , hcc_code\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_hcc_mapping') }}\r\n\r\n)\r\n\r\n, seed_hcc_hierarchy as (\r\n\r\n select\r\n model_version\r\n , hcc_code\r\n , description\r\n , hccs_to_exclude\r\n from {{ ref('cms_hcc__disease_hierarchy') }}\r\n\r\n)\r\n\r\n/*\r\n selecting hccs that do not have a hierarchy\r\n all codes in this cte are included in final output\r\n*/\r\n, hccs_without_hierarchy as (\r\n\r\n select distinct\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n from hcc_mapping\r\n left join seed_hcc_hierarchy as hcc_top_level\r\n on hcc_mapping.hcc_code = hcc_top_level.hcc_code\r\n and hcc_mapping.model_version = hcc_top_level.model_version\r\n left join seed_hcc_hierarchy as hcc_exclusions\r\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\r\n and hcc_mapping.model_version = hcc_exclusions.model_version\r\n where hcc_top_level.hcc_code is null\r\n and hcc_exclusions.hccs_to_exclude is null\r\n\r\n)\r\n\r\n/*\r\n selecting hccs that have a hierarchy to be evaluated in the next cte\r\n*/\r\n, hccs_with_hierarchy as (\r\n\r\n select\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n , seed_hcc_hierarchy.hcc_code as top_level_hcc\r\n from hcc_mapping\r\n inner join seed_hcc_hierarchy\r\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hccs_to_exclude\r\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\r\n\r\n)\r\n\r\n/*\r\n applying hcc hierarchy and grouping by patient and hcc\r\n to account for multiple hcc combinations\r\n minimum HCC is included following CMS's severity logic\r\n*/\r\n, hierarchy_applied as (\r\n\r\n select\r\n hccs_with_hierarchy.patient_id\r\n , hccs_with_hierarchy.model_version\r\n , hccs_with_hierarchy.payment_year\r\n , hccs_with_hierarchy.hcc_code\r\n , min(hcc_mapping.hcc_code) as top_level_hcc\r\n from hccs_with_hierarchy\r\n left join hcc_mapping\r\n on hcc_mapping.patient_id = hccs_with_hierarchy.patient_id\r\n and hcc_mapping.hcc_code = hccs_with_hierarchy.top_level_hcc\r\n and hcc_mapping.model_version = hccs_with_hierarchy.model_version\r\n group by\r\n hccs_with_hierarchy.patient_id\r\n , hccs_with_hierarchy.model_version\r\n , hccs_with_hierarchy.payment_year\r\n , hccs_with_hierarchy.hcc_code\r\n\r\n)\r\n\r\n/*\r\n selecting lower-level hccs in hierarchy\r\n all codes in this cte are included in final output\r\n*/\r\n, lower_level_inclusions as (\r\n\r\n select distinct\r\n patient_id\r\n , model_version\r\n , payment_year\r\n , case\r\n when top_level_hcc is not null then top_level_hcc\r\n else hcc_code\r\n end as hcc_code\r\n from hierarchy_applied\r\n\r\n)\r\n\r\n/*\r\n selecting top-level hccs not in previous steps\r\n all codes in this cte are included in final output\r\n*/\r\n, top_level_inclusions as (\r\n\r\n select distinct\r\n hcc_mapping.patient_id\r\n , hcc_mapping.model_version\r\n , hcc_mapping.payment_year\r\n , hcc_mapping.hcc_code\r\n from hcc_mapping\r\n inner join seed_hcc_hierarchy\r\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hcc_code\r\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\r\n left join lower_level_inclusions\r\n on hcc_mapping.patient_id = lower_level_inclusions.patient_id\r\n and hcc_mapping.hcc_code = lower_level_inclusions.hcc_code\r\n and hcc_mapping.model_version = lower_level_inclusions.model_version\r\n left join hierarchy_applied\r\n on hcc_mapping.patient_id = hierarchy_applied.patient_id\r\n and hcc_mapping.hcc_code = hierarchy_applied.hcc_code\r\n and hcc_mapping.model_version = hierarchy_applied.model_version\r\n where lower_level_inclusions.hcc_code is null\r\n and hierarchy_applied.top_level_hcc is null\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from hccs_without_hierarchy\r\n union all\r\n select * from lower_level_inclusions\r\n union all\r\n select * from top_level_inclusions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , model_version\r\n , payment_year\r\n , hcc_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_hcc_mapping", "package": null, "version": null}, {"name": "cms_hcc__disease_hierarchy", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_hierarchy.sql", "compiled": true, "compiled_code": "\n/*\n Staging HCCs that will be used in disease factor calculations.\n Final output for each CMS model version includes:\n - hccs without a hierarchy\n - lower-level hccs with hierarchy where top-level hcc is missing\n - top-level hccs from hierarchy\n*/\n\nwith hcc_mapping as (\n\n select distinct\n patient_id\n , hcc_code\n , model_version\n , payment_year\n from dev_thuxuan.cms_hcc._int_hcc_mapping\n\n)\n\n, seed_hcc_hierarchy as (\n\n select\n model_version\n , hcc_code\n , description\n , hccs_to_exclude\n from dev_thuxuan.cms_hcc._value_set_disease_hierarchy\n\n)\n\n/*\n selecting hccs that do not have a hierarchy\n all codes in this cte are included in final output\n*/\n, hccs_without_hierarchy as (\n\n select distinct\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n from hcc_mapping\n left join seed_hcc_hierarchy as hcc_top_level\n on hcc_mapping.hcc_code = hcc_top_level.hcc_code\n and hcc_mapping.model_version = hcc_top_level.model_version\n left join seed_hcc_hierarchy as hcc_exclusions\n on hcc_mapping.hcc_code = hcc_exclusions.hccs_to_exclude\n and hcc_mapping.model_version = hcc_exclusions.model_version\n where hcc_top_level.hcc_code is null\n and hcc_exclusions.hccs_to_exclude is null\n\n)\n\n/*\n selecting hccs that have a hierarchy to be evaluated in the next cte\n*/\n, hccs_with_hierarchy as (\n\n select\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n , seed_hcc_hierarchy.hcc_code as top_level_hcc\n from hcc_mapping\n inner join seed_hcc_hierarchy\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hccs_to_exclude\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\n\n)\n\n/*\n applying hcc hierarchy and grouping by patient and hcc\n to account for multiple hcc combinations\n minimum HCC is included following CMS's severity logic\n*/\n, hierarchy_applied as (\n\n select\n hccs_with_hierarchy.patient_id\n , hccs_with_hierarchy.model_version\n , hccs_with_hierarchy.payment_year\n , hccs_with_hierarchy.hcc_code\n , min(hcc_mapping.hcc_code) as top_level_hcc\n from hccs_with_hierarchy\n left join hcc_mapping\n on hcc_mapping.patient_id = hccs_with_hierarchy.patient_id\n and hcc_mapping.hcc_code = hccs_with_hierarchy.top_level_hcc\n and hcc_mapping.model_version = hccs_with_hierarchy.model_version\n group by\n hccs_with_hierarchy.patient_id\n , hccs_with_hierarchy.model_version\n , hccs_with_hierarchy.payment_year\n , hccs_with_hierarchy.hcc_code\n\n)\n\n/*\n selecting lower-level hccs in hierarchy\n all codes in this cte are included in final output\n*/\n, lower_level_inclusions as (\n\n select distinct\n patient_id\n , model_version\n , payment_year\n , case\n when top_level_hcc is not null then top_level_hcc\n else hcc_code\n end as hcc_code\n from hierarchy_applied\n\n)\n\n/*\n selecting top-level hccs not in previous steps\n all codes in this cte are included in final output\n*/\n, top_level_inclusions as (\n\n select distinct\n hcc_mapping.patient_id\n , hcc_mapping.model_version\n , hcc_mapping.payment_year\n , hcc_mapping.hcc_code\n from hcc_mapping\n inner join seed_hcc_hierarchy\n on hcc_mapping.hcc_code = seed_hcc_hierarchy.hcc_code\n and hcc_mapping.model_version = seed_hcc_hierarchy.model_version\n left join lower_level_inclusions\n on hcc_mapping.patient_id = lower_level_inclusions.patient_id\n and hcc_mapping.hcc_code = lower_level_inclusions.hcc_code\n and hcc_mapping.model_version = lower_level_inclusions.model_version\n left join hierarchy_applied\n on hcc_mapping.patient_id = hierarchy_applied.patient_id\n and hcc_mapping.hcc_code = hierarchy_applied.hcc_code\n and hcc_mapping.model_version = hierarchy_applied.model_version\n where lower_level_inclusions.hcc_code is null\n and hierarchy_applied.top_level_hcc is null\n\n)\n\n, unioned as (\n\n select * from hccs_without_hierarchy\n union all\n select * from lower_level_inclusions\n union all\n select * from top_level_inclusions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n , cast(hcc_code as TEXT) as hcc_code\n from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_hcc_mapping", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_mapping"], "alias": "_int_hcc_mapping", "checksum": {"name": "sha256", "checksum": "f4dfeb0c413b50052d2bd251d4a35dde91c85e0004400911b8f36979cf651839"}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_mapping", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0894575, "relation_name": "dev_thuxuan.cms_hcc._int_hcc_mapping", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for staging the medical claim data:\r\n 1) Filter to risk-adjustable claims per claim type for the collection year.\r\n 2) Gather diagnosis codes from Condition for the eligible claims.\r\n 3) Map and filter diagnosis codes to HCCs for each CMS model version\r\n 4) Union results from each CMS model version\r\n (note: some payment years may not have results for v28)\r\n*/\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , condition_code\r\n , payment_year\r\n from {{ ref('cms_hcc__int_eligible_conditions') }}\r\n\r\n)\r\n\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n payment_year\r\n , diagnosis_code\r\n , cms_hcc_v24\r\n , cms_hcc_v24_flag\r\n , cms_hcc_v28\r\n , cms_hcc_v28_flag\r\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\r\n\r\n)\r\n\r\n/* casting hcc_code to avoid formatting changes during union */\r\n, v24_mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.payment_year\r\n , 'CMS-HCC-V24' as model_version\r\n , cast(seed_hcc_mapping.cms_hcc_v24 as {{ dbt.type_string() }}) as hcc_code\r\n from conditions\r\n inner join seed_hcc_mapping\r\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\r\n and conditions.payment_year = seed_hcc_mapping.payment_year\r\n where cms_hcc_v24_flag = 'Yes'\r\n\r\n)\r\n\r\n, v28_mapped as (\r\n\r\n select distinct\r\n conditions.patient_id\r\n , conditions.condition_code\r\n , conditions.payment_year\r\n , 'CMS-HCC-V28' as model_version\r\n , cast(seed_hcc_mapping.cms_hcc_v28 as {{ dbt.type_string() }}) as hcc_code\r\n from conditions\r\n inner join seed_hcc_mapping\r\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\r\n and conditions.payment_year = seed_hcc_mapping.payment_year\r\n where cms_hcc_v28_flag = 'Yes'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from v24_mapped\r\n union all\r\n select * from v28_mapped\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(condition_code as {{ dbt.type_string() }}) as condition_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , hcc_code\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}, {"name": "cms_hcc__icd_10_cm_mappings", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_hcc_mapping.sql", "compiled": true, "compiled_code": "\n/*\nSteps for staging the medical claim data:\n 1) Filter to risk-adjustable claims per claim type for the collection year.\n 2) Gather diagnosis codes from Condition for the eligible claims.\n 3) Map and filter diagnosis codes to HCCs for each CMS model version\n 4) Union results from each CMS model version\n (note: some payment years may not have results for v28)\n*/\n\nwith conditions as (\n\n select\n patient_id\n , condition_code\n , payment_year\n from dev_thuxuan.cms_hcc._int_eligible_conditions\n\n)\n\n, seed_hcc_mapping as (\n\n select\n payment_year\n , diagnosis_code\n , cms_hcc_v24\n , cms_hcc_v24_flag\n , cms_hcc_v28\n , cms_hcc_v28_flag\n from dev_thuxuan.cms_hcc._value_set_icd_10_cm_mappings\n\n)\n\n/* casting hcc_code to avoid formatting changes during union */\n, v24_mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.payment_year\n , 'CMS-HCC-V24' as model_version\n , cast(seed_hcc_mapping.cms_hcc_v24 as TEXT) as hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\n and conditions.payment_year = seed_hcc_mapping.payment_year\n where cms_hcc_v24_flag = 'Yes'\n\n)\n\n, v28_mapped as (\n\n select distinct\n conditions.patient_id\n , conditions.condition_code\n , conditions.payment_year\n , 'CMS-HCC-V28' as model_version\n , cast(seed_hcc_mapping.cms_hcc_v28 as TEXT) as hcc_code\n from conditions\n inner join seed_hcc_mapping\n on conditions.condition_code = seed_hcc_mapping.diagnosis_code\n and conditions.payment_year = seed_hcc_mapping.payment_year\n where cms_hcc_v28_flag = 'Yes'\n\n)\n\n, unioned as (\n\n select * from v24_mapped\n union all\n select * from v28_mapped\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(condition_code as TEXT) as condition_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__int_members": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__int_members", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_members.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_members", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_members"], "alias": "_int_members", "checksum": {"name": "sha256", "checksum": "526c78057690b21365801969cee4f0530d8821cc1b7174ae80fad3039ef54650"}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\". If available, current Medicare Status is used when OREC is missing.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_members", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.0963767, "relation_name": "dev_thuxuan.cms_hcc._int_members", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\nSteps for transforming eligibility data into member demographics:\r\n 1) Determine enrollment status using eligibility from the collection year.\r\n 2) Roll up to latest eligibility record for enrollment statuses.\r\n 3) Add age groups based on the payment year.\r\n 4) Determine other statuses.\r\n\r\nJinja is used to set payment year variable.\r\n - The payment_year var has been set here so it gets compiled.\r\n - CMS guidance: Age is calculated as of Feb 1 of the payment year.\r\n - The collection year is one year prior to the payment year.\r\n*/\r\n\r\n{% set payment_year = var('cms_hcc_payment_year') | int() -%}\r\n{% set payment_year_age_date = payment_year ~ '-02-01' -%}\r\n{% set collection_year = payment_year - 1 -%}\r\n{% set collection_year_start = collection_year ~ '-01-01' -%}\r\n{% set collection_year_end = collection_year ~ '-12-31' -%}\r\n\r\nwith stg_eligibility as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , row_number() over(\r\n partition by patient_id\r\n order by enrollment_end_date desc\r\n ) as row_num /* used to dedupe eligibility */\r\n from {{ ref('cms_hcc__stg_core__eligibility') }}\r\n where (\r\n /* filter to members with eligibility in collection or payment year */\r\n extract(year from enrollment_start_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n or extract(year from enrollment_end_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n )\r\n\r\n)\r\n\r\n, stg_patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\r\n , death_date\r\n from {{ ref('cms_hcc__stg_core__patient') }}\r\n\r\n)\r\n\r\n/* create proxy enrollment dates if outside of the collection year */\r\n, cap_collection_start_end_dates as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , case\r\n when enrollment_start_date < '{{ collection_year_start }}'\r\n then '{{ collection_year_start }}'\r\n else enrollment_start_date\r\n end as proxy_enrollment_start_date\r\n , case\r\n when enrollment_end_date > '{{ collection_year_end }}'\r\n then '{{ collection_year_end }}'\r\n else enrollment_end_date\r\n end as proxy_enrollment_end_date\r\n from stg_eligibility\r\n where (\r\n /* filter to members with eligibility in collection or payment year */\r\n extract(year from enrollment_start_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n or extract(year from enrollment_end_date)\r\n between {{ collection_year }}\r\n and {{ payment_year }}\r\n )\r\n\r\n)\r\n\r\n, calculate_prior_coverage as (\r\n\r\n select patient_id\r\n , sum({{ datediff('proxy_enrollment_start_date', 'proxy_enrollment_end_date', 'month') }} + 1) as coverage_months /* include starting month */\r\n from cap_collection_start_end_dates\r\n group by patient_id\r\n\r\n)\r\n\r\n/*\r\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\r\n 12 months of coverage prior to the payment year.\r\n*/\r\n, add_enrollment as (\r\n\r\n select\r\n patient_id\r\n , case\r\n when coverage_months < 12 then 'New'\r\n else 'Continuing'\r\n end as enrollment_status\r\n from calculate_prior_coverage\r\n\r\n)\r\n\r\n, latest_eligibility as (\r\n\r\n select\r\n stg_eligibility.patient_id\r\n , stg_patient.sex as gender\r\n , stg_patient.payment_year_age\r\n , stg_eligibility.original_reason_entitlement_code\r\n , stg_eligibility.dual_status_code\r\n , stg_eligibility.medicare_status_code\r\n /* Defaulting to \"New\" enrollment status when missing */\r\n , case\r\n when add_enrollment.enrollment_status is null then 'New'\r\n else add_enrollment.enrollment_status\r\n end as enrollment_status\r\n , case\r\n when add_enrollment.enrollment_status is null then TRUE\r\n else FALSE\r\n end as enrollment_status_default\r\n from stg_eligibility\r\n left join add_enrollment\r\n on stg_eligibility.patient_id = add_enrollment.patient_id\r\n left join stg_patient\r\n on stg_eligibility.patient_id = stg_patient.patient_id\r\n where stg_eligibility.row_num = 1\r\n\r\n)\r\n\r\n, add_age_group as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , payment_year_age\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , enrollment_status\r\n , enrollment_status_default\r\n , case\r\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\r\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\r\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\r\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\r\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\r\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\r\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\r\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\r\n end as age_group\r\n from latest_eligibility\r\n\r\n)\r\n\r\n, add_status_logic as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , case\r\n when gender = 'female' then 'Female'\r\n when gender = 'male' then 'Male'\r\n else null\r\n end as gender\r\n , age_group\r\n , case\r\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\r\n else 'No'\r\n end as medicaid_status\r\n , case\r\n when dual_status_code in ('02','04','08') then 'Full'\r\n when dual_status_code in ('01','03','05','06') then 'Partial'\r\n else 'Non'\r\n end as dual_status\r\n /*\r\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\r\n we default to 'Aged'. When OREC is missing, latest Medicare status is\r\n used, if available.\r\n */\r\n , case\r\n when original_reason_entitlement_code in ('0','2') then 'Aged'\r\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\r\n end as orec\r\n /* Defaulting everyone to non-institutional until logic is added */\r\n , cast('No' as {{ dbt.type_string() }}) as institutional_status\r\n , enrollment_status_default\r\n , case\r\n when dual_status_code is null then TRUE\r\n else FALSE\r\n end as medicaid_dual_status_default\r\n /* Setting default true when OREC or Medicare Status is ESRD, or null */\r\n , case\r\n when original_reason_entitlement_code in ('2') then TRUE\r\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\r\n else FALSE\r\n end as orec_default\r\n /* Setting default true until institutional logic is added */\r\n , TRUE as institutional_status_default\r\n from add_age_group\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast('{{ payment_year }}' as integer) as payment_year\r\n from add_status_logic\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "cms_hcc__stg_core__eligibility", "package": null, "version": null}, {"name": "cms_hcc__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "compiled": true, "compiled_code": "\n/*\nSteps for transforming eligibility data into member demographics:\n 1) Determine enrollment status using eligibility from the collection year.\n 2) Roll up to latest eligibility record for enrollment statuses.\n 3) Add age groups based on the payment year.\n 4) Determine other statuses.\n\nJinja is used to set payment year variable.\n - The payment_year var has been set here so it gets compiled.\n - CMS guidance: Age is calculated as of Feb 1 of the payment year.\n - The collection year is one year prior to the payment year.\n*/\n\nwith __dbt__cte__cms_hcc__stg_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n), __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),stg_eligibility as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , row_number() over(\n partition by patient_id\n order by enrollment_end_date desc\n ) as row_num /* used to dedupe eligibility */\n from __dbt__cte__cms_hcc__stg_core__eligibility\n where (\n /* filter to members with eligibility in collection or payment year */\n extract(year from enrollment_start_date)\n between 2023\n and 2024\n or extract(year from enrollment_end_date)\n between 2023\n and 2024\n )\n\n)\n\n, stg_patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n '2024-02-01'\n ) / 8766.0) as payment_year_age\n , death_date\n from __dbt__cte__cms_hcc__stg_core__patient\n\n)\n\n/* create proxy enrollment dates if outside of the collection year */\n, cap_collection_start_end_dates as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '2023-01-01'\n then '2023-01-01'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , case\n when enrollment_end_date > '2023-12-31'\n then '2023-12-31'\n else enrollment_end_date\n end as proxy_enrollment_end_date\n from stg_eligibility\n where (\n /* filter to members with eligibility in collection or payment year */\n extract(year from enrollment_start_date)\n between 2023\n and 2024\n or extract(year from enrollment_end_date)\n between 2023\n and 2024\n )\n\n)\n\n, calculate_prior_coverage as (\n\n select patient_id\n , sum(datediff(\n month,\n proxy_enrollment_start_date,\n proxy_enrollment_end_date\n ) + 1) as coverage_months /* include starting month */\n from cap_collection_start_end_dates\n group by patient_id\n\n)\n\n/*\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\n 12 months of coverage prior to the payment year.\n*/\n, add_enrollment as (\n\n select\n patient_id\n , case\n when coverage_months < 12 then 'New'\n else 'Continuing'\n end as enrollment_status\n from calculate_prior_coverage\n\n)\n\n, latest_eligibility as (\n\n select\n stg_eligibility.patient_id\n , stg_patient.sex as gender\n , stg_patient.payment_year_age\n , stg_eligibility.original_reason_entitlement_code\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\n /* Defaulting to \"New\" enrollment status when missing */\n , case\n when add_enrollment.enrollment_status is null then 'New'\n else add_enrollment.enrollment_status\n end as enrollment_status\n , case\n when add_enrollment.enrollment_status is null then TRUE\n else FALSE\n end as enrollment_status_default\n from stg_eligibility\n left join add_enrollment\n on stg_eligibility.patient_id = add_enrollment.patient_id\n left join stg_patient\n on stg_eligibility.patient_id = stg_patient.patient_id\n where stg_eligibility.row_num = 1\n\n)\n\n, add_age_group as (\n\n select\n patient_id\n , gender\n , payment_year_age\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , enrollment_status\n , enrollment_status_default\n , case\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\n end as age_group\n from latest_eligibility\n\n)\n\n, add_status_logic as (\n\n select\n patient_id\n , enrollment_status\n , case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as gender\n , age_group\n , case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as medicaid_status\n , case\n when dual_status_code in ('02','04','08') then 'Full'\n when dual_status_code in ('01','03','05','06') then 'Partial'\n else 'Non'\n end as dual_status\n /*\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\n we default to 'Aged'. When OREC is missing, latest Medicare status is\n used, if available.\n */\n , case\n when original_reason_entitlement_code in ('0','2') then 'Aged'\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\n end as orec\n /* Defaulting everyone to non-institutional until logic is added */\n , cast('No' as TEXT) as institutional_status\n , enrollment_status_default\n , case\n when dual_status_code is null then TRUE\n else FALSE\n end as medicaid_dual_status_default\n /* Setting default true when OREC or Medicare Status is ESRD, or null */\n , case\n when original_reason_entitlement_code in ('2') then TRUE\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\n else FALSE\n end as orec_default\n /* Setting default true until institutional logic is added */\n , TRUE as institutional_status_default\n from add_age_group\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast('2024' as integer) as payment_year\n from add_status_logic\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , payment_year\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "sql": " __dbt__cte__cms_hcc__stg_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__patient", "sql": " __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__condition", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "8867fe4af76755aeb495d0edd87446e7943e4688de00bd512655636f0716d454"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_condition", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.1008844, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , condition_type\r\n , normalized_code_type as code_type\r\n , normalized_code as code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__eligibility": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "0eda573c42880661c0e42e732798c5864d41fd5e5fdab443892b8ec506c1cd4c"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging eligibility from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_eligibility", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.1049118, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__medical_claim": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "bb40f56f0581df95a17999713976c2d3a483f87b2b2281af9d42641e3ee00e1c"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging medical claims from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_medical_claim", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.1099079, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , bill_type_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.cms_hcc__stg_core__patient": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__patient", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "98d5b5cf2d9f92d235aeba9103659699493db4a97495612137cfb181f30759e2"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging patient from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_patient", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.1139083, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__condition.sql", "original_file_path": "models\\core\\final\\core__condition.sql", "unique_id": "model.the_tuva_project.core__condition", "fqn": ["the_tuva_project", "core", "final", "core__condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "80979edc701ab59d4a58ef12a62387f60485e16f387bb4261d900a5b2ef0e2a6"}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The core condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mapping_method": {"name": "mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "condition", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1319277, "relation_name": "dev_thuxuan.core.condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith all_conditions as (\r\n {% if var('clinical_enabled'\r\n , var('tuva_marts_enabled'\r\n , False)) == true and var('claims_enabled'\r\n , var('tuva_marts_enabled'\r\n , False)) == true -%}\r\n\r\nselect *\r\nfrom {{ ref('core__stg_claims_condition') }}\r\nunion all\r\nselect *\r\nfrom {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect *\r\nfrom {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect *\r\nfrom {{ ref('core__stg_claims_condition') }}\r\n\r\n{%- endif %}\r\n)\r\n\r\n\r\n{# is the default code that gets executed as long as an enable_normalize_engine var is false or not defined #}\r\n{% if var('enable_normalize_engine',false) != true %}\r\nselect\r\n all_conditions.CONDITION_ID\r\n , all_conditions.PATIENT_ID\r\n , all_conditions.ENCOUNTER_ID\r\n , all_conditions.CLAIM_ID\r\n , all_conditions.RECORDED_DATE\r\n , all_conditions.ONSET_DATE\r\n , all_conditions.RESOLVED_DATE\r\n , all_conditions.STATUS\r\n , all_conditions.CONDITION_TYPE\r\n , all_conditions.SOURCE_CODE_TYPE\r\n , all_conditions.SOURCE_CODE\r\n , all_conditions.SOURCE_DESCRIPTION\r\n , case\r\n when all_conditions.NORMALIZED_CODE_TYPE is not null then all_conditions.NORMALIZED_CODE_TYPE\r\n when icd10.icd_10_cm is not null then 'icd-10-cm'\r\n when icd9.icd_9_cm is not null then 'icd-9-cm'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n else null end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n all_conditions.NORMALIZED_CODE\r\n , icd10.icd_10_cm\r\n , icd9.icd_9_cm\r\n , snomed_ct.snomed_ct) as NORMALIZED_CODE\r\n , coalesce(\r\n all_conditions.NORMALIZED_DESCRIPTION\r\n , icd10.short_description\r\n , icd9.short_description\r\n , snomed_ct.description) as NORMALIZED_DESCRIPTION\r\n , case when coalesce(all_conditions.NORMALIZED_CODE, all_conditions.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(icd10.icd_10_cm,icd9.icd_9_cm, snomed_ct.snomed_ct) is not null then 'automatic'\r\n end as mapping_method\r\n , all_conditions.CONDITION_RANK\r\n , all_conditions.PRESENT_ON_ADMIT_CODE\r\n , all_conditions.PRESENT_ON_ADMIT_DESCRIPTION\r\n , all_conditions.DATA_SOURCE\r\n , all_conditions.TUVA_LAST_RUN\r\nfrom\r\nall_conditions\r\nleft join {{ ref('terminology__icd_10_cm') }} icd10\r\n on all_conditions.source_code_type = 'icd-10-cm'\r\n and replace(all_conditions.source_code,'.','') = icd10.icd_10_cm\r\nleft join {{ ref('terminology__icd_9_cm') }} icd9\r\n on all_conditions.source_code_type = 'icd-9-cm'\r\n and replace(all_conditions.source_code,'.','') = icd9.icd_9_cm\r\nleft join {{ ref('terminology__snomed_ct') }} snomed_ct\r\n on all_conditions.source_code_type = 'snomed-ct'\r\n and all_conditions.source_code = snomed_ct.snomed_ct\r\n\r\n\r\n\r\n{# This code is only exectued if an enable_normalize_engine var is defined and set to true\r\n it expects a seed file called #}\r\n{% else %}\r\nselect\r\n all_conditions.CONDITION_ID\r\n , all_conditions.PATIENT_ID\r\n , all_conditions.ENCOUNTER_ID\r\n , all_conditions.CLAIM_ID\r\n , all_conditions.RECORDED_DATE\r\n , all_conditions.ONSET_DATE\r\n , all_conditions.RESOLVED_DATE\r\n , all_conditions.STATUS\r\n , all_conditions.CONDITION_TYPE\r\n , all_conditions.SOURCE_CODE_TYPE\r\n , all_conditions.SOURCE_CODE\r\n , all_conditions.SOURCE_DESCRIPTION\r\n , case\r\n when all_conditions.NORMALIZED_CODE_TYPE is not null then all_conditions.NORMALIZED_CODE_TYPE\r\n when icd10.icd_10_cm is not null then 'icd-10-cm'\r\n when icd9.icd_9_cm is not null then 'icd-9-cm'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n else custom_mapped.normalized_code_type end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n all_conditions.NORMALIZED_CODE\r\n , icd10.icd_10_cm\r\n , icd9.icd_9_cm\r\n , snomed_ct.snomed_ct\r\n , custom_mapped.normalized_code\r\n ) as NORMALIZED_CODE\r\n , coalesce(\r\n all_conditions.NORMALIZED_DESCRIPTION\r\n , icd10.short_description\r\n , icd9.short_description\r\n , snomed_ct.description\r\n , custom_mapped.normalized_description\r\n ) as NORMALIZED_DESCRIPTION\r\n , case when coalesce(all_conditions.NORMALIZED_CODE, all_conditions.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(icd10.icd_10_cm,icd9.icd_9_cm, snomed_ct.snomed_ct) is not null then 'automatic'\r\n when custom_mapped.not_mapped is not null then custom_mapped.not_mapped\r\n when coalesce(custom_mapped.normalized_code,custom_mapped.normalized_description) is not null then 'custom'\r\n end as mapping_method\r\n , all_conditions.CONDITION_RANK\r\n , all_conditions.PRESENT_ON_ADMIT_CODE\r\n , all_conditions.PRESENT_ON_ADMIT_DESCRIPTION\r\n , all_conditions.DATA_SOURCE\r\n , all_conditions.TUVA_LAST_RUN\r\nfrom\r\nall_conditions\r\nleft join {{ ref('terminology__icd_10_cm') }} icd10\r\n on all_conditions.source_code_type = 'icd-10-cm'\r\n and replace(all_conditions.source_code,'.','') = icd10.icd_10_cm\r\nleft join {{ ref('terminology__icd_9_cm') }} icd9\r\n on all_conditions.source_code_type = 'icd-9-cm'\r\n and replace(all_conditions.source_code,'.','') = icd9.icd_9_cm\r\nleft join {{ ref('terminology__snomed_ct') }} snomed_ct\r\n on all_conditions.source_code_type = 'snomed-ct'\r\n and all_conditions.source_code = snomed_ct.snomed_ct\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(all_conditions.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( all_conditions.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (all_conditions.source_code = custom_mapped.source_code\r\n or ( all_conditions.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (all_conditions.source_description = custom_mapped.source_description\r\n or ( all_conditions.source_description is null and custom_mapped.source_description is null)\r\n )\r\n and not (all_conditions.source_code is null and all_conditions.source_description is null)\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_condition", "package": null, "version": null}, {"name": "core__stg_clinical_condition", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}, {"name": "terminology__snomed_ct", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__snomed_ct"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__condition.sql", "compiled": true, "compiled_code": "\n\n\nwith all_conditions as (\n select *\nfrom dev_thuxuan.core._stg_claims_condition\nunion all\nselect *\nfrom dev_thuxuan.core._stg_clinical_condition\n\n\n)\n\n\n\n\nselect\n all_conditions.CONDITION_ID\n , all_conditions.PATIENT_ID\n , all_conditions.ENCOUNTER_ID\n , all_conditions.CLAIM_ID\n , all_conditions.RECORDED_DATE\n , all_conditions.ONSET_DATE\n , all_conditions.RESOLVED_DATE\n , all_conditions.STATUS\n , all_conditions.CONDITION_TYPE\n , all_conditions.SOURCE_CODE_TYPE\n , all_conditions.SOURCE_CODE\n , all_conditions.SOURCE_DESCRIPTION\n , case\n when all_conditions.NORMALIZED_CODE_TYPE is not null then all_conditions.NORMALIZED_CODE_TYPE\n when icd10.icd_10_cm is not null then 'icd-10-cm'\n when icd9.icd_9_cm is not null then 'icd-9-cm'\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\n else null end as NORMALIZED_CODE_TYPE\n , coalesce(\n all_conditions.NORMALIZED_CODE\n , icd10.icd_10_cm\n , icd9.icd_9_cm\n , snomed_ct.snomed_ct) as NORMALIZED_CODE\n , coalesce(\n all_conditions.NORMALIZED_DESCRIPTION\n , icd10.short_description\n , icd9.short_description\n , snomed_ct.description) as NORMALIZED_DESCRIPTION\n , case when coalesce(all_conditions.NORMALIZED_CODE, all_conditions.NORMALIZED_DESCRIPTION) is not null then 'manual'\n when coalesce(icd10.icd_10_cm,icd9.icd_9_cm, snomed_ct.snomed_ct) is not null then 'automatic'\n end as mapping_method\n , all_conditions.CONDITION_RANK\n , all_conditions.PRESENT_ON_ADMIT_CODE\n , all_conditions.PRESENT_ON_ADMIT_DESCRIPTION\n , all_conditions.DATA_SOURCE\n , all_conditions.TUVA_LAST_RUN\nfrom\nall_conditions\nleft join dev_thuxuan.terminology.icd_10_cm icd10\n on all_conditions.source_code_type = 'icd-10-cm'\n and replace(all_conditions.source_code,'.','') = icd10.icd_10_cm\nleft join dev_thuxuan.terminology.icd_9_cm icd9\n on all_conditions.source_code_type = 'icd-9-cm'\n and replace(all_conditions.source_code,'.','') = icd9.icd_9_cm\nleft join dev_thuxuan.terminology.snomed_ct snomed_ct\n on all_conditions.source_code_type = 'snomed-ct'\n and all_conditions.source_code = snomed_ct.snomed_ct\n\n\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__eligibility": {"database": "dev_thuxuan", "schema": "core", "name": "core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__eligibility.sql", "original_file_path": "models\\core\\final\\core__eligibility.sql", "unique_id": "model.the_tuva_project.core__eligibility", "fqn": ["the_tuva_project", "core", "final", "core__eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "40a7e07c415aa12f2c27b6cd23f2eb48368e6cfd79f21df4312e297abdbf0941"}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The eligibility table contains information on patient health plan and supplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_id": {"name": "subscriber_id", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "subscriber_relation": {"name": "subscriber_relation", "description": "Identifier that links a patient to a particular insurance product or health plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "eligibility", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1404457, "relation_name": "dev_thuxuan.core.eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_eligibility')}}", "language": "sql", "refs": [{"name": "core__stg_claims_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__encounter.sql", "original_file_path": "models\\core\\final\\core__encounter.sql", "unique_id": "model.the_tuva_project.core__encounter", "fqn": ["the_tuva_project", "core", "final", "core__encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "e11ed4704ad201f03c5a51c9dfa1752ace10107d9a0ac8c746590a372d83b00a"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "encounter", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1519556, "relation_name": "dev_thuxuan.core.encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', false) == true and var('claims_enabled', false) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_clinical_encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__lab_result": {"database": "dev_thuxuan", "schema": "core", "name": "core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__lab_result.sql", "original_file_path": "models\\core\\final\\core__lab_result.sql", "unique_id": "model.the_tuva_project.core__lab_result", "fqn": ["the_tuva_project", "core", "final", "core__lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "7094a5b77429efcf7b2d8b764fe0b7357c640ad83cda1047684e52b8b589e0b3"}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mapping_method": {"name": "mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "lab_result", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1650553, "relation_name": "dev_thuxuan.core.lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) != true %}\r\n\r\n\r\nselect\r\n labs.LAB_RESULT_ID\r\n , labs.PATIENT_ID\r\n , labs.ENCOUNTER_ID\r\n , labs.ACCESSION_NUMBER\r\n , labs.SOURCE_CODE_TYPE\r\n , labs.SOURCE_CODE\r\n , labs.SOURCE_DESCRIPTION\r\n , labs.SOURCE_COMPONENT\r\n , case\r\n when labs.normalized_code_type is not null then labs.normalized_code_type\r\n when loinc.loinc is not null then 'loinc'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n else null end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n labs.normalized_code\r\n , loinc.loinc\r\n , snomed_ct.snomed_ct\r\n ) as NORMALIZED_CODE\r\n , coalesce(\r\n labs.normalized_description\r\n , loinc.long_common_name\r\n , snomed_ct.description\r\n ) NORMALIZED_DESCRIPTION\r\n , case when coalesce(labs.NORMALIZED_CODE, labs.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(LOINC.loinc,snomed_ct.snomed_ct) is not null then 'automatic'\r\n end as mapping_method\r\n , labs.NORMALIZED_COMPONENT\r\n , labs.STATUS\r\n , labs.RESULT\r\n , labs.RESULT_DATE\r\n , labs.COLLECTION_DATE\r\n , labs.SOURCE_UNITS\r\n , labs.NORMALIZED_UNITS\r\n , labs.SOURCE_REFERENCE_RANGE_LOW\r\n , labs.SOURCE_REFERENCE_RANGE_HIGH\r\n , labs.NORMALIZED_REFERENCE_RANGE_LOW\r\n , labs.NORMALIZED_REFERENCE_RANGE_HIGH\r\n , labs.SOURCE_ABNORMAL_FLAG\r\n , labs.NORMALIZED_ABNORMAL_FLAG\r\n , labs.SPECIMEN\r\n , labs.ORDERING_PRACTITIONER_ID\r\n , labs.DATA_SOURCE\r\n , labs.TUVA_LAST_RUN\r\nFrom {{ ref('core__stg_clinical_lab_result')}} as labs\r\nleft join {{ ref('terminology__loinc') }} loinc\r\n on labs.source_code_type = 'loinc'\r\n and labs.source_code = loinc.loinc\r\nleft join {{ref('terminology__snomed_ct')}} snomed_ct\r\n on labs.source_code_type = 'snomed-ct'\r\n and labs.source_code = snomed_ct.snomed_ct\r\n\r\n {% else %}\r\n\r\nselect\r\n labs.LAB_RESULT_ID\r\n , labs.PATIENT_ID\r\n , labs.ENCOUNTER_ID\r\n , labs.ACCESSION_NUMBER\r\n , labs.SOURCE_CODE_TYPE\r\n , labs.SOURCE_CODE\r\n , labs.SOURCE_DESCRIPTION\r\n , labs.SOURCE_COMPONENT\r\n , case\r\n when labs.NORMALIZED_CODE_TYPE is not null then labs.NORMALIZED_CODE_TYPE\r\n when loinc.loinc is not null then 'loinc'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n else custom_mapped.normalized_code_type end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n labs.normalized_code\r\n , loinc.loinc\r\n , snomed_ct.snomed_ct\r\n , custom_mapped.normalized_code\r\n ) as NORMALIZED_CODE\r\n , coalesce(\r\n labs.normalized_description\r\n , loinc.long_common_name\r\n , snomed_ct.description\r\n , custom_mapped.normalized_description\r\n ) NORMALIZED_DESCRIPTION\r\n , case when coalesce(labs.NORMALIZED_CODE, labs.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(LOINC.loinc,snomed_ct.snomed_ct) is not null then 'automatic'\r\n when custom_mapped.not_mapped is not null then custom_mapped.not_mapped\r\n when coalesce(custom_mapped.normalized_code,custom_mapped.normalized_description) is not null then 'custom'\r\n end as mapping_method\r\n , labs.NORMALIZED_COMPONENT\r\n , labs.STATUS\r\n , labs.RESULT\r\n , labs.RESULT_DATE\r\n , labs.COLLECTION_DATE\r\n , labs.SOURCE_UNITS\r\n , labs.NORMALIZED_UNITS\r\n , labs.SOURCE_REFERENCE_RANGE_LOW\r\n , labs.SOURCE_REFERENCE_RANGE_HIGH\r\n , labs.NORMALIZED_REFERENCE_RANGE_LOW\r\n , labs.NORMALIZED_REFERENCE_RANGE_HIGH\r\n , labs.SOURCE_ABNORMAL_FLAG\r\n , labs.NORMALIZED_ABNORMAL_FLAG\r\n , labs.SPECIMEN\r\n , labs.ORDERING_PRACTITIONER_ID\r\n , labs.DATA_SOURCE\r\n , labs.TUVA_LAST_RUN\r\nFrom {{ ref('core__stg_clinical_lab_result')}} as labs\r\nleft join {{ ref('terminology__loinc') }} loinc\r\n on labs.source_code_type = 'loinc'\r\n and labs.source_code = loinc.loinc\r\nleft join {{ref('terminology__snomed_ct')}} snomed_ct\r\n on labs.source_code_type = 'snomed-ct'\r\n and labs.source_code = snomed_ct.snomed_ct\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(labs.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( labs.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (labs.source_code = custom_mapped.source_code\r\n or ( labs.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (labs.source_description = custom_mapped.source_description\r\n or ( labs.source_description is null and custom_mapped.source_description is null)\r\n )\r\n and not (labs.source_code is null and labs.source_description is null)\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__stg_clinical_lab_result", "package": null, "version": null}, {"name": "terminology__loinc", "package": null, "version": null}, {"name": "terminology__snomed_ct", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result", "seed.the_tuva_project.terminology__loinc", "seed.the_tuva_project.terminology__snomed_ct"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "compiled": true, "compiled_code": "\n\n\n\n\nselect\n labs.LAB_RESULT_ID\n , labs.PATIENT_ID\n , labs.ENCOUNTER_ID\n , labs.ACCESSION_NUMBER\n , labs.SOURCE_CODE_TYPE\n , labs.SOURCE_CODE\n , labs.SOURCE_DESCRIPTION\n , labs.SOURCE_COMPONENT\n , case\n when labs.normalized_code_type is not null then labs.normalized_code_type\n when loinc.loinc is not null then 'loinc'\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\n else null end as NORMALIZED_CODE_TYPE\n , coalesce(\n labs.normalized_code\n , loinc.loinc\n , snomed_ct.snomed_ct\n ) as NORMALIZED_CODE\n , coalesce(\n labs.normalized_description\n , loinc.long_common_name\n , snomed_ct.description\n ) NORMALIZED_DESCRIPTION\n , case when coalesce(labs.NORMALIZED_CODE, labs.NORMALIZED_DESCRIPTION) is not null then 'manual'\n when coalesce(LOINC.loinc,snomed_ct.snomed_ct) is not null then 'automatic'\n end as mapping_method\n , labs.NORMALIZED_COMPONENT\n , labs.STATUS\n , labs.RESULT\n , labs.RESULT_DATE\n , labs.COLLECTION_DATE\n , labs.SOURCE_UNITS\n , labs.NORMALIZED_UNITS\n , labs.SOURCE_REFERENCE_RANGE_LOW\n , labs.SOURCE_REFERENCE_RANGE_HIGH\n , labs.NORMALIZED_REFERENCE_RANGE_LOW\n , labs.NORMALIZED_REFERENCE_RANGE_HIGH\n , labs.SOURCE_ABNORMAL_FLAG\n , labs.NORMALIZED_ABNORMAL_FLAG\n , labs.SPECIMEN\n , labs.ORDERING_PRACTITIONER_ID\n , labs.DATA_SOURCE\n , labs.TUVA_LAST_RUN\nFrom dev_thuxuan.core._stg_clinical_lab_result as labs\nleft join dev_thuxuan.terminology.loinc loinc\n on labs.source_code_type = 'loinc'\n and labs.source_code = loinc.loinc\nleft join dev_thuxuan.terminology.snomed_ct snomed_ct\n on labs.source_code_type = 'snomed-ct'\n and labs.source_code = snomed_ct.snomed_ct\n\n ", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__location": {"database": "dev_thuxuan", "schema": "core", "name": "core__location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__location.sql", "original_file_path": "models\\core\\final\\core__location.sql", "unique_id": "model.the_tuva_project.core__location", "fqn": ["the_tuva_project", "core", "final", "core__location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "25c3cd44422b697cd1494783c2e87d160c7aa163ddc1b175e23379583ee15845"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "location", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1726696, "relation_name": "dev_thuxuan.core.location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_location", "package": null, "version": null}, {"name": "core__stg_clinical_location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__location.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_location\nunion all\nselect * from dev_thuxuan.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medical_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medical_claim.sql", "original_file_path": "models\\core\\final\\core__medical_claim.sql", "unique_id": "model.the_tuva_project.core__medical_claim", "fqn": ["the_tuva_project", "core", "final", "core__medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "41428bc0eb9047a2b8a1eec6c3d57d9b04073f32fda2e28989dc59c2f23aebb7"}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medical claim table contains information on services rendered to patients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medical_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.1902025, "relation_name": "dev_thuxuan.core.medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_medical_claim')}}", "language": "sql", "refs": [{"name": "core__stg_claims_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect * from dev_thuxuan.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__medication": {"database": "dev_thuxuan", "schema": "core", "name": "core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medication.sql", "original_file_path": "models\\core\\final\\core__medication.sql", "unique_id": "model.the_tuva_project.core__medication", "fqn": ["the_tuva_project", "core", "final", "core__medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "9cf847b875ad1d0072333d10bf18297b6b611829ebc78dd723f0a7a045f6d6bd"}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_mapping_method": {"name": "ndc_mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_mapping_method": {"name": "rxnorm_mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "atc_mapping_method": {"name": "atc_mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medication", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.200709, "relation_name": "dev_thuxuan.core.medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith source_mapping as (\r\n{% if var('enable_normalize_engine',false) != true %}\r\n select\r\n meds.MEDICATION_ID\r\n , meds.PATIENT_ID\r\n , meds.ENCOUNTER_ID\r\n , meds.DISPENSING_DATE\r\n , meds.PRESCRIBING_DATE\r\n , meds.SOURCE_CODE_TYPE\r\n , meds.SOURCE_CODE\r\n , meds.SOURCE_DESCRIPTION\r\n , coalesce(\r\n meds.ndc_code\r\n , ndc.ndc\r\n ) as NDC_CODE\r\n , coalesce(\r\n meds.ndc_description\r\n , ndc.fda_description\r\n , ndc.rxnorm_description\r\n ) as NDC_DESCRIPTION\r\n , case\r\n when meds.ndc_code is not null then 'manual'\r\n when ndc.ndc is not null then 'automatic'\r\n end as ndc_mapping_method\r\n , coalesce(\r\n meds.rxnorm_code\r\n , rxatc.rxcui\r\n ) as RXNORM_CODE\r\n , coalesce(\r\n meds.rxnorm_description\r\n , rxatc.rxnorm_description\r\n ) as RXNORM_DESCRIPTION\r\n , case\r\n when meds.rxnorm_code is not null then 'manual'\r\n when rxatc.rxcui is not null then 'automatic'\r\n end as rxnorm_mapping_method\r\n , coalesce(\r\n meds.atc_code\r\n , rxatc.atc_3_code\r\n ) as ATC_CODE\r\n , coalesce(\r\n meds.atc_description\r\n , rxatc.atc_4_name\r\n ) as ATC_DESCRIPTION\r\n , case\r\n when meds.atc_code is not null then 'manual'\r\n when rxatc.atc_3_name is not null then 'automatic'\r\n end as atc_mapping_method\r\n , meds.ROUTE\r\n , meds.STRENGTH\r\n , meds.QUANTITY\r\n , meds.QUANTITY_UNIT\r\n , meds.DAYS_SUPPLY\r\n , meds.PRACTITIONER_ID\r\n , meds.DATA_SOURCE\r\n , meds.TUVA_LAST_RUN\r\nfrom {{ ref('core__stg_clinical_medication')}} meds\r\n left join {{ref('terminology__ndc')}} ndc\r\n on meds.source_code_type = 'ndc'\r\n and meds.source_code = ndc.ndc\r\n left join {{ref('terminology__rxnorm_to_atc')}} rxatc\r\n on meds.source_code_type = 'rxnorm'\r\n and meds.source_code = rxatc.rxcui\r\n\r\n\r\n{% else %}\r\n\r\n select\r\n meds.MEDICATION_ID\r\n , meds.PATIENT_ID\r\n , meds.ENCOUNTER_ID\r\n , meds.DISPENSING_DATE\r\n , meds.PRESCRIBING_DATE\r\n , meds.SOURCE_CODE_TYPE\r\n , meds.SOURCE_CODE\r\n , meds.SOURCE_DESCRIPTION\r\n , coalesce(\r\n meds.ndc_code\r\n , ndc.ndc\r\n , custom_mapped_ndc.normalized_code\r\n ) as NDC_CODE\r\n , coalesce(\r\n meds.ndc_description\r\n , ndc.fda_description\r\n , ndc.rxnorm_description\r\n , custom_mapped_ndc.normalized_description\r\n ) as NDC_DESCRIPTION\r\n , case\r\n when meds.ndc_code is not null then 'manual'\r\n when ndc.ndc is not null then 'automatic'\r\n when custom_mapped_ndc.not_mapped is not null then custom_mapped_ndc.not_mapped\r\n when custom_mapped_ndc.normalized_code is not null then 'custom'\r\n end as ndc_mapping_method\r\n , coalesce(\r\n meds.RXNORM_CODE\r\n , rxatc.rxcui\r\n , custom_mapped_rxnorm.normalized_code\r\n ) as RXNORM_CODE\r\n , coalesce(\r\n meds.RXNORM_CODE\r\n , rxatc.rxnorm_description\r\n , custom_mapped_rxnorm.normalized_description\r\n ) as RXNORM_DESCRIPTION\r\n , case\r\n when meds.rxnorm_code is not null then 'manual'\r\n when rxatc.rxcui is not null then 'automatic'\r\n when custom_mapped_rxnorm.not_mapped is not null then custom_mapped_rxnorm.not_mapped\r\n when custom_mapped_rxnorm.normalized_code is not null then 'custom'\r\n end as rxnorm_mapping_method\r\n , coalesce(\r\n meds.atc_code\r\n , rxatc.atc_3_code\r\n , custom_mapped_atc.normalized_code\r\n ) as ATC_CODE\r\n , coalesce(\r\n meds.atc_description\r\n , rxatc.atc_3_name\r\n , custom_mapped_atc.normalized_description\r\n ) as ATC_DESCRIPTION\r\n , case\r\n when meds.atc_code is not null then 'manual'\r\n when rxatc.atc_3_code is not null then 'automatic'\r\n when custom_mapped_atc.not_mapped is not null then custom_mapped_atc.not_mapped\r\n when custom_mapped_atc.normalized_code is not null then 'custom'\r\n end as atc_mapping_method\r\n , meds.ROUTE\r\n , meds.STRENGTH\r\n , meds.QUANTITY\r\n , meds.QUANTITY_UNIT\r\n , meds.DAYS_SUPPLY\r\n , meds.PRACTITIONER_ID\r\n , meds.DATA_SOURCE\r\n , meds.TUVA_LAST_RUN\r\nfrom {{ ref('core__stg_clinical_medication')}} meds\r\n left join {{ref('terminology__ndc')}} ndc\r\n on meds.source_code_type = 'ndc'\r\n and meds.source_code = ndc.ndc\r\n left join {{ref('terminology__rxnorm_to_atc')}} rxatc\r\n on meds.source_code_type = 'rxnorm'\r\n and meds.source_code = rxatc.rxcui\r\n left join {{ ref('custom_mapped') }} custom_mapped_ndc\r\n on custom_mapped_ndc.normalized_code_type = 'ndc'\r\n and ( lower(meds.source_code_type) = lower(custom_mapped_ndc.source_code_type)\r\n or ( meds.source_code_type is null and custom_mapped_ndc.source_code_type is null)\r\n )\r\n and (meds.source_code = custom_mapped_ndc.source_code\r\n or ( meds.source_code is null and custom_mapped_ndc.source_code is null)\r\n )\r\n and (meds.source_description = custom_mapped_ndc.source_description\r\n or ( meds.source_description is null and custom_mapped_ndc.source_description is null)\r\n )\r\n and not (meds.source_code is null and meds.source_description is null)\r\n left join {{ ref('custom_mapped') }} custom_mapped_rxnorm\r\n on custom_mapped_rxnorm.normalized_code_type = 'rxnorm'\r\n and ( lower(meds.source_code_type) = lower(custom_mapped_rxnorm.source_code_type)\r\n or ( meds.source_code_type is null and custom_mapped_rxnorm.source_code_type is null)\r\n )\r\n and (meds.source_code = custom_mapped_rxnorm.source_code\r\n or ( meds.source_code is null and custom_mapped_rxnorm.source_code is null)\r\n )\r\n and (meds.source_description = custom_mapped_rxnorm.source_description\r\n or ( meds.source_description is null and custom_mapped_rxnorm.source_description is null)\r\n )\r\n and not (meds.source_code is null and meds.source_description is null)\r\n left join {{ ref('custom_mapped') }} custom_mapped_atc\r\n on custom_mapped_atc.normalized_code_type = 'atc'\r\n and ( lower(meds.source_code_type) = lower(custom_mapped_atc.source_code_type)\r\n or ( meds.source_code_type is null and custom_mapped_atc.source_code_type is null)\r\n )\r\n and (meds.source_code = custom_mapped_atc.source_code\r\n or ( meds.source_code is null and custom_mapped_atc.source_code is null)\r\n )\r\n and (meds.source_description = custom_mapped_atc.source_description\r\n or ( meds.source_description is null and custom_mapped_atc.source_description is null)\r\n )\r\n and not (meds.source_code is null and meds.source_description is null)\r\n{% endif %}\r\n )\r\n\r\n\r\n-- add auto rxnorm + atc\r\nselect\r\n sm.MEDICATION_ID\r\n , sm.PATIENT_ID\r\n , sm.ENCOUNTER_ID\r\n , sm.DISPENSING_DATE\r\n , sm.PRESCRIBING_DATE\r\n , sm.SOURCE_CODE_TYPE\r\n , sm.SOURCE_CODE\r\n , sm.SOURCE_DESCRIPTION\r\n , sm.NDC_CODE\r\n , sm.NDC_DESCRIPTION\r\n , sm.ndc_mapping_method\r\n , coalesce(\r\n sm.rxnorm_code\r\n , ndc.rxcui\r\n ) as RXNORM_CODE\r\n , coalesce(\r\n sm.RXNORM_description\r\n , ndc.rxnorm_description\r\n ) as RXNORM_DESCRIPTION\r\n , case\r\n when sm.rxnorm_mapping_method is not null then sm.rxnorm_mapping_method\r\n when ndc.rxcui is not null then 'automatic'\r\n end as rxnorm_mapping_method\r\n , coalesce(\r\n sm.atc_code\r\n , rxatc.atc_3_code\r\n ) as ATC_CODE\r\n , coalesce(\r\n sm.atc_description\r\n , rxatc.atc_3_name\r\n ) as ATC_DESCRIPTION\r\n , case\r\n when sm.atc_mapping_method is not null then sm.atc_mapping_method\r\n when rxatc.atc_3_name is not null then 'automatic'\r\n end as atc_mapping_method\r\n , sm.ROUTE\r\n , sm.STRENGTH\r\n , sm.QUANTITY\r\n , sm.QUANTITY_UNIT\r\n , sm.DAYS_SUPPLY\r\n , sm.PRACTITIONER_ID\r\n , sm.DATA_SOURCE\r\n , sm.TUVA_LAST_RUN\r\nfrom source_mapping sm\r\n left join {{ref('terminology__ndc')}} ndc\r\n on sm.ndc_code = ndc.ndc\r\n left join {{ref('terminology__rxnorm_to_atc')}} rxatc\r\n on coalesce( sm.rxnorm_code, ndc.rxcui ) = rxatc.rxcui", "language": "sql", "refs": [{"name": "core__stg_clinical_medication", "package": null, "version": null}, {"name": "terminology__ndc", "package": null, "version": null}, {"name": "terminology__rxnorm_to_atc", "package": null, "version": null}, {"name": "terminology__ndc", "package": null, "version": null}, {"name": "terminology__rxnorm_to_atc", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication", "seed.the_tuva_project.terminology__ndc", "seed.the_tuva_project.terminology__rxnorm_to_atc", "seed.the_tuva_project.terminology__ndc", "seed.the_tuva_project.terminology__rxnorm_to_atc"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medication.sql", "compiled": true, "compiled_code": "\n\n\nwith source_mapping as (\n\n select\n meds.MEDICATION_ID\n , meds.PATIENT_ID\n , meds.ENCOUNTER_ID\n , meds.DISPENSING_DATE\n , meds.PRESCRIBING_DATE\n , meds.SOURCE_CODE_TYPE\n , meds.SOURCE_CODE\n , meds.SOURCE_DESCRIPTION\n , coalesce(\n meds.ndc_code\n , ndc.ndc\n ) as NDC_CODE\n , coalesce(\n meds.ndc_description\n , ndc.fda_description\n , ndc.rxnorm_description\n ) as NDC_DESCRIPTION\n , case\n when meds.ndc_code is not null then 'manual'\n when ndc.ndc is not null then 'automatic'\n end as ndc_mapping_method\n , coalesce(\n meds.rxnorm_code\n , rxatc.rxcui\n ) as RXNORM_CODE\n , coalesce(\n meds.rxnorm_description\n , rxatc.rxnorm_description\n ) as RXNORM_DESCRIPTION\n , case\n when meds.rxnorm_code is not null then 'manual'\n when rxatc.rxcui is not null then 'automatic'\n end as rxnorm_mapping_method\n , coalesce(\n meds.atc_code\n , rxatc.atc_3_code\n ) as ATC_CODE\n , coalesce(\n meds.atc_description\n , rxatc.atc_4_name\n ) as ATC_DESCRIPTION\n , case\n when meds.atc_code is not null then 'manual'\n when rxatc.atc_3_name is not null then 'automatic'\n end as atc_mapping_method\n , meds.ROUTE\n , meds.STRENGTH\n , meds.QUANTITY\n , meds.QUANTITY_UNIT\n , meds.DAYS_SUPPLY\n , meds.PRACTITIONER_ID\n , meds.DATA_SOURCE\n , meds.TUVA_LAST_RUN\nfrom dev_thuxuan.core._stg_clinical_medication meds\n left join dev_thuxuan.terminology.ndc ndc\n on meds.source_code_type = 'ndc'\n and meds.source_code = ndc.ndc\n left join dev_thuxuan.terminology.rxnorm_to_atc rxatc\n on meds.source_code_type = 'rxnorm'\n and meds.source_code = rxatc.rxcui\n\n\n\n )\n\n\n-- add auto rxnorm + atc\nselect\n sm.MEDICATION_ID\n , sm.PATIENT_ID\n , sm.ENCOUNTER_ID\n , sm.DISPENSING_DATE\n , sm.PRESCRIBING_DATE\n , sm.SOURCE_CODE_TYPE\n , sm.SOURCE_CODE\n , sm.SOURCE_DESCRIPTION\n , sm.NDC_CODE\n , sm.NDC_DESCRIPTION\n , sm.ndc_mapping_method\n , coalesce(\n sm.rxnorm_code\n , ndc.rxcui\n ) as RXNORM_CODE\n , coalesce(\n sm.RXNORM_description\n , ndc.rxnorm_description\n ) as RXNORM_DESCRIPTION\n , case\n when sm.rxnorm_mapping_method is not null then sm.rxnorm_mapping_method\n when ndc.rxcui is not null then 'automatic'\n end as rxnorm_mapping_method\n , coalesce(\n sm.atc_code\n , rxatc.atc_3_code\n ) as ATC_CODE\n , coalesce(\n sm.atc_description\n , rxatc.atc_3_name\n ) as ATC_DESCRIPTION\n , case\n when sm.atc_mapping_method is not null then sm.atc_mapping_method\n when rxatc.atc_3_name is not null then 'automatic'\n end as atc_mapping_method\n , sm.ROUTE\n , sm.STRENGTH\n , sm.QUANTITY\n , sm.QUANTITY_UNIT\n , sm.DAYS_SUPPLY\n , sm.PRACTITIONER_ID\n , sm.DATA_SOURCE\n , sm.TUVA_LAST_RUN\nfrom source_mapping sm\n left join dev_thuxuan.terminology.ndc ndc\n on sm.ndc_code = ndc.ndc\n left join dev_thuxuan.terminology.rxnorm_to_atc rxatc\n on coalesce( sm.rxnorm_code, ndc.rxcui ) = rxatc.rxcui", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__observation": {"database": "dev_thuxuan", "schema": "core", "name": "core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__observation.sql", "original_file_path": "models\\core\\final\\core__observation.sql", "unique_id": "model.the_tuva_project.core__observation", "fqn": ["the_tuva_project", "core", "final", "core__observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "09913f6a680163ea53018c375fb28486d614b62018a2b82c8240565957ebd7d1"}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mapping_method": {"name": "mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "observation", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2097218, "relation_name": "dev_thuxuan.core.observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) != true %}\r\nselect\r\n obs.OBSERVATION_ID\r\n , obs.PATIENT_ID\r\n , obs.ENCOUNTER_ID\r\n , obs.PANEL_ID\r\n , obs.OBSERVATION_DATE\r\n , obs.OBSERVATION_TYPE\r\n , obs.SOURCE_CODE_TYPE\r\n , obs.SOURCE_CODE\r\n , obs.SOURCE_DESCRIPTION\r\n , case\r\n when obs.NORMALIZED_CODE_TYPE is not null then obs.NORMALIZED_CODE_TYPE\r\n when icd10cm.icd_10_cm is not null then 'icd-10-cm'\r\n when icd9cm.icd_9_cm is not null then 'icd-9-cm'\r\n when icd10pcs.icd_10_pcs is not null then 'icd-10-pcs'\r\n when icd9pcs.icd_9_pcs is not null then 'icd-10-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n when loinc.loinc is not null then 'loinc'\r\n end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n obs.NORMALIZED_CODE\r\n , icd10cm.icd_10_cm\r\n , icd9cm.icd_9_cm\r\n , icd10pcs.icd_10_pcs\r\n , icd9pcs.icd_9_pcs\r\n , hcpcs.hcpcs\r\n , snomed_ct.snomed_ct\r\n , loinc.loinc\r\n ) as NORMALIZED_CODE\r\n , coalesce(\r\n obs.NORMALIZED_DESCRIPTION\r\n , icd10cm.short_description\r\n , icd9cm.short_description\r\n , icd10pcs.description\r\n , icd9pcs.short_description\r\n , hcpcs.short_description\r\n , snomed_ct.description\r\n , loinc.long_common_name\r\n ) as NORMALIZED_DESCRIPTION\r\n , case\r\n when coalesce(obs.NORMALIZED_CODE, obs.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(\r\n icd10cm.icd_10_cm\r\n , icd9cm.icd_9_cm\r\n , icd10pcs.icd_10_pcs\r\n , icd9pcs.icd_9_pcs\r\n , hcpcs.hcpcs\r\n , snomed_ct.snomed_ct\r\n , loinc.loinc) is not null then 'automatic'\r\n end as mapping_method\r\n , obs.RESULT\r\n , obs.SOURCE_UNITS\r\n , obs.NORMALIZED_UNITS\r\n , obs.SOURCE_REFERENCE_RANGE_LOW\r\n , obs.SOURCE_REFERENCE_RANGE_HIGH\r\n , obs.NORMALIZED_REFERENCE_RANGE_LOW\r\n , obs.NORMALIZED_REFERENCE_RANGE_HIGH\r\n , obs.DATA_SOURCE\r\n , obs.TUVA_LAST_RUN\r\nfrom {{ ref('core__stg_clinical_observation')}} obs\r\nleft join {{ ref('terminology__icd_10_cm') }} icd10cm\r\n on obs.source_code_type = 'icd-10-cm'\r\n and replace(obs.source_code,'.','') = icd10cm.icd_10_cm\r\nleft join {{ ref('terminology__icd_9_cm') }} icd9cm\r\n on obs.source_code_type = 'icd-9-cm'\r\n and replace(obs.source_code,'.','') = icd9cm.icd_9_cm\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd10pcs\r\n on obs.source_code_type = 'icd-10-pcs'\r\n and obs.source_code = icd10pcs.icd_10_pcs\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd9pcs\r\n on obs.source_code_type = 'icd-9-pcs'\r\n and replace(obs.source_code,'.','') = icd9pcs.icd_9_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} hcpcs\r\n on obs.source_code_type = 'hcpcs'\r\n and obs.source_code = hcpcs.hcpcs\r\nleft join {{ ref('terminology__snomed_ct')}} snomed_ct\r\n on obs.source_code_type = 'snomed-ct'\r\n and obs.source_code = snomed_ct.snomed_ct\r\nleft join {{ ref('terminology__loinc') }} loinc\r\n on obs.source_code_type = 'loinc'\r\n and obs.source_code = loinc.loinc\r\n\r\n{% else %}\r\n\r\nselect\r\n obs.OBSERVATION_ID\r\n , obs.PATIENT_ID\r\n , obs.ENCOUNTER_ID\r\n , obs.PANEL_ID\r\n , obs.OBSERVATION_DATE\r\n , obs.OBSERVATION_TYPE\r\n , obs.SOURCE_CODE_TYPE\r\n , obs.SOURCE_CODE\r\n , obs.SOURCE_DESCRIPTION\r\n , case\r\n when obs.NORMALIZED_CODE_TYPE is not null then obs.NORMALIZED_CODE_TYPE\r\n when icd10cm.icd_10_cm is not null then 'icd-10-cm'\r\n when icd9cm.icd_9_cm is not null then 'icd-9-cm'\r\n when icd10pcs.icd_10_pcs is not null then 'icd-10-pcs'\r\n when icd9pcs.icd_9_pcs is not null then 'icd-10-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n when loinc.loinc is not null then 'loinc'\r\n else custom_mapped.normalized_code_type end as NORMALIZED_CODE_TYPE\r\n , coalesce(\r\n obs.NORMALIZED_CODE\r\n , icd10cm.icd_10_cm\r\n , icd9cm.icd_9_cm\r\n , icd10pcs.icd_10_pcs\r\n , icd9pcs.icd_9_pcs\r\n , hcpcs.hcpcs\r\n , snomed_ct.snomed_ct\r\n , loinc.loinc\r\n , custom_mapped.normalized_code\r\n ) as NORMALIZED_CODE\r\n , coalesce(\r\n obs.NORMALIZED_DESCRIPTION\r\n , icd10cm.short_description\r\n , icd9cm.short_description\r\n , icd10pcs.description\r\n , icd9pcs.short_description\r\n , hcpcs.short_description\r\n , snomed_ct.description\r\n , loinc.long_common_name\r\n , custom_mapped.normalized_description\r\n ) as NORMALIZED_DESCRIPTION\r\n , case\r\n when coalesce(obs.NORMALIZED_CODE, obs.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(\r\n icd10cm.icd_10_cm\r\n , icd9cm.icd_9_cm\r\n , icd10pcs.icd_10_pcs\r\n , icd9pcs.icd_9_pcs\r\n , hcpcs.hcpcs\r\n , snomed_ct.snomed_ct\r\n , loinc.loinc) is not null then 'automatic'\r\n when custom_mapped.not_mapped is not null then custom_mapped.not_mapped\r\n when coalesce(custom_mapped.normalized_code,custom_mapped.normalized_description) is not null then 'custom'\r\n end as mapping_method\r\n , obs.RESULT\r\n , obs.SOURCE_UNITS\r\n , obs.NORMALIZED_UNITS\r\n , obs.SOURCE_REFERENCE_RANGE_LOW\r\n , obs.SOURCE_REFERENCE_RANGE_HIGH\r\n , obs.NORMALIZED_REFERENCE_RANGE_LOW\r\n , obs.NORMALIZED_REFERENCE_RANGE_HIGH\r\n , obs.DATA_SOURCE\r\n , obs.TUVA_LAST_RUN\r\nfrom {{ ref('core__stg_clinical_observation')}} obs\r\nleft join {{ ref('terminology__icd_10_cm') }} icd10cm\r\n on obs.source_code_type = 'icd-10-cm'\r\n and replace(obs.source_code,'.','') = icd10cm.icd_10_cm\r\nleft join {{ ref('terminology__icd_9_cm') }} icd9cm\r\n on obs.source_code_type = 'icd-9-cm'\r\n and replace(obs.source_code,'.','') = icd9cm.icd_9_cm\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd10pcs\r\n on obs.source_code_type = 'icd-10-pcs'\r\n and obs.source_code = icd10pcs.icd_10_pcs\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd9pcs\r\n on obs.source_code_type = 'icd-9-pcs'\r\n and replace(obs.source_code,'.','') = icd9pcs.icd_9_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} hcpcs\r\n on obs.source_code_type = 'hcpcs'\r\n and obs.source_code = hcpcs.hcpcs\r\nleft join {{ ref('terminology__snomed_ct')}} snomed_ct\r\n on obs.source_code_type = 'snomed-ct'\r\n and obs.source_code = snomed_ct.snomed_ct\r\nleft join {{ ref('terminology__loinc') }} loinc\r\n on obs.source_code_type = 'loinc'\r\n and obs.source_code = loinc.loinc\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(obs.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( obs.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (obs.source_code = custom_mapped.source_code\r\n or ( obs.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (obs.source_description = custom_mapped.source_description\r\n or ( obs.source_description is null and custom_mapped.source_description is null)\r\n )\r\n and not (obs.source_code is null and obs.source_description is null)\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__stg_clinical_observation", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__icd_9_cm", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__icd_9_pcs", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "terminology__snomed_ct", "package": null, "version": null}, {"name": "terminology__loinc", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__snomed_ct", "seed.the_tuva_project.terminology__loinc"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__observation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n obs.OBSERVATION_ID\n , obs.PATIENT_ID\n , obs.ENCOUNTER_ID\n , obs.PANEL_ID\n , obs.OBSERVATION_DATE\n , obs.OBSERVATION_TYPE\n , obs.SOURCE_CODE_TYPE\n , obs.SOURCE_CODE\n , obs.SOURCE_DESCRIPTION\n , case\n when obs.NORMALIZED_CODE_TYPE is not null then obs.NORMALIZED_CODE_TYPE\n when icd10cm.icd_10_cm is not null then 'icd-10-cm'\n when icd9cm.icd_9_cm is not null then 'icd-9-cm'\n when icd10pcs.icd_10_pcs is not null then 'icd-10-pcs'\n when icd9pcs.icd_9_pcs is not null then 'icd-10-pcs'\n when hcpcs.hcpcs is not null then 'hcpcs'\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\n when loinc.loinc is not null then 'loinc'\n end as NORMALIZED_CODE_TYPE\n , coalesce(\n obs.NORMALIZED_CODE\n , icd10cm.icd_10_cm\n , icd9cm.icd_9_cm\n , icd10pcs.icd_10_pcs\n , icd9pcs.icd_9_pcs\n , hcpcs.hcpcs\n , snomed_ct.snomed_ct\n , loinc.loinc\n ) as NORMALIZED_CODE\n , coalesce(\n obs.NORMALIZED_DESCRIPTION\n , icd10cm.short_description\n , icd9cm.short_description\n , icd10pcs.description\n , icd9pcs.short_description\n , hcpcs.short_description\n , snomed_ct.description\n , loinc.long_common_name\n ) as NORMALIZED_DESCRIPTION\n , case\n when coalesce(obs.NORMALIZED_CODE, obs.NORMALIZED_DESCRIPTION) is not null then 'manual'\n when coalesce(\n icd10cm.icd_10_cm\n , icd9cm.icd_9_cm\n , icd10pcs.icd_10_pcs\n , icd9pcs.icd_9_pcs\n , hcpcs.hcpcs\n , snomed_ct.snomed_ct\n , loinc.loinc) is not null then 'automatic'\n end as mapping_method\n , obs.RESULT\n , obs.SOURCE_UNITS\n , obs.NORMALIZED_UNITS\n , obs.SOURCE_REFERENCE_RANGE_LOW\n , obs.SOURCE_REFERENCE_RANGE_HIGH\n , obs.NORMALIZED_REFERENCE_RANGE_LOW\n , obs.NORMALIZED_REFERENCE_RANGE_HIGH\n , obs.DATA_SOURCE\n , obs.TUVA_LAST_RUN\nfrom dev_thuxuan.core._stg_clinical_observation obs\nleft join dev_thuxuan.terminology.icd_10_cm icd10cm\n on obs.source_code_type = 'icd-10-cm'\n and replace(obs.source_code,'.','') = icd10cm.icd_10_cm\nleft join dev_thuxuan.terminology.icd_9_cm icd9cm\n on obs.source_code_type = 'icd-9-cm'\n and replace(obs.source_code,'.','') = icd9cm.icd_9_cm\nleft join dev_thuxuan.terminology.icd_10_pcs icd10pcs\n on obs.source_code_type = 'icd-10-pcs'\n and obs.source_code = icd10pcs.icd_10_pcs\nleft join dev_thuxuan.terminology.icd_9_pcs icd9pcs\n on obs.source_code_type = 'icd-9-pcs'\n and replace(obs.source_code,'.','') = icd9pcs.icd_9_pcs\nleft join dev_thuxuan.terminology.hcpcs_level_2 hcpcs\n on obs.source_code_type = 'hcpcs'\n and obs.source_code = hcpcs.hcpcs\nleft join dev_thuxuan.terminology.snomed_ct snomed_ct\n on obs.source_code_type = 'snomed-ct'\n and obs.source_code = snomed_ct.snomed_ct\nleft join dev_thuxuan.terminology.loinc loinc\n on obs.source_code_type = 'loinc'\n and obs.source_code = loinc.loinc\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__patient.sql", "original_file_path": "models\\core\\final\\core__patient.sql", "unique_id": "model.the_tuva_project.core__patient", "fqn": ["the_tuva_project", "core", "final", "core__patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "91ee630a4a580f22cbd30dd748007dbe543ffc36b46d4c4e4b70a3fac167275f"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "social_security_number": {"name": "social_security_number", "description": "The social security number of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "patient", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2182395, "relation_name": "dev_thuxuan.core.patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_patient", "package": null, "version": null}, {"name": "core__stg_clinical_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__patient.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_patient\nunion all\nselect * from dev_thuxuan.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__pharmacy_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__pharmacy_claim.sql", "original_file_path": "models\\core\\final\\core__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.core__pharmacy_claim", "fqn": ["the_tuva_project", "core", "final", "core__pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "78711b940ffc41f4aa9dcdc0eafd9d8d8753cc313dec22d5282e7b10936dce37"}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The pharmacy claim table contains information on prescription drugs that were filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "pharmacy_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2282383, "relation_name": "dev_thuxuan.core.pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_claims_pharmacy_claim')}}", "language": "sql", "refs": [{"name": "core__stg_claims_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__practitioner.sql", "original_file_path": "models\\core\\final\\core__practitioner.sql", "unique_id": "model.the_tuva_project.core__practitioner", "fqn": ["the_tuva_project", "core", "final", "core__practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "402fa1015c25b4347c00bde3d71b875be57fe24318ae1e40bcd349c6bf38f949"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "practitioner", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2344356, "relation_name": "dev_thuxuan.core.practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true-%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_practitioner", "package": null, "version": null}, {"name": "core__stg_clinical_practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.core._stg_claims_practitioner\nunion all\nselect * from dev_thuxuan.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__procedure.sql", "original_file_path": "models\\core\\final\\core__procedure.sql", "unique_id": "model.the_tuva_project.core__procedure", "fqn": ["the_tuva_project", "core", "final", "core__procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "b2466e7a2a21bb4d7d7952dbc887a551893a338f09f631afcdd680d9003e1ae0"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "mapping_method": {"name": "mapping_method", "description": "mapping method used to populate the normalized codes and descriptions. Can be manual (fields were populated in input layer), automatic (dictionary codes matching the source code were found and was automatically populated) or custom (populated by normalization engine)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "procedure", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.246602, "relation_name": "dev_thuxuan.core.procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n | as_bool\r\n )\r\n}}\r\n\r\n\r\nwith all_procedures as (\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\n\r\n{%- endif %}\r\n)\r\n\r\n{% if var('enable_normalize_engine',false) != true %}\r\n\r\nselect\r\n all_procedures.PROCEDURE_ID\r\n , all_procedures.PATIENT_ID\r\n , all_procedures.ENCOUNTER_ID\r\n , all_procedures.CLAIM_ID\r\n , all_procedures.PROCEDURE_DATE\r\n , all_procedures.SOURCE_CODE_TYPE\r\n , all_procedures.SOURCE_CODE\r\n , all_procedures.SOURCE_DESCRIPTION\r\n , case when all_procedures.NORMALIZED_CODE_TYPE is not null then all_procedures.NORMALIZED_CODE_TYPE\r\n when icd10.icd_10_pcs is not null then 'icd-10-pcs'\r\n when icd9.icd_9_pcs is not null then 'icd-9-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n end as NORMALIZED_CODE_TYPE\r\n , coalesce(all_procedures.NORMALIZED_CODE\r\n , icd10.icd_10_pcs\r\n , icd9.icd_9_pcs\r\n , hcpcs.hcpcs\r\n ,snomed_ct.snomed_ct ) as NORMALIZED_CODE\r\n , coalesce(all_procedures.NORMALIZED_DESCRIPTION\r\n , icd10.description\r\n , icd9.short_description\r\n , hcpcs.short_description\r\n , snomed_ct.description) NORMALIZED_DESCRIPTION\r\n , case when coalesce(all_procedures.NORMALIZED_CODE, all_procedures.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(icd10.icd_10_pcs,icd9.icd_9_pcs, hcpcs.hcpcs, snomed_ct.snomed_ct) is not null then 'automatic'\r\n end as mapping_method\r\n , all_procedures.MODIFIER_1\r\n , all_procedures.MODIFIER_2\r\n , all_procedures.MODIFIER_3\r\n , all_procedures.MODIFIER_4\r\n , all_procedures.MODIFIER_5\r\n , all_procedures.PRACTITIONER_ID\r\n , all_procedures.DATA_SOURCE\r\n , all_procedures.TUVA_LAST_RUN\r\nfrom all_procedures\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd10\r\n on all_procedures.source_code_type = 'icd-10-pcs'\r\n and all_procedures.source_code = icd10.icd_10_pcs\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd9\r\n on all_procedures.source_code_type = 'icd-9-pcs'\r\n and all_procedures.source_code = icd9.icd_9_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} hcpcs\r\n on all_procedures.source_code_type = 'hcpcs'\r\n and all_procedures.source_code = hcpcs.hcpcs\r\nleft join {{ ref('terminology__snomed_ct')}} snomed_ct\r\n on all_procedures.source_code_type = 'snomed-ct'\r\n and all_procedures.source_code = snomed_ct.snomed_ct\r\n\r\n\r\n{% else %}\r\n\r\n\r\nselect\r\n all_procedures.PROCEDURE_ID\r\n , all_procedures.PATIENT_ID\r\n , all_procedures.ENCOUNTER_ID\r\n , all_procedures.CLAIM_ID\r\n , all_procedures.PROCEDURE_DATE\r\n , all_procedures.SOURCE_CODE_TYPE\r\n , all_procedures.SOURCE_CODE\r\n , all_procedures.SOURCE_DESCRIPTION\r\n , case when all_procedures.NORMALIZED_CODE_TYPE is not null then all_procedures.NORMALIZED_CODE_TYPE\r\n when icd10.icd_10_pcs is not null then 'icd-10-pcs'\r\n when icd9.icd_9_pcs is not null then 'icd-9-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\r\n else custom_mapped.normalized_code_type end as NORMALIZED_CODE_TYPE\r\n , coalesce(all_procedures.NORMALIZED_CODE\r\n , icd10.icd_10_pcs\r\n , icd9.icd_9_pcs\r\n , hcpcs.hcpcs\r\n ,snomed_ct.snomed_ct\r\n ,custom_mapped.normalized_code ) as NORMALIZED_CODE\r\n , coalesce(all_procedures.NORMALIZED_DESCRIPTION\r\n , icd10.description\r\n , icd9.short_description\r\n , hcpcs.short_description\r\n , snomed_ct.description\r\n , custom_mapped.normalized_description) as NORMALIZED_DESCRIPTION\r\n , case when coalesce(all_procedures.NORMALIZED_CODE ,all_procedures.NORMALIZED_DESCRIPTION) is not null then 'manual'\r\n when coalesce(icd10.icd_10_pcs,icd9.icd_9_pcs, hcpcs.hcpcs, snomed_ct.snomed_ct) is not null then 'automatic'\r\n when custom_mapped.not_mapped is not null then custom_mapped.not_mapped\r\n when coalesce(custom_mapped.normalized_code,custom_mapped.normalized_description) is not null then 'custom'\r\n end as mapping_method\r\n , all_procedures.MODIFIER_1\r\n , all_procedures.MODIFIER_2\r\n , all_procedures.MODIFIER_3\r\n , all_procedures.MODIFIER_4\r\n , all_procedures.MODIFIER_5\r\n , all_procedures.PRACTITIONER_ID\r\n , all_procedures.DATA_SOURCE\r\n , all_procedures.TUVA_LAST_RUN\r\nfrom all_procedures\r\nleft join {{ ref('terminology__icd_10_pcs') }} icd10\r\n on all_procedures.source_code_type = 'icd-10-pcs'\r\n and all_procedures.source_code = icd10.icd_10_pcs\r\nleft join {{ ref('terminology__icd_9_pcs') }} icd9\r\n on all_procedures.source_code_type = 'icd-9-pcs'\r\n and all_procedures.source_code = icd9.icd_9_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} hcpcs\r\n on all_procedures.source_code_type = 'hcpcs'\r\n and all_procedures.source_code = hcpcs.hcpcs\r\nleft join {{ ref('terminology__snomed_ct')}} snomed_ct\r\n on all_procedures.source_code_type = 'snomed-ct'\r\n and all_procedures.source_code = snomed_ct.snomed_ct\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(all_procedures.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( all_procedures.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (all_procedures.source_code = custom_mapped.source_code\r\n or ( all_procedures.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (all_procedures.source_description = custom_mapped.source_description\r\n or ( all_procedures.source_description is null and custom_mapped.source_description is null)\r\n )\r\n and not (all_procedures.source_code is null and all_procedures.source_description is null)\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__stg_claims_procedure", "package": null, "version": null}, {"name": "core__stg_clinical_procedure", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__icd_9_pcs", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "terminology__snomed_ct", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__snomed_ct"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "compiled": true, "compiled_code": "\n\n\nwith all_procedures as (\nselect * from dev_thuxuan.core._stg_claims_procedure\nunion all\nselect * from dev_thuxuan.core._stg_clinical_procedure\n\n\n)\n\n\n\nselect\n all_procedures.PROCEDURE_ID\n , all_procedures.PATIENT_ID\n , all_procedures.ENCOUNTER_ID\n , all_procedures.CLAIM_ID\n , all_procedures.PROCEDURE_DATE\n , all_procedures.SOURCE_CODE_TYPE\n , all_procedures.SOURCE_CODE\n , all_procedures.SOURCE_DESCRIPTION\n , case when all_procedures.NORMALIZED_CODE_TYPE is not null then all_procedures.NORMALIZED_CODE_TYPE\n when icd10.icd_10_pcs is not null then 'icd-10-pcs'\n when icd9.icd_9_pcs is not null then 'icd-9-pcs'\n when hcpcs.hcpcs is not null then 'hcpcs'\n when snomed_ct.snomed_ct is not null then 'snomed-ct'\n end as NORMALIZED_CODE_TYPE\n , coalesce(all_procedures.NORMALIZED_CODE\n , icd10.icd_10_pcs\n , icd9.icd_9_pcs\n , hcpcs.hcpcs\n ,snomed_ct.snomed_ct ) as NORMALIZED_CODE\n , coalesce(all_procedures.NORMALIZED_DESCRIPTION\n , icd10.description\n , icd9.short_description\n , hcpcs.short_description\n , snomed_ct.description) NORMALIZED_DESCRIPTION\n , case when coalesce(all_procedures.NORMALIZED_CODE, all_procedures.NORMALIZED_DESCRIPTION) is not null then 'manual'\n when coalesce(icd10.icd_10_pcs,icd9.icd_9_pcs, hcpcs.hcpcs, snomed_ct.snomed_ct) is not null then 'automatic'\n end as mapping_method\n , all_procedures.MODIFIER_1\n , all_procedures.MODIFIER_2\n , all_procedures.MODIFIER_3\n , all_procedures.MODIFIER_4\n , all_procedures.MODIFIER_5\n , all_procedures.PRACTITIONER_ID\n , all_procedures.DATA_SOURCE\n , all_procedures.TUVA_LAST_RUN\nfrom all_procedures\nleft join dev_thuxuan.terminology.icd_10_pcs icd10\n on all_procedures.source_code_type = 'icd-10-pcs'\n and all_procedures.source_code = icd10.icd_10_pcs\nleft join dev_thuxuan.terminology.icd_9_pcs icd9\n on all_procedures.source_code_type = 'icd-9-pcs'\n and all_procedures.source_code = icd9.icd_9_pcs\nleft join dev_thuxuan.terminology.hcpcs_level_2 hcpcs\n on all_procedures.source_code_type = 'hcpcs'\n and all_procedures.source_code = hcpcs.hcpcs\nleft join dev_thuxuan.terminology.snomed_ct snomed_ct\n on all_procedures.source_code_type = 'snomed-ct'\n and all_procedures.source_code = snomed_ct.snomed_ct\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_condition.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_condition.sql", "unique_id": "model.the_tuva_project.core__stg_claims_condition", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_condition"], "alias": "_stg_claims_condition", "checksum": {"name": "sha256", "checksum": "70f4ac6066c92f456f93fc68aabf32857258720e3b07a3a44781910a2697d15f"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims conditions", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_condition", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2631967, "relation_name": "dev_thuxuan.core._stg_claims_condition", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the condition table in core.\r\n-- *************************************************\r\n\r\nwith unpivot_cte as (\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_1 as source_code\r\n , 1 as diagnosis_rank\r\n , diagnosis_poa_1 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere diagnosis_code_1 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n\t , discharge_date\r\n\t , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_2 as source_code\r\n , 2 as diagnosis_rank\r\n , diagnosis_poa_2 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_2 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_3 as source_code\r\n , 3 as diagnosis_rank\r\n , diagnosis_poa_3 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_3 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_4 as source_code\r\n , 4 as diagnosis_rank\r\n , diagnosis_poa_4 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_4 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_5 as source_code\r\n , 5 as diagnosis_rank\r\n , diagnosis_poa_5 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_5 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_6 as source_code\r\n , 6 as diagnosis_rank\r\n , diagnosis_poa_6 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_6 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_7 as source_code\r\n , 7 as diagnosis_rank\r\n , diagnosis_poa_7 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_7 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_8 as source_code\r\n , 8 as diagnosis_rank\r\n , diagnosis_poa_8 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_8 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_9 as source_code\r\n , 9 as diagnosis_rank\r\n , diagnosis_poa_9 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_9 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_10 as source_code\r\n , 10 as diagnosis_rank\r\n , diagnosis_poa_10 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_10 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_11 as source_code\r\n , 11 as diagnosis_rank\r\n , diagnosis_poa_11 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_11 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_12 as source_code\r\n , 12 as diagnosis_rank\r\n , diagnosis_poa_12 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_12 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_13 as source_code\r\n , 13 as diagnosis_rank\r\n , diagnosis_poa_13 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_13 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_14 as source_code\r\n , 14 as diagnosis_rank\r\n , diagnosis_poa_14 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_14 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_15 as source_code\r\n , 15 as diagnosis_rank\r\n , diagnosis_poa_15 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_15 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_16 as source_code\r\n , 16 as diagnosis_rank\r\n , diagnosis_poa_16 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_16 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_17 as source_code\r\n , 17 as diagnosis_rank\r\n , diagnosis_poa_17 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_17 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_18 as source_code\r\n , 18 as diagnosis_rank\r\n , diagnosis_poa_18 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_18 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_19 as source_code\r\n , 19 as diagnosis_rank\r\n , diagnosis_poa_19 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_19 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_20 as source_code\r\n , 20 as diagnosis_rank\r\n , diagnosis_poa_20 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_20 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_21 as source_code\r\n , 21 as diagnosis_rank\r\n , diagnosis_poa_21 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_21 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_22 as source_code\r\n , 22 as diagnosis_rank\r\n , diagnosis_poa_22 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_22 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_23 as source_code\r\n , 23 as diagnosis_rank\r\n , diagnosis_poa_23 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_23 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_24 as source_code\r\n , 24 as diagnosis_rank\r\n , diagnosis_poa_24 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_24 is not null\r\n\r\nunion all \r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as recorded_date\r\n , 'discharge_diagnosis' as condition_type\r\n , diagnosis_code_type as source_code_type\r\n , diagnosis_code_25 as source_code\r\n , 25 as diagnosis_rank\r\n , diagnosis_poa_25 as present_on_admit_code\r\n , data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere diagnosis_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n cast(unpivot_cte.data_source||'_'||unpivot_cte.claim_id||'_'||unpivot_cte.diagnosis_rank||'_'||unpivot_cte.source_code as {{ dbt.type_string() }} ) as condition_id\r\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('unpivot_cte.recorded_date', 'YYYY-MM-DD') }} as recorded_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as onset_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as resolved_date\r\n , cast('active' as {{ dbt.type_string() }} ) as status\r\n , cast(unpivot_cte.condition_type as {{ dbt.type_string() }} ) as condition_type\r\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(\r\n case\r\n when icd.icd_10_cm is not null then 'icd-10-cm'\r\n end as {{ dbt.type_string() }}\r\n ) as normalized_code_type\r\n , cast(icd.icd_10_cm as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(icd.long_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(unpivot_cte.diagnosis_rank as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(unpivot_cte.present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(poa.present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom unpivot_cte\r\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id\r\nleft join {{ ref('terminology__icd_10_cm') }} icd\r\n on unpivot_cte.source_code = icd.icd_10_cm\r\nleft join {{ ref('terminology__present_on_admission') }} as poa\r\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_condition.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the condition table in core.\n-- *************************************************\n\nwith unpivot_cte as (\n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_1 as source_code\n , 1 as diagnosis_rank\n , diagnosis_poa_1 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere diagnosis_code_1 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n\t , discharge_date\n\t , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_2 as source_code\n , 2 as diagnosis_rank\n , diagnosis_poa_2 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_2 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_3 as source_code\n , 3 as diagnosis_rank\n , diagnosis_poa_3 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_3 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_4 as source_code\n , 4 as diagnosis_rank\n , diagnosis_poa_4 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_4 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_5 as source_code\n , 5 as diagnosis_rank\n , diagnosis_poa_5 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_5 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_6 as source_code\n , 6 as diagnosis_rank\n , diagnosis_poa_6 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_6 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_7 as source_code\n , 7 as diagnosis_rank\n , diagnosis_poa_7 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_7 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_8 as source_code\n , 8 as diagnosis_rank\n , diagnosis_poa_8 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_8 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_9 as source_code\n , 9 as diagnosis_rank\n , diagnosis_poa_9 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_9 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_10 as source_code\n , 10 as diagnosis_rank\n , diagnosis_poa_10 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_10 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_11 as source_code\n , 11 as diagnosis_rank\n , diagnosis_poa_11 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_11 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_12 as source_code\n , 12 as diagnosis_rank\n , diagnosis_poa_12 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_12 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_13 as source_code\n , 13 as diagnosis_rank\n , diagnosis_poa_13 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_13 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_14 as source_code\n , 14 as diagnosis_rank\n , diagnosis_poa_14 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_14 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_15 as source_code\n , 15 as diagnosis_rank\n , diagnosis_poa_15 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_15 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_16 as source_code\n , 16 as diagnosis_rank\n , diagnosis_poa_16 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_16 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_17 as source_code\n , 17 as diagnosis_rank\n , diagnosis_poa_17 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_17 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_18 as source_code\n , 18 as diagnosis_rank\n , diagnosis_poa_18 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_18 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_19 as source_code\n , 19 as diagnosis_rank\n , diagnosis_poa_19 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_19 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_20 as source_code\n , 20 as diagnosis_rank\n , diagnosis_poa_20 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_20 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_21 as source_code\n , 21 as diagnosis_rank\n , diagnosis_poa_21 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_21 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_22 as source_code\n , 22 as diagnosis_rank\n , diagnosis_poa_22 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_22 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_23 as source_code\n , 23 as diagnosis_rank\n , diagnosis_poa_23 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_23 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_24 as source_code\n , 24 as diagnosis_rank\n , diagnosis_poa_24 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_24 is not null\n\nunion all \n\nselect\n claim_id\n , patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as recorded_date\n , 'discharge_diagnosis' as condition_type\n , diagnosis_code_type as source_code_type\n , diagnosis_code_25 as source_code\n , 25 as diagnosis_rank\n , diagnosis_poa_25 as present_on_admit_code\n , data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere diagnosis_code_25 is not null\n\n)\n\nselect distinct\n cast(unpivot_cte.data_source||'_'||unpivot_cte.claim_id||'_'||unpivot_cte.diagnosis_rank||'_'||unpivot_cte.source_code as TEXT ) as condition_id\n , cast(unpivot_cte.patient_id as TEXT ) as patient_id\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id\n , cast(unpivot_cte.claim_id as TEXT ) as claim_id\n , try_cast( unpivot_cte.recorded_date as date ) as recorded_date\n , try_cast( null as date ) as onset_date\n , try_cast( null as date ) as resolved_date\n , cast('active' as TEXT ) as status\n , cast(unpivot_cte.condition_type as TEXT ) as condition_type\n , cast(unpivot_cte.source_code_type as TEXT ) as source_code_type\n , cast(unpivot_cte.source_code as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(\n case\n when icd.icd_10_cm is not null then 'icd-10-cm'\n end as TEXT\n ) as normalized_code_type\n , cast(icd.icd_10_cm as TEXT ) as normalized_code\n , cast(icd.long_description as TEXT ) as normalized_description\n , cast(unpivot_cte.diagnosis_rank as INT ) as condition_rank\n , cast(unpivot_cte.present_on_admit_code as TEXT ) as present_on_admit_code\n , cast(poa.present_on_admit_description as TEXT ) as present_on_admit_description\n , cast(unpivot_cte.data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id\nleft join dev_thuxuan.terminology.icd_10_cm icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join dev_thuxuan.terminology.present_on_admission as poa\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_eligibility": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_eligibility.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_eligibility.sql", "unique_id": "model.the_tuva_project.core__stg_claims_eligibility", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_eligibility"], "alias": "_stg_claims_eligibility", "checksum": {"name": "sha256", "checksum": "cd111eb33395612e56258189c26fa5e5601b6e13eea6ce8f9e0a417d2a40ab0a"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core eligibility", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_eligibility", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2735012, "relation_name": "dev_thuxuan.core._stg_claims_eligibility", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the eligibility table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(subscriber_id as {{ dbt.type_string() }} ) as subscriber_id\r\n , cast(birth_date as date) as birth_date\r\n , cast(death_date as date) as death_date\r\n , cast(enrollment_start_date as date ) as enrollment_start_date\r\n , cast(enrollment_end_date as date ) as enrollment_end_date\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(payer_type as {{ dbt.type_string() }} ) as payer_type\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\r\n , cast(dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\r\n , cast(medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\r\n , cast(subscriber_relation as {{ dbt.type_string() }} ) as subscriber_relation\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__eligibility') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_eligibility.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the eligibility table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(subscriber_id as TEXT ) as subscriber_id\n , cast(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(enrollment_start_date as date ) as enrollment_start_date\n , cast(enrollment_end_date as date ) as enrollment_end_date\n , cast(payer as TEXT ) as payer\n , cast(payer_type as TEXT ) as payer_type\n , cast(plan as TEXT ) as plan\n , cast(original_reason_entitlement_code as TEXT ) as original_reason_entitlement_code\n , cast(dual_status_code as TEXT ) as dual_status_code\n , cast(medicare_status_code as TEXT ) as medicare_status_code\n , cast(subscriber_relation as TEXT ) as subscriber_relation\n , cast(data_source as TEXT ) as data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_encounter.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_encounter.sql", "unique_id": "model.the_tuva_project.core__stg_claims_encounter", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_encounter"], "alias": "_stg_claims_encounter", "checksum": {"name": "sha256", "checksum": "7b83e0008207f9e21f32f7bdde39f3b2b6178eb7170d776a3d5536b789f024f7"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_encounter", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.253129, "relation_name": "dev_thuxuan.core._stg_claims_encounter", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the encounter table in core.\r\n-- *************************************************\r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast('acute inpatient' as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('acute_inpatient__summary') }} \r\n\r\nunion all \r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast('emergency department' as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('emergency_department__summary') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "acute_inpatient__summary", "package": null, "version": null}, {"name": "emergency_department__summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the encounter table in core.\n-- *************************************************\n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('acute inpatient' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.acute_inpatient_summary \n\nunion all \n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('emergency department' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.emergency_department_summary", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_location": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_location.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_location.sql", "unique_id": "model.the_tuva_project.core__stg_claims_location", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_location"], "alias": "_stg_claims_location", "checksum": {"name": "sha256", "checksum": "a5547fb73ac73c7b03352c605ab3aea4772412a5c9864bd2a57623ffa76a21cc"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims locations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_location", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2572062, "relation_name": "dev_thuxuan.core._stg_claims_location", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'organization'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as location_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_organization_name as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(practice_address_line_1 as {{ dbt.type_string() }} ) as address\r\n , cast(practice_city as {{ dbt.type_string() }} ) as city\r\n , cast(practice_state as {{ dbt.type_string() }} ) as state\r\n , cast(practice_zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast( '{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_location.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom dev_thuxuan.terminology.provider aa\ninner join all_providers_in_claims_dataset bb\non aa.npi = bb.npi\nwhere lower(aa.entity_type_description) = 'organization'\n)\n\n\n\nselect \n cast(npi as TEXT ) as location_id\n , cast(npi as TEXT ) as npi\n , cast(provider_organization_name as TEXT ) as name\n , cast(null as TEXT ) as facility_type\n , cast(parent_organization_name as TEXT ) as parent_organization\n , cast(practice_address_line_1 as TEXT ) as address\n , cast(practice_city as TEXT ) as city\n , cast(practice_state as TEXT ) as state\n , cast(practice_zip_code as TEXT ) as zip_code\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast( '2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_medical_claim.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_medical_claim.sql", "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_medical_claim"], "alias": "_stg_claims_medical_claim", "checksum": {"name": "sha256", "checksum": "b64940f3eaf1b1ed305d3534ef5c81c37ed073b41f2326d94973824919e83c88"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core medical claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_medical_claim", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2494504, "relation_name": "dev_thuxuan.core._stg_claims_medical_claim", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the medical_claim table\r\n-- in core. It adds these 4 fields to the input layer\r\n-- medical claim table:\r\n-- encounter_id\r\n-- service_category_1\r\n-- service_category_2\r\n-- *************************************************\r\n\r\n\r\nselect\r\n cast(med.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(med.claim_line_number as {{ dbt.type_int() }} ) as claim_line_number\r\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id \r\n , cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\r\n , cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(med.member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(med.payer as {{ dbt.type_string() }} ) as payer\r\n , cast(med.plan as {{ dbt.type_string() }} ) as plan\r\n , {{ try_to_cast_date('med.claim_start_date', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('med.claim_end_date', 'YYYY-MM-DD') }} as claim_end_date\r\n , {{ try_to_cast_date('med.claim_line_start_date', 'YYYY-MM-DD') }} as claim_line_start_date\r\n , {{ try_to_cast_date('med.claim_line_end_date', 'YYYY-MM-DD') }} as claim_line_end_date\r\n , {{ try_to_cast_date('med.admission_date', 'YYYY-MM-DD') }} as admission_date\r\n , {{ try_to_cast_date('med.discharge_date', 'YYYY-MM-DD') }} as discharge_date\r\n , cast(srv_group.service_category_1 as {{ dbt.type_string() }} ) as service_category_1\r\n , cast(srv_group.service_category_2 as {{ dbt.type_string() }} ) as service_category_2\r\n , cast(med.admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(med.admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(med.discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(med.place_of_service_code as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(med.bill_type_code as {{ dbt.type_string() }} ) as bill_type_code\r\n , cast(med.ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(med.apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(med.revenue_center_code as {{ dbt.type_string() }} ) as revenue_center_code\r\n , cast(med.service_unit_quantity as {{ dbt.type_numeric() }} ) as service_unit_quantity\r\n , cast(med.hcpcs_code as {{ dbt.type_string() }} ) as hcpcs_code\r\n , cast(med.hcpcs_modifier_1 as {{ dbt.type_string() }} ) as hcpcs_modifier_1\r\n , cast(med.hcpcs_modifier_2 as {{ dbt.type_string() }} ) as hcpcs_modifier_2\r\n , cast(med.hcpcs_modifier_3 as {{ dbt.type_string() }} ) as hcpcs_modifier_3\r\n , cast(med.hcpcs_modifier_4 as {{ dbt.type_string() }} ) as hcpcs_modifier_4\r\n , cast(med.hcpcs_modifier_5 as {{ dbt.type_string() }} ) as hcpcs_modifier_5\r\n , cast(med.rendering_npi as {{ dbt.type_string() }} ) as rendering_npi\r\n , cast(med.billing_npi as {{ dbt.type_string() }} ) as billing_npi\r\n , cast(med.facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , {{ try_to_cast_date('med.paid_date', 'YYYY-MM-DD') }} as paid_date\r\n , cast(med.paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(med.allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(med.charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(med.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\r\n , cast(med.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }} med\r\nleft join {{ ref('service_category__service_category_grouper') }} srv_group\r\n on med.claim_id = srv_group.claim_id\r\n and med.claim_line_number = srv_group.claim_line_number\r\nleft join {{ ref('acute_inpatient__encounter_id') }} ap\r\n on med.claim_id = ap.claim_id\r\n and med.claim_line_number = ap.claim_line_number\r\nleft join {{ ref('emergency_department__int_encounter_id') }} ed\r\n on med.claim_id = ed.claim_id\r\n and med.claim_line_number = ed.claim_line_number", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "service_category__service_category_grouper", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the medical_claim table\n-- in core. It adds these 4 fields to the input layer\n-- medical claim table:\n-- encounter_id\n-- service_category_1\n-- service_category_2\n-- *************************************************\n\n\nselect\n cast(med.claim_id as TEXT ) as claim_id\n , cast(med.claim_line_number as INT ) as claim_line_number\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as TEXT ) as encounter_id \n , cast(med.claim_type as TEXT ) as claim_type\n , cast(med.patient_id as TEXT ) as patient_id\n , cast(med.member_id as TEXT ) as member_id\n , cast(med.payer as TEXT ) as payer\n , cast(med.plan as TEXT ) as plan\n , try_cast( med.claim_start_date as date ) as claim_start_date\n , try_cast( med.claim_end_date as date ) as claim_end_date\n , try_cast( med.claim_line_start_date as date ) as claim_line_start_date\n , try_cast( med.claim_line_end_date as date ) as claim_line_end_date\n , try_cast( med.admission_date as date ) as admission_date\n , try_cast( med.discharge_date as date ) as discharge_date\n , cast(srv_group.service_category_1 as TEXT ) as service_category_1\n , cast(srv_group.service_category_2 as TEXT ) as service_category_2\n , cast(med.admit_source_code as TEXT ) as admit_source_code\n , cast(med.admit_type_code as TEXT ) as admit_type_code\n , cast(med.discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(med.place_of_service_code as TEXT ) as place_of_service_code\n , cast(med.bill_type_code as TEXT ) as bill_type_code\n , cast(med.ms_drg_code as TEXT ) as ms_drg_code\n , cast(med.apr_drg_code as TEXT ) as apr_drg_code\n , cast(med.revenue_center_code as TEXT ) as revenue_center_code\n , cast(med.service_unit_quantity as numeric(28,6) ) as service_unit_quantity\n , cast(med.hcpcs_code as TEXT ) as hcpcs_code\n , cast(med.hcpcs_modifier_1 as TEXT ) as hcpcs_modifier_1\n , cast(med.hcpcs_modifier_2 as TEXT ) as hcpcs_modifier_2\n , cast(med.hcpcs_modifier_3 as TEXT ) as hcpcs_modifier_3\n , cast(med.hcpcs_modifier_4 as TEXT ) as hcpcs_modifier_4\n , cast(med.hcpcs_modifier_5 as TEXT ) as hcpcs_modifier_5\n , cast(med.rendering_npi as TEXT ) as rendering_npi\n , cast(med.billing_npi as TEXT ) as billing_npi\n , cast(med.facility_npi as TEXT ) as facility_npi\n , try_cast( med.paid_date as date ) as paid_date\n , cast(med.paid_amount as numeric(28,6) ) as paid_amount\n , cast(med.allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(med.charge_amount as numeric(28,6) ) as charge_amount\n , cast(med.coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(med.copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(med.deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(med.total_cost_amount as numeric(28,6) ) as total_cost_amount\n , cast(med.data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim med\nleft join dev_thuxuan.claims_preprocessing.service_category_grouper srv_group\n on med.claim_id = srv_group.claim_id\n and med.claim_line_number = srv_group.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id ap\n on med.claim_id = ap.claim_id\n and med.claim_line_number = ap.claim_line_number\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id ed\n on med.claim_id = ed.claim_id\n and med.claim_line_number = ed.claim_line_number", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_patient.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_patient.sql", "unique_id": "model.the_tuva_project.core__stg_claims_patient", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_patient"], "alias": "_stg_claims_patient", "checksum": {"name": "sha256", "checksum": "a4953da3f7b896184bcb08acf5ef58479e8afa521febcc36cbfe9f0d034f39ee"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims patients", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_patient", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2602026, "relation_name": "dev_thuxuan.core._stg_claims_patient", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the patient table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith patient_stage as(\r\n select\r\n patient_id\r\n ,first_name\r\n ,last_name\r\n ,gender\r\n ,race\r\n ,birth_date\r\n ,death_date\r\n ,death_flag\r\n ,social_security_number\r\n ,address\r\n ,city\r\n ,state\r\n ,zip_code\r\n ,phone\r\n ,data_source\r\n ,row_number() over (\r\n\t partition by patient_id\r\n\t order by case when enrollment_end_date is null\r\n then cast ('2050-01-01' as date)\r\n else enrollment_end_date end DESC)\r\n as row_sequence\r\n from {{ ref('normalized_input__eligibility')}}\r\n)\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(first_name as {{ dbt.type_string() }}) as first_name\r\n , cast(last_name as {{ dbt.type_string() }}) as last_name\r\n , cast(gender as {{ dbt.type_string() }}) as sex\r\n , cast(race as {{ dbt.type_string() }}) as race\r\n , cast(birth_date as date) as birth_date\r\n , cast(death_date as date) as death_date\r\n , cast(death_flag as int) as death_flag\r\n , cast(social_security_number as {{ dbt.type_string() }}) as social_security_number\r\n , cast(address as {{ dbt.type_string() }}) as address\r\n , cast(city as {{ dbt.type_string() }}) as city\r\n , cast(state as {{ dbt.type_string() }}) as state\r\n , cast(zip_code as {{ dbt.type_string() }}) as zip_code\r\n , cast(null as {{ dbt.type_string() }}) as county\r\n , cast(null as {{ dbt.type_float() }}) as latitude \r\n , cast(null as {{ dbt.type_float() }}) as longitude\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }}) as tuva_last_run\r\nfrom patient_stage\r\nwhere row_sequence = 1", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_patient.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the patient table in core.\n-- *************************************************\n\n\n\n\nwith patient_stage as(\n select\n patient_id\n ,first_name\n ,last_name\n ,gender\n ,race\n ,birth_date\n ,death_date\n ,death_flag\n ,social_security_number\n ,address\n ,city\n ,state\n ,zip_code\n ,phone\n ,data_source\n ,row_number() over (\n\t partition by patient_id\n\t order by case when enrollment_end_date is null\n then cast ('2050-01-01' as date)\n else enrollment_end_date end DESC)\n as row_sequence\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n)\n\nselect\n cast(patient_id as TEXT) as patient_id\n , cast(first_name as TEXT) as first_name\n , cast(last_name as TEXT) as last_name\n , cast(gender as TEXT) as sex\n , cast(race as TEXT) as race\n , cast(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(death_flag as int) as death_flag\n , cast(social_security_number as TEXT) as social_security_number\n , cast(address as TEXT) as address\n , cast(city as TEXT) as city\n , cast(state as TEXT) as state\n , cast(zip_code as TEXT) as zip_code\n , cast(null as TEXT) as county\n , cast(null as FLOAT) as latitude \n , cast(null as FLOAT) as longitude\n , cast(data_source as TEXT) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_pharmacy_claim.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_pharmacy_claim"], "alias": "_stg_claims_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "741c5e32a6ba38c670980458923fae8e7cd988b11271a782e5cdc51c2a7c0b12"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core pharmacy claims", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_pharmacy_claim", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2704217, "relation_name": "dev_thuxuan.core._stg_claims_pharmacy_claim", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the pharmacy_claim\r\n-- table in core.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nselect\r\n cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , cast(claim_line_number as integer ) as claim_line_number\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\r\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\r\n , cast(dispensing_date as date ) as dispensing_date\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(quantity as integer ) as quantity\r\n , cast(days_supply as integer ) as days_supply\r\n , cast(refills as integer ) as refills\r\n , cast(paid_date as date ) as paid_date\r\n , cast(paid_amount as {{ dbt.type_numeric() }}) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_pharmacy_claim.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the pharmacy_claim\n-- table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(claim_id as TEXT ) as claim_id\n , cast(claim_line_number as integer ) as claim_line_number\n , cast(patient_id as TEXT ) as patient_id\n , cast(member_id as TEXT ) as member_id\n , cast(payer as TEXT ) as payer\n , cast(plan as TEXT ) as plan\n , cast(prescribing_provider_npi as TEXT ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as TEXT ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(quantity as integer ) as quantity\n , cast(days_supply as integer ) as days_supply\n , cast(refills as integer ) as refills\n , cast(paid_date as date ) as paid_date\n , cast(paid_amount as numeric(28,6)) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(data_source as TEXT ) as data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_practitioner.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_practitioner.sql", "unique_id": "model.the_tuva_project.core__stg_claims_practitioner", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_practitioner"], "alias": "_stg_claims_practitioner", "checksum": {"name": "sha256", "checksum": "d9cc7c9b9e9808fc47eb6dc6db67fc14f179549c25d5f4242fb24fdb149eb289"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core providers in the claims dataset", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_practitioner", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2765236, "relation_name": "dev_thuxuan.core._stg_claims_practitioner", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the provider table \r\n-- in core. It includes data about all providers\r\n-- present in the raw claims dataset.\r\n-- *************************************************\r\n\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'individual'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_first_name as {{ dbt.type_string() }} ) as provider_first_name\r\n , cast(provider_last_name as {{ dbt.type_string() }} ) as provider_last_name\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(primary_specialty_description as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "core__stg_claims_medical_claim", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_practitioner.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the provider table \n-- in core. It includes data about all providers\n-- present in the raw claims dataset.\n-- *************************************************\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom dev_thuxuan.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom dev_thuxuan.terminology.provider aa\ninner join all_providers_in_claims_dataset bb\non aa.npi = bb.npi\nwhere lower(aa.entity_type_description) = 'individual'\n)\n\n\n\nselect \n cast(npi as TEXT ) as practitioner_id\n , cast(npi as TEXT ) as npi\n , cast(provider_first_name as TEXT ) as provider_first_name\n , cast(provider_last_name as TEXT ) as provider_last_name\n , cast(parent_organization_name as TEXT ) as practice_affiliation\n , cast(primary_specialty_description as TEXT ) as specialty\n , cast(null as TEXT ) as sub_specialty\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_claims_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_procedure.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_procedure.sql", "unique_id": "model.the_tuva_project.core__stg_claims_procedure", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_procedure"], "alias": "_stg_claims_procedure", "checksum": {"name": "sha256", "checksum": "d1cdc470c1141e6469ba535e67699e6482e2bb5f4bd6154469cf973485bb7ba2"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims procedures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_procedure", "tags": "core_stage_claims", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2662458, "relation_name": "dev_thuxuan.core._stg_claims_procedure", "raw_code": "-- depends_on: {{ ref('data_quality__claims_preprocessing_summary') }}\r\n\r\n{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the procedure table in core.\r\n-- *************************************************\r\n\r\nwith unpivot_cte as (\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , coalesce(admission_date\r\n , claim_start_date\r\n , discharge_date\r\n , claim_end_date\r\n ) as procedure_date\r\n , 'hcpcs' as source_code_type\r\n , hcpcs_code as source_code\r\n , rendering_npi as practitioner_npi\r\n , hcpcs_modifier_1 as modifier_1\r\n , hcpcs_modifier_2 as modifier_2\r\n , hcpcs_modifier_3 as modifier_3\r\n , hcpcs_modifier_4 as modifier_4\r\n , hcpcs_modifier_5 as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\nwhere hcpcs_code is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_1 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_1 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_1 is not null\r\n \r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_2 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_2 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_2 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_3 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_3 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_3 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_4 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_4 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_4 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_5 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_5 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_5 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_6 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_6 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_6 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_7 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_7 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_7 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_8 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_8 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_8 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_9 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_9 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_9 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_10 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_10 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_10 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_11 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_11 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_11 is not null\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_12 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_12 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_12 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_13 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_13 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_13 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_14 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_14 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_14 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_15 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_15 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_15 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_16 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_16 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_16 is not null\r\n \r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_17 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_17 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_17 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_18 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_18 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_18 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_19 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_19 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_19 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_20 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_20 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_20 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_21 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_21 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_21 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_22 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_22 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_22 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_23 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_23 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_23 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_24 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_24 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_24 is not null\r\n\r\nunion distinct\r\n\r\nselect\r\n claim_id as claim_id\r\n , patient_id as patient_id\r\n , procedure_date_25 as procedure_date\r\n , procedure_code_type as source_code_type\r\n , procedure_code_25 as source_code\r\n , rendering_npi as practitioner_npi\r\n , null as modifier_1\r\n , null as modifier_2\r\n , null as modifier_3\r\n , null as modifier_4\r\n , null as modifier_5\r\n , data_source as data_source\r\nfrom {{ ref('normalized_input__medical_claim') }} \r\nwhere procedure_code_25 is not null\r\n\r\n)\r\n\r\nselect distinct\r\n cast(\r\n unpivot_cte.data_source\r\n ||'_'\r\n ||unpivot_cte.claim_id\r\n ||'_'\r\n ||unpivot_cte.source_code\r\n ||case when unpivot_cte.modifier_1 is not null then '_'||unpivot_cte.modifier_1 else '' end\r\n ||case when unpivot_cte.modifier_2 is not null then '_'||unpivot_cte.modifier_2 else '' end\r\n ||case when unpivot_cte.modifier_3 is not null then '_'||unpivot_cte.modifier_3 else '' end\r\n ||case when unpivot_cte.modifier_4 is not null then '_'||unpivot_cte.modifier_4 else '' end\r\n ||case when unpivot_cte.modifier_5 is not null then '_'||unpivot_cte.modifier_5 else '' end\r\n ||case when unpivot_cte.practitioner_npi is not null then '_'||unpivot_cte.practitioner_npi else '' end\r\n as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('unpivot_cte.procedure_date', 'YYYY-MM-DD') }} as procedure_date\r\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(\r\n case\r\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\r\n when hcpcs.hcpcs is not null then 'hcpcs'\r\n end\r\n as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast (\r\n coalesce (\r\n icd.icd_10_pcs\r\n , hcpcs.hcpcs\r\n )\r\n as {{ dbt.type_string() }} ) as normalized_code\r\n , cast (\r\n coalesce (\r\n icd.description\r\n , hcpcs.short_description\r\n )\r\n as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(unpivot_cte.modifier_1 as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(unpivot_cte.modifier_2 as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(unpivot_cte.modifier_3 as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(unpivot_cte.modifier_4 as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(unpivot_cte.modifier_5 as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(unpivot_cte.practitioner_npi as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom unpivot_cte\r\nleft join {{ ref('terminology__icd_10_pcs') }} as icd\r\n on unpivot_cte.source_code = icd.icd_10_pcs\r\nleft join {{ ref('terminology__hcpcs_level_2') }} as hcpcs\r\n on unpivot_cte.source_code = hcpcs.hcpcs\r\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "terminology__hcpcs_level_2", "package": null, "version": null}, {"name": "acute_inpatient__encounter_id", "package": null, "version": null}, {"name": "emergency_department__int_encounter_id", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "compiled": true, "compiled_code": "-- depends_on: dev_thuxuan.data_quality.claims_preprocessing_summary\n\n\n\n-- *************************************************\n-- This dbt model creates the procedure table in core.\n-- *************************************************\n\nwith unpivot_cte as (\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , coalesce(admission_date\n , claim_start_date\n , discharge_date\n , claim_end_date\n ) as procedure_date\n , 'hcpcs' as source_code_type\n , hcpcs_code as source_code\n , rendering_npi as practitioner_npi\n , hcpcs_modifier_1 as modifier_1\n , hcpcs_modifier_2 as modifier_2\n , hcpcs_modifier_3 as modifier_3\n , hcpcs_modifier_4 as modifier_4\n , hcpcs_modifier_5 as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere hcpcs_code is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_1 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_1 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_1 is not null\n \nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_2 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_2 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_2 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_3 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_3 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_3 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_4 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_4 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_4 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_5 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_5 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_5 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_6 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_6 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_6 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_7 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_7 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_7 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_8 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_8 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_8 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_9 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_9 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_9 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_10 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_10 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_10 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_11 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_11 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_11 is not null\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_12 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_12 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_12 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_13 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_13 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_13 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_14 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_14 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_14 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_15 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_15 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_15 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_16 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_16 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_16 is not null\n \nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_17 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_17 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_17 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_18 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_18 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_18 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_19 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_19 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_19 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_20 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_20 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_20 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_21 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_21 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_21 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_22 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_22 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_22 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_23 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_23 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_23 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_24 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_24 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_24 is not null\n\nunion distinct\n\nselect\n claim_id as claim_id\n , patient_id as patient_id\n , procedure_date_25 as procedure_date\n , procedure_code_type as source_code_type\n , procedure_code_25 as source_code\n , rendering_npi as practitioner_npi\n , null as modifier_1\n , null as modifier_2\n , null as modifier_3\n , null as modifier_4\n , null as modifier_5\n , data_source as data_source\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim \nwhere procedure_code_25 is not null\n\n)\n\nselect distinct\n cast(\n unpivot_cte.data_source\n ||'_'\n ||unpivot_cte.claim_id\n ||'_'\n ||unpivot_cte.source_code\n ||case when unpivot_cte.modifier_1 is not null then '_'||unpivot_cte.modifier_1 else '' end\n ||case when unpivot_cte.modifier_2 is not null then '_'||unpivot_cte.modifier_2 else '' end\n ||case when unpivot_cte.modifier_3 is not null then '_'||unpivot_cte.modifier_3 else '' end\n ||case when unpivot_cte.modifier_4 is not null then '_'||unpivot_cte.modifier_4 else '' end\n ||case when unpivot_cte.modifier_5 is not null then '_'||unpivot_cte.modifier_5 else '' end\n ||case when unpivot_cte.practitioner_npi is not null then '_'||unpivot_cte.practitioner_npi else '' end\n as TEXT ) as procedure_id\n , cast(unpivot_cte.patient_id as TEXT ) as patient_id\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id\n , cast(unpivot_cte.claim_id as TEXT ) as claim_id\n , try_cast( unpivot_cte.procedure_date as date ) as procedure_date\n , cast(unpivot_cte.source_code_type as TEXT ) as source_code_type\n , cast(unpivot_cte.source_code as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(\n case\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\n when hcpcs.hcpcs is not null then 'hcpcs'\n end\n as TEXT ) as normalized_code_type\n , cast (\n coalesce (\n icd.icd_10_pcs\n , hcpcs.hcpcs\n )\n as TEXT ) as normalized_code\n , cast (\n coalesce (\n icd.description\n , hcpcs.short_description\n )\n as TEXT ) as normalized_description\n , cast(unpivot_cte.modifier_1 as TEXT ) as modifier_1\n , cast(unpivot_cte.modifier_2 as TEXT ) as modifier_2\n , cast(unpivot_cte.modifier_3 as TEXT ) as modifier_3\n , cast(unpivot_cte.modifier_4 as TEXT ) as modifier_4\n , cast(unpivot_cte.modifier_5 as TEXT ) as modifier_5\n , cast(unpivot_cte.practitioner_npi as TEXT ) as practitioner_id\n , cast(unpivot_cte.data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join dev_thuxuan.terminology.icd_10_pcs as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\nleft join dev_thuxuan.terminology.hcpcs_level_2 as hcpcs\n on unpivot_cte.source_code = hcpcs.hcpcs\nleft join dev_thuxuan.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join dev_thuxuan.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_condition": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_condition.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_condition.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_condition", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_condition"], "alias": "_stg_clinical_condition", "checksum": {"name": "sha256", "checksum": "bcfab95997b76ac5e9983168cc557658be494638cce4f4ec9e172f2f9cc138bf"}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical conditions", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_condition", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2800825, "relation_name": "dev_thuxuan.core._stg_clinical_condition", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(condition_id as {{ dbt.type_string() }} ) as condition_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('recorded_date', 'YYYY-MM-DD') }} as recorded_date\r\n , {{ try_to_cast_date('onset_date', 'YYYY-MM-DD') }} as onset_date\r\n , {{ try_to_cast_date('resolved_date', 'YYYY-MM-DD') }} as resolved_date\r\n , cast(status as {{ dbt.type_string() }} ) as status\r\n , cast(condition_type as {{ dbt.type_string() }} ) as condition_type\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(condition_rank as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('condition') }}", "language": "sql", "refs": [{"name": "condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_condition.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(condition_id as TEXT ) as condition_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( recorded_date as date ) as recorded_date\n , try_cast( onset_date as date ) as onset_date\n , try_cast( resolved_date as date ) as resolved_date\n , cast(status as TEXT ) as status\n , cast(condition_type as TEXT ) as condition_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(condition_rank as INT ) as condition_rank\n , cast(present_on_admit_code as TEXT ) as present_on_admit_code\n , cast(present_on_admit_description as TEXT ) as present_on_admit_description\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_encounter.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_encounter.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_encounter", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_encounter"], "alias": "_stg_clinical_encounter", "checksum": {"name": "sha256", "checksum": "6b8d7f89d9852e86deca237de3fb71eecf2154b14ea7d0c1852be2de2b286867"}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical encounters", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_encounter", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.284081, "relation_name": "dev_thuxuan.core._stg_clinical_encounter", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect \r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_type as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(attending_provider_id as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description \r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('encounter') }}", "language": "sql", "refs": [{"name": "encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_encounter.sql", "compiled": true, "compiled_code": "\n\nselect \n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_type as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(attending_provider_id as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description \n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(paid_amount as numeric(28,6) ) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_lab_result.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_lab_result.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_lab_result"], "alias": "_stg_clinical_lab_result", "checksum": {"name": "sha256", "checksum": "5ba7c6ccdd692123791b12400b25b104a6f6be130f6af3146ef454f89451e481"}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical lab results", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_lab_result", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.287419, "relation_name": "dev_thuxuan.core._stg_clinical_lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(lab_result_id as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(accession_number as {{ dbt.type_string() }} ) as accession_number\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(source_component as {{ dbt.type_string() }} ) as source_component\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(normalized_component as {{ dbt.type_string() }} ) as normalized_component\r\n , cast(status as {{ dbt.type_string() }} ) as status\r\n , cast(result as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('result_date', 'YYYY-MM-DD') }} as result_date\r\n , {{ try_to_cast_date('collection_date', 'YYYY-MM-DD') }} as collection_date\r\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\r\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(source_abnormal_flag as {{ dbt.type_string() }} ) as source_abnormal_flag\r\n , cast(normalized_abnormal_flag as {{ dbt.type_string() }} ) as normalized_abnormal_flag\r\n , cast(specimen as {{ dbt.type_string() }} ) as specimen\r\n , cast(ordering_practitioner_id as {{ dbt.type_string() }} ) as ordering_practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('lab_result') }}", "language": "sql", "refs": [{"name": "lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(lab_result_id as TEXT ) as lab_result_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(accession_number as TEXT ) as accession_number\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(source_component as TEXT ) as source_component\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(normalized_component as TEXT ) as normalized_component\n , cast(status as TEXT ) as status\n , cast(result as TEXT ) as result\n , try_cast( result_date as date ) as result_date\n , try_cast( collection_date as date ) as collection_date\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(source_abnormal_flag as TEXT ) as source_abnormal_flag\n , cast(normalized_abnormal_flag as TEXT ) as normalized_abnormal_flag\n , cast(specimen as TEXT ) as specimen\n , cast(ordering_practitioner_id as TEXT ) as ordering_practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.lab_result", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_location": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_location.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_location.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_location", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_location"], "alias": "_stg_clinical_location", "checksum": {"name": "sha256", "checksum": "6a259b80d51e583fc2fbedac359791c1461e2f34e9b72802d2b4e40d81d027f4"}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical locations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_location", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2914996, "relation_name": "dev_thuxuan.core._stg_clinical_location", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n cast(location_id as {{ dbt.type_string() }} ) as location_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(name as {{ dbt.type_string() }} ) as name\r\n , cast(facility_type as {{ dbt.type_string() }} ) as facility_type\r\n , cast(parent_organization as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(address as {{ dbt.type_string() }} ) as address\r\n , cast(city as {{ dbt.type_string() }} ) as city\r\n , cast(state as {{ dbt.type_string() }} ) as state\r\n , cast(zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(latitude as {{ dbt.type_float() }} ) as latitude\r\n , cast(longitude as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "refs": [{"name": "location", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_location.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(location_id as TEXT ) as location_id\n , cast(npi as TEXT ) as npi\n , cast(name as TEXT ) as name\n , cast(facility_type as TEXT ) as facility_type\n , cast(parent_organization as TEXT ) as parent_organization\n , cast(address as TEXT ) as address\n , cast(city as TEXT ) as city\n , cast(state as TEXT ) as state\n , cast(zip_code as TEXT ) as zip_code\n , cast(latitude as FLOAT ) as latitude\n , cast(longitude as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.location", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_medication.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_medication.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_medication", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_medication"], "alias": "_stg_clinical_medication", "checksum": {"name": "sha256", "checksum": "d0117d9ac0a0b90934eaf6fc6534275c94d3f6588782dba17b751d803473d39b"}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical medications", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_medication", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2945135, "relation_name": "dev_thuxuan.core._stg_clinical_medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(medication_id as {{ dbt.type_string() }} ) as medication_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('dispensing_date', 'YYYY-MM-DD') }} as dispensing_date\r\n , {{ try_to_cast_date('prescribing_date', 'YYYY-MM-DD') }} as prescribing_date\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(ndc_description as {{ dbt.type_string() }} ) as ndc_description\r\n , cast(rxnorm_code as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(rxnorm_description as {{ dbt.type_string() }} ) as rxnorm_description \r\n , cast(atc_code as {{ dbt.type_string() }} ) as atc_code\r\n , cast(atc_description as {{ dbt.type_string() }} ) as atc_description\r\n , cast(route as {{ dbt.type_string() }} ) as route\r\n , cast(strength as {{ dbt.type_string() }} ) as strength\r\n , cast(quantity as {{ dbt.type_int() }} ) as quantity\r\n , cast(quantity_unit as {{ dbt.type_string() }} ) as quantity_unit\r\n , cast(days_supply as {{ dbt.type_int() }} ) as days_supply\r\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('medication') }}", "language": "sql", "refs": [{"name": "medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_medication.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(medication_id as TEXT ) as medication_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , try_cast( dispensing_date as date ) as dispensing_date\n , try_cast( prescribing_date as date ) as prescribing_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(ndc_description as TEXT ) as ndc_description\n , cast(rxnorm_code as TEXT ) as rxnorm_code\n , cast(rxnorm_description as TEXT ) as rxnorm_description \n , cast(atc_code as TEXT ) as atc_code\n , cast(atc_description as TEXT ) as atc_description\n , cast(route as TEXT ) as route\n , cast(strength as TEXT ) as strength\n , cast(quantity as INT ) as quantity\n , cast(quantity_unit as TEXT ) as quantity_unit\n , cast(days_supply as INT ) as days_supply\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.medication", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_observation.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_observation.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_observation", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_observation"], "alias": "_stg_clinical_observation", "checksum": {"name": "sha256", "checksum": "ad5f9b17ef794de5c2f85baa048133d4228140714b206b10dcd3cd21c171a48f"}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical observations", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_observation", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.2975564, "relation_name": "dev_thuxuan.core._stg_clinical_observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n cast(observation_id as {{ dbt.type_string() }} ) as observation_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(panel_id as {{ dbt.type_string() }} ) as panel_id\r\n , {{ try_to_cast_date('observation_date', 'YYYY-MM-DD') }} as observation_date\r\n , cast(observation_type as {{ dbt.type_string() }} ) as observation_type\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(result as {{ dbt.type_string() }} ) as result\r\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\r\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('observation') }}", "language": "sql", "refs": [{"name": "observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_observation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n cast(observation_id as TEXT ) as observation_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(panel_id as TEXT ) as panel_id\n , try_cast( observation_date as date ) as observation_date\n , cast(observation_type as TEXT ) as observation_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(result as TEXT ) as result\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.observation", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_patient.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_patient.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_patient", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_patient"], "alias": "_stg_clinical_patient", "checksum": {"name": "sha256", "checksum": "faf00cae48886707f974022002d0b496035ef32fdf3ea6d873d9feda9b890887"}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical patients", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_patient", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.3005342, "relation_name": "dev_thuxuan.core._stg_clinical_patient", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(sex as {{ dbt.type_string() }} ) as sex\r\n , cast(race as {{ dbt.type_string() }} ) as race\r\n , {{ try_to_cast_date('birth_date', 'YYYY-MM-DD') }} as birth_date\r\n , {{ try_to_cast_date('death_date', 'YYYY-MM-DD') }} as death_date\r\n , cast(death_flag as {{ dbt.type_int() }} ) as death_flag\r\n , cast(social_security_number as {{ dbt.type_string() }} ) as social_security_number\r\n , cast(address as {{ dbt.type_string() }} ) as address\r\n , cast(city as {{ dbt.type_string() }} ) as city\r\n , cast(state as {{ dbt.type_string() }} ) as state\r\n , cast(zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(county as {{ dbt.type_string() }} ) as county\r\n , cast(latitude as {{ dbt.type_float() }} ) as latitude\r\n , cast(longitude as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\n\r\nfrom {{ ref('patient') }}", "language": "sql", "refs": [{"name": "patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(patient_id as TEXT ) as patient_id\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(sex as TEXT ) as sex\n , cast(race as TEXT ) as race\n , try_cast( birth_date as date ) as birth_date\n , try_cast( death_date as date ) as death_date\n , cast(death_flag as INT ) as death_flag\n , cast(social_security_number as TEXT ) as social_security_number\n , cast(address as TEXT ) as address\n , cast(city as TEXT ) as city\n , cast(state as TEXT ) as state\n , cast(zip_code as TEXT ) as zip_code\n , cast(county as TEXT ) as county\n , cast(latitude as FLOAT ) as latitude\n , cast(longitude as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\n\nfrom tuva.input_layer.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_practitioner.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_practitioner.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_practitioner"], "alias": "_stg_clinical_practitioner", "checksum": {"name": "sha256", "checksum": "b64d46371c768da23f692131b68d66bef2a8492afaa5f68e5bd94aa70f5557cb"}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical providers", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_practitioner", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.3037846, "relation_name": "dev_thuxuan.core._stg_clinical_practitioner", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\r\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\r\n , cast(practice_affiliation as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(specialty as {{ dbt.type_string() }} ) as specialty\r\n , cast(sub_specialty as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('practitioner') }}", "language": "sql", "refs": [{"name": "practitioner", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_practitioner.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(practitioner_id as TEXT ) as practitioner_id\n , cast(npi as TEXT ) as npi\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(practice_affiliation as TEXT ) as practice_affiliation\n , cast(specialty as TEXT ) as specialty\n , cast(sub_specialty as TEXT ) as sub_specialty\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.practitioner", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "dev_thuxuan", "schema": "core", "name": "core__stg_clinical_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_clinical_procedure.sql", "original_file_path": "models\\core\\staging\\core__stg_clinical_procedure.sql", "unique_id": "model.the_tuva_project.core__stg_clinical_procedure", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_procedure"], "alias": "_stg_clinical_procedure", "checksum": {"name": "sha256", "checksum": "4c9bb4f3ddd1136ac2ea875328b04be6603eb75b8ef44410761ce36054d29471"}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1A9A89"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical procedures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1A9A89"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_procedure", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1A9A89"}}, "created_at": 1715884194.306789, "relation_name": "dev_thuxuan.core._stg_clinical_procedure", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False)) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n cast(procedure_id as {{ dbt.type_string() }} ) as procedure_id \r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('procedure_date', 'YYYY-MM-DD') }} as procedure_date\r\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\r\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(modifier_1 as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(modifier_2 as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(modifier_3 as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(modifier_4 as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(modifier_5 as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('procedure') }}", "language": "sql", "refs": [{"name": "procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(procedure_id as TEXT ) as procedure_id \n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( procedure_date as date ) as procedure_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(modifier_1 as TEXT ) as modifier_1\n , cast(modifier_2 as TEXT ) as modifier_2\n , cast(modifier_3 as TEXT ) as modifier_3\n , cast(modifier_4 as TEXT ) as modifier_4\n , cast(modifier_5 as TEXT ) as modifier_5\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2024-05-16 18:33:00.017657+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_summary": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_summary"], "alias": "claims_preprocessing_summary", "checksum": {"name": "sha256", "checksum": "49f684cbbe83a011297254e89ae0ad026e290c4ae7da164c5503c000c857bd2a"}, "config": {"enabled": true, "alias": "claims_preprocessing_summary", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed\n", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_summary", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.315799, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_failure_summary as (\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(count(distinct foreign_key||data_source) as int) as counts\r\n from {{ ref('data_quality__claims_preprocessing_test_detail' )}}\r\n group by\r\n source_table\r\n ,grain\r\n ,test_category\r\n)\r\n\r\n, summary_union as(\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n from test_failure_summary\r\n\r\n /******* The tables below populate the test when no failures are present ******/\r\n union all\r\n\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('claim_type' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts \r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_claim_type_mapping_failures' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_claim_type_unmapped' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('header' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_institutional_header_fail_details' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_professional_header_fail_details' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values' )}} )\r\n and not exists (select 1 from {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values' )}} )\r\n\r\n /**** eligibility ****/\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_eligibility' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_eligibility_missing_values' )}} )\r\n\r\n /**** pharmacy_claim ****/\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_pharmacy_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('normalized_input__pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_quality__claims_preprocessing_pharmacy_claim_missing_values' )}} )\r\n)\r\n\r\nselect \r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(case \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'good'\r\n then '7_good' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\r\n then '4_plausibility' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'good'\r\n then '5_good'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility' \r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'good'\r\n then '4_good'\r\n else test_category \r\n end as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom summary_union", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_unmapped", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_institutional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_professional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_summary.sql", "compiled": true, "compiled_code": "\n\nwith test_failure_summary as (\n select\n cast(source_table as TEXT ) as source_table\n , cast(grain as TEXT ) as grain\n , cast(test_category as TEXT ) as test_category\n , cast(count(distinct foreign_key||data_source) as int) as counts\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n group by\n source_table\n ,grain\n ,test_category\n)\n\n, summary_union as(\n select\n cast(source_table as TEXT ) as source_table\n , cast(grain as TEXT ) as grain\n , cast(test_category as TEXT ) as test_category\n , cast(counts as int) as counts\n from test_failure_summary\n\n /******* The tables below populate the test when no failures are present ******/\n union all\n\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('duplicate_claims' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('claim_type' as TEXT ) as test_category\n , cast(0 as int) as counts \n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values where test_category = 'claim_type')\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values where test_category = 'claim_type')\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('header' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('invalid_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values )\n union all\n select * from (\n select\n cast('normalized_input__medical_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values )\n and not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values )\n\n /**** eligibility ****/\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('duplicate_eligibility' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('invalid_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values )\n union all\n select * from (\n select\n cast('normalized_input__eligibility' as TEXT ) as source_table\n , cast('patient_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values )\n\n /**** pharmacy_claim ****/\n union all\n select * from (\n select\n cast('normalized_input__pharmacy_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('duplicate_claims' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates )\n union all\n select * from (\n select\n cast('normalized_input__pharmacy_claim' as TEXT ) as source_table\n , cast('claim_id' as TEXT ) as grain\n , cast('missing_values' as TEXT ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values )\n)\n\nselect \n cast(source_table as TEXT ) as source_table\n , cast(case \n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'normalized_input__medical_claim' and test_category = 'good'\n then '7_good' \n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\n then '4_plausibility' \n when source_table = 'normalized_input__eligibility' and test_category = 'good'\n then '5_good'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility' \n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'good'\n then '4_good'\n else test_category \n end as TEXT ) as test_category\n , cast(counts as int) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_test_detail"], "alias": "claims_preprocessing_test_detail", "checksum": {"name": "sha256", "checksum": "99d7406f5445c1c5271c13c90162b53409592179b39befea2a9c0ae9d350100f"}, "config": {"enabled": true, "alias": "claims_preprocessing_test_detail", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_test": {"name": "pipeline_test", "description": "Flag to indicate a pipeline stopping test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_test_detail", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3224719, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_test_detail", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_detail_union as(\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_medical_claim') }}\r\nunion all\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_eligibility') }}\r\nunion all\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim') }}\r\n\r\n\r\n)\r\n\r\nselect \r\n source_table\r\n , case \r\n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\r\n then '4_plausibility'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility'\r\n else test_category \r\n end as test_category\r\n , test_name \r\n , grain\r\n , claim_type\r\n , pipeline_test\r\n , foreign_key\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom test_detail_union", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail_stage_medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail_stage_eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_detail.sql", "compiled": true, "compiled_code": "\n\nwith test_detail_union as(\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_medical_claim\nunion all\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_eligibility\nunion all\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_pharmacy_claim\n\n\n)\n\nselect \n source_table\n , case \n when source_table = 'normalized_input__medical_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__medical_claim' and test_category = 'claim_type'\n then '2_claim_type'\n when source_table = 'normalized_input__medical_claim' and test_category = 'header'\n then '3_header'\n when source_table = 'normalized_input__medical_claim' and test_category = 'invalid_values'\n then '4_invalid_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'missing_values'\n then '5_missing_values'\n when source_table = 'normalized_input__medical_claim' and test_category = 'plausibility'\n then '6_plausibility' \n when source_table = 'normalized_input__eligibility' and test_category = 'duplicate_eligibility'\n then '1_duplicate_eligibility'\n when source_table = 'normalized_input__eligibility' and test_category = 'invalid_values'\n then '2_invalid_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'missing_values'\n then '3_missing_values'\n when source_table = 'normalized_input__eligibility' and test_category = 'plausibility'\n then '4_plausibility'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'duplicate_claims'\n then '1_duplicate_claims'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'missing_values'\n then '2_missing_values'\n when source_table = 'normalized_input__pharmacy_claim' and test_category = 'plausibility'\n then '3_plausibility'\n else test_category \n end as test_category\n , test_name \n , grain\n , claim_type\n , pipeline_test\n , foreign_key\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_test_result"], "alias": "claims_preprocessing_test_result", "checksum": {"name": "sha256", "checksum": "9be47daf9dfecf8dda1b228df662326e4fa3ae88112c33461759ade2203f35d4"}, "config": {"enabled": true, "alias": "claims_preprocessing_test_result", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pipeline_test": {"name": "pipeline_test", "description": "Flag to indicate a pipeline stopping test", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_test_result", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3288941, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_test_result", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_eligibility') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_quality__claims_preprocessing_test_result_stage_pharmacy_claim') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result_stage_medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_result_stage_eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_test_result.sql", "compiled": true, "compiled_code": "\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_medical_claim\n\nunion all\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_eligibility\n\nunion all\n\nselect * from dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_use_case": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_use_case", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "final", "data_quality__claims_preprocessing_use_case"], "alias": "claims_preprocessing_use_case", "checksum": {"name": "sha256", "checksum": "60facc24a665f75ff21f4a368b5431c0e5e7f0b445119e5433338e1fb27181b9"}, "config": {"enabled": true, "alias": "claims_preprocessing_use_case", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "claims_preprocessing_use_case", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3344033, "relation_name": "dev_thuxuan.data_quality.claims_preprocessing_use_case", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\nwith use_case_stage as(\r\n select\r\n 'encounters' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all\r\n\r\n select \r\n 'service_grouper' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'hcpcs_code missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'pmpm' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'dispensing_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'paid_amount missing'\r\n )\r\n and source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'member_months' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct patient_id||data_source) from {{ ref('normalized_input__eligibility') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'enrollment_start_date missing'\r\n ,'enrollment_end_date invalid'\r\n ,'payer missing'\r\n ,'payer missing'\r\n ,'payer_type invalid'\r\n )\r\n and source_table = 'normalized_input__eligibility'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__medical_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'claim_start_date missing'\r\n ,'claim_start_date invalid'\r\n ,'patient_id missing'\r\n ,'patient_id invalid'\r\n ,'diagnosis_code_type missing'\r\n ,'diagnosis_code_type invalid'\r\n ,'procedure_code_1 missing'\r\n ,'procedure_code_1 invalid'\r\n ,'procedure_code_type invalid'\r\n ,'procedure_code_type missing'\r\n /** encounter fields **/\r\n ,'diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'normalized_input__medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key||data_source) as failures\r\n , (select count(distinct claim_id||data_source) from {{ ref('normalized_input__pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_quality__claims_preprocessing_test_detail')}}\r\n where 1=1\r\n and test_name in ('ndc_code missing'\r\n ,'patient_id missing'\r\n ,'paid_date missing'\r\n )\r\n and source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from use_case_stage", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\final\\data_quality__claims_preprocessing_use_case.sql", "compiled": true, "compiled_code": "\nwith use_case_stage as(\n select\n 'encounters' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all\n\n select \n 'service_grouper' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'hcpcs_code missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'readmissions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'pmpm' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'claim_start_date missing'\n ,'claim_type invalid'\n ,'claim_type missing'\n\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'readmissions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'dispensing_date missing'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'paid_amount missing'\n )\n and source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'member_months' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct patient_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_eligibility ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('patient_id missing'\n ,'enrollment_start_date missing'\n ,'enrollment_end_date invalid'\n ,'payer missing'\n ,'payer missing'\n ,'payer_type invalid'\n )\n and source_table = 'normalized_input__eligibility'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'chronic_conditions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'claim_start_date missing'\n ,'claim_start_date invalid'\n ,'patient_id missing'\n ,'patient_id invalid'\n ,'diagnosis_code_type missing'\n ,'diagnosis_code_type invalid'\n ,'procedure_code_1 missing'\n ,'procedure_code_1 invalid'\n ,'procedure_code_type invalid'\n ,'procedure_code_type missing'\n /** encounter fields **/\n ,'diagnosis_code_1 missing'\n ,'diagnosis_code_1 invalid'\n ,'revenue_center_code missing'\n ,'revenue_center_code invalid'\n ,'discharge_disposition_code missing'\n ,'discharge_disposition_code invalid'\n ,'ms_drg_code missing'\n ,'ms_drg_code invalid'\n ,'bill_type_code missing'\n ,'bill_type_code invalid'\n ,'place_of_service_code missing'\n ,'place_of_service_code invalid'\n ,'claim_type invalid'\n ,'claim_type missing'\n ,'claim_id missing'\n ,'patient_id missing'\n ,'claim_start_date missing'\n ,'claim_end_date missing'\n ,'facility_npi missing'\n )\n and source_table = 'normalized_input__medical_claim'\n group by\n source_table\n , test_name\n\n union all \n\n select \n 'chronic_conditions' as use_case\n , source_table\n , test_name\n , count(distinct foreign_key||data_source) as failures\n , (select count(distinct claim_id||data_source) from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim ) as denominator\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where 1=1\n and test_name in ('ndc_code missing'\n ,'patient_id missing'\n ,'paid_date missing'\n )\n and source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , test_name\n)\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_claim_type_mapping_failures"], "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "checksum": {"name": "sha256", "checksum": "9dd1e802f1053b6ef9dd084a94ce6129397a3396e3e877af4b63d57a0fd7f97b"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_claim_type_mapping_failures", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3905034, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith claim_type_mapping as (\r\n\r\n select \r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , claim_type as source_claim_type\r\n , case\r\n when bill_type_code is not null or revenue_center_code is not null \r\n then 'institutional'\r\n when place_of_service_code is not null\r\n then 'professional'\r\n else null\r\n end as data_profiling_claim_type\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_type_mapping.claim_id\r\n , claim_type_mapping.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_type_mapping\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type mapping incorrect'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\nwhere claim_type_mapping.source_claim_type <> claim_type_mapping.data_profiling_claim_type\r\ngroup by\r\n claim_type_mapping.claim_id\r\n , claim_type_mapping.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_mapping_failures.sql", "compiled": true, "compiled_code": "\n\nwith claim_type_mapping as (\n\n select \n claim_id\n , claim_line_number\n , data_source\n , claim_type as source_claim_type\n , case\n when bill_type_code is not null or revenue_center_code is not null \n then 'institutional'\n when place_of_service_code is not null\n then 'professional'\n else null\n end as data_profiling_claim_type\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_type_mapping.claim_id\n , claim_type_mapping.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom claim_type_mapping\n left join test_catalog\n on test_catalog.test_name = 'claim_type mapping incorrect'\n and test_catalog.source_table = 'normalized_input__medical_claim'\nwhere claim_type_mapping.source_claim_type <> claim_type_mapping.data_profiling_claim_type\ngroup by\n claim_type_mapping.claim_id\n , claim_type_mapping.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_claim_type_unmapped", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_claim_type_unmapped"], "alias": "_int_claims_preprocessing_claim_type_unmapped", "checksum": {"name": "sha256", "checksum": "d66e328804ba900623e0c3a087abb76f3221526f47a77b93e933121613552367"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_claim_type_unmapped", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_claim_type_unmapped", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3609414, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_type\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\nwhere medical_claim.claim_type is null\r\ngroup by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_claim_type_unmapped.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select\n claim_id\n , data_source\n , claim_type\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom medical_claim\n left join test_catalog\n on test_catalog.test_name = 'claim_type missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\nwhere medical_claim.claim_type is null\ngroup by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_denominators"], "alias": "_int_claims_preprocessing_eligibility_denominators", "checksum": {"name": "sha256", "checksum": "03e9cc2613a0a3a628678c708cc92d4609312b53e21de546d2f6bcbe48c73e86"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_denominators", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_denominators", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3494163, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Denominator logic for invalid value tests is dependent on whether that\r\n specific field is populated or not. We created a macro to automatically\r\n generate the CTE. All invalid value tests must have a\r\n test_category = 'invalid_values' in the catalog seed.\r\n*/\r\nwith all_denominator as (\r\n\r\n select\r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct patient_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, invalid_value_denominators as (\r\n\r\n {{ eligibility_denominator_invalid_values(builtins.ref('normalized_input__eligibility')) }}\r\n\r\n)\r\n\r\nselect * from all_denominator\r\nunion all\r\nselect * from invalid_value_denominators", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.eligibility_denominator_invalid_values"], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_denominators.sql", "compiled": true, "compiled_code": "\n/*\n Denominator logic for invalid value tests is dependent on whether that\n specific field is populated or not. We created a macro to automatically\n generate the CTE. All invalid value tests must have a\n test_category = 'invalid_values' in the catalog seed.\n*/\nwith all_denominator as (\n\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, invalid_value_denominators as (\n\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'dual_status_code'\n where rel.dual_status_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'gender'\n where rel.gender is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'medicare_status_code'\n where rel.medicare_status_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'original_reason_entitlement_code'\n where rel.original_reason_entitlement_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'payer_type'\n where rel.payer_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.patient_id) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__eligibility'\n and cat.test_field = 'race'\n where rel.race is not null\n group by cat.test_name\n \n\n)\n\nselect * from all_denominator\nunion all\nselect * from invalid_value_denominators", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_duplicates"], "alias": "_int_claims_preprocessing_eligibility_duplicates", "checksum": {"name": "sha256", "checksum": "ee3dfd309f727c2ebeb0f9f2c64ae839110fad0bfd553243b3656e94e33a2247"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3374221, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligibility as (\r\n\r\n select\r\n patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , data_source\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate eligibility'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\ngroup by\r\n eligibility.patient_id\r\n , eligibility.member_id\r\n , eligibility.payer\r\n , eligibility.plan\r\n , eligibility.enrollment_start_date\r\n , eligibility.enrollment_end_date\r\n , eligibility.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith eligibility as (\n\n select\n patient_id\n , member_id\n , payer\n , plan\n , enrollment_start_date\n , enrollment_end_date\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , patient_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom eligibility\n left join test_catalog\n on test_catalog.test_name = 'duplicate eligibility'\n and test_catalog.source_table = 'normalized_input__eligibility'\ngroup by\n eligibility.patient_id\n , eligibility.member_id\n , eligibility.payer\n , eligibility.plan\n , eligibility.enrollment_start_date\n , eligibility.enrollment_end_date\n , eligibility.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_invalid_values"], "alias": "_int_claims_preprocessing_eligibility_invalid_values", "checksum": {"name": "sha256", "checksum": "7c71ea7373e62942ad0206bbe4367c6a34dfb5c139df0ab7a1752c5f341be773"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_invalid_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_invalid_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3414176, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligiblity as (\r\n\r\n select *\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_gender as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.gender\r\n , count(eligiblity.gender) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__gender') }} gender\r\n on eligiblity.gender = gender.gender\r\n left join test_catalog\r\n on test_catalog.test_name = 'gender invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where gender.gender is null\r\n and eligiblity.gender is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.gender\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_race as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.race\r\n , count(eligiblity.race) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__race') }} race\r\n on eligiblity.race = race.description\r\n left join test_catalog\r\n on test_catalog.test_name = 'race invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where race.description is null\r\n and eligiblity.race is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.race\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_payer_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.payer_type\r\n , count(eligiblity.payer_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__payer_type') }} payer\r\n on eligiblity.payer_type = payer.payer_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'payer_type invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where payer.payer_type is null\r\n and eligiblity.payer_type is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.payer_type\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_orec as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.original_reason_entitlement_code\r\n , count(eligiblity.original_reason_entitlement_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_orec') }} orec\r\n on eligiblity.original_reason_entitlement_code = orec.original_reason_entitlement_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'original_reason_entitlement_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where orec.original_reason_entitlement_code is null\r\n and eligiblity.original_reason_entitlement_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.original_reason_entitlement_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_dual_status_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.dual_status_code\r\n , count(eligiblity.dual_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_dual_eligibility') }} dual\r\n on eligiblity.dual_status_code = dual.dual_status_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'dual_status_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where dual.dual_status_code is null\r\n and eligiblity.dual_status_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.dual_status_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_medicare_status_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.medicare_status_code\r\n , count(eligiblity.medicare_status_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join {{ ref('terminology__medicare_status') }} status\r\n on eligiblity.medicare_status_code = status.medicare_status_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'medicare_status_code invalid'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where status.medicare_status_code is null\r\n and eligiblity.medicare_status_code is not null\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , eligiblity.medicare_status_code\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_gender\r\nunion all\r\nselect * from valid_race\r\nunion all\r\nselect * from valid_payer_type\r\nunion all\r\nselect * from valid_orec\r\nunion all\r\nselect * from valid_dual_status_code\r\nunion all\r\nselect * from valid_medicare_status_code", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__gender", "package": null, "version": null}, {"name": "terminology__race", "package": null, "version": null}, {"name": "terminology__payer_type", "package": null, "version": null}, {"name": "terminology__medicare_orec", "package": null, "version": null}, {"name": "terminology__medicare_dual_eligibility", "package": null, "version": null}, {"name": "terminology__medicare_status", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__race", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_status"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith eligiblity as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_gender as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.gender\n , count(eligiblity.gender) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.gender gender\n on eligiblity.gender = gender.gender\n left join test_catalog\n on test_catalog.test_name = 'gender invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where gender.gender is null\n and eligiblity.gender is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.gender\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_race as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.race\n , count(eligiblity.race) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.race race\n on eligiblity.race = race.description\n left join test_catalog\n on test_catalog.test_name = 'race invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where race.description is null\n and eligiblity.race is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.race\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_payer_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.payer_type\n , count(eligiblity.payer_type) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.payer_type payer\n on eligiblity.payer_type = payer.payer_type\n left join test_catalog\n on test_catalog.test_name = 'payer_type invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where payer.payer_type is null\n and eligiblity.payer_type is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.payer_type\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_orec as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.original_reason_entitlement_code\n , count(eligiblity.original_reason_entitlement_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_orec orec\n on eligiblity.original_reason_entitlement_code = orec.original_reason_entitlement_code\n left join test_catalog\n on test_catalog.test_name = 'original_reason_entitlement_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where orec.original_reason_entitlement_code is null\n and eligiblity.original_reason_entitlement_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.original_reason_entitlement_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_dual_status_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.dual_status_code\n , count(eligiblity.dual_status_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_dual_eligibility dual\n on eligiblity.dual_status_code = dual.dual_status_code\n left join test_catalog\n on test_catalog.test_name = 'dual_status_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where dual.dual_status_code is null\n and eligiblity.dual_status_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.dual_status_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_medicare_status_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.medicare_status_code\n , count(eligiblity.medicare_status_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join dev_thuxuan.terminology.medicare_status status\n on eligiblity.medicare_status_code = status.medicare_status_code\n left join test_catalog\n on test_catalog.test_name = 'medicare_status_code invalid'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where status.medicare_status_code is null\n and eligiblity.medicare_status_code is not null\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , eligiblity.medicare_status_code\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_gender\nunion all\nselect * from valid_race\nunion all\nselect * from valid_payer_type\nunion all\nselect * from valid_orec\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_missing_values"], "alias": "_int_claims_preprocessing_eligibility_missing_values", "checksum": {"name": "sha256", "checksum": "6b795bc5cbe1311ebfc8c7aab36517f89622b834060bf48e51bfd1da853a9f07"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3444169, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set eligibility_missing_column_list = [\r\n 'patient_id'\r\n , 'member_id'\r\n , 'gender'\r\n , 'race'\r\n , 'birth_date'\r\n , 'death_date'\r\n , 'death_flag'\r\n , 'enrollment_start_date'\r\n , 'enrollment_end_date'\r\n , 'payer'\r\n , 'payer_type'\r\n , 'dual_status_code'\r\n , 'medicare_status_code'\r\n , 'first_name'\r\n , 'last_name'\r\n , 'address'\r\n , 'city'\r\n , 'state'\r\n , 'zip_code'\r\n , 'phone'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith eligibility_missing as (\r\n\r\n {{ eligibility_missing_column_check(builtins.ref('normalized_input__eligibility'), eligibility_missing_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , eligibility_missing.patient_id\r\n , eligibility_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\n left join test_catalog\r\n on test_catalog.test_name = eligibility_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\ngroup by\r\n eligibility_missing.patient_id\r\n , eligibility_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith eligibility_missing as (\n\n \n select\n patient_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where patient_id is null\n union all\n select\n patient_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where member_id is null\n union all\n select\n patient_id\n , data_source\n , 'gender' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where gender is null\n union all\n select\n patient_id\n , data_source\n , 'race' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where race is null\n union all\n select\n patient_id\n , data_source\n , 'birth_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where birth_date is null\n union all\n select\n patient_id\n , data_source\n , 'death_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where death_date is null\n union all\n select\n patient_id\n , data_source\n , 'death_flag' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where death_flag is null\n union all\n select\n patient_id\n , data_source\n , 'enrollment_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where enrollment_start_date is null\n union all\n select\n patient_id\n , data_source\n , 'enrollment_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where enrollment_end_date is null\n union all\n select\n patient_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where payer is null\n union all\n select\n patient_id\n , data_source\n , 'payer_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where payer_type is null\n union all\n select\n patient_id\n , data_source\n , 'dual_status_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where dual_status_code is null\n union all\n select\n patient_id\n , data_source\n , 'medicare_status_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where medicare_status_code is null\n union all\n select\n patient_id\n , data_source\n , 'first_name' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where first_name is null\n union all\n select\n patient_id\n , data_source\n , 'last_name' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where last_name is null\n union all\n select\n patient_id\n , data_source\n , 'address' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where address is null\n union all\n select\n patient_id\n , data_source\n , 'city' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where city is null\n union all\n select\n patient_id\n , data_source\n , 'state' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where state is null\n union all\n select\n patient_id\n , data_source\n , 'zip_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where zip_code is null\n union all\n select\n patient_id\n , data_source\n , 'phone' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where phone is null\n union all\n select\n patient_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n where data_source is null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'patient_id' as grain\n , eligibility_missing.patient_id\n , eligibility_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom eligibility_missing\n left join test_catalog\n on test_catalog.test_name = eligibility_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__eligibility'\ngroup by\n eligibility_missing.patient_id\n , eligibility_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_eligibility_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_eligibility_plausibility"], "alias": "_int_claims_preprocessing_eligibility_plausibility", "checksum": {"name": "sha256", "checksum": "f0abd1cbfb4ba0f705f6e13ef468549372c8b30f1c730de4814b4ec299921f0a"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_eligibility_plausibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_eligibility_plausibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3539405, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith eligiblity as (\r\n\r\n select *\r\n from {{ ref('normalized_input__eligibility') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, multiple_genders_test as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple genders'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.gender) > 1\r\n\r\n)\r\n\r\n, multiple_races_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple races'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.race) > 1\r\n\r\n)\r\n\r\n, multiple_birth_dates_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple birth dates'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.birth_date) > 1\r\n\r\n)\r\n\r\n, multiple_death_dates_test as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'multiple death dates'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n having count(distinct eligiblity.death_date) > 1\r\n\r\n)\r\n\r\n, birth_date_after_death_date as(\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'patient_id' as grain\r\n , eligiblity.patient_id\r\n , eligiblity.data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from eligiblity\r\n left join test_catalog\r\n on test_catalog.test_name = 'birth date after death date'\r\n and test_catalog.source_table = 'normalized_input__eligibility'\r\n where eligiblity.birth_date > eligiblity.death_date\r\n group by\r\n eligiblity.patient_id\r\n , eligiblity.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from multiple_genders_test\r\nunion all\r\nselect * from multiple_races_test\r\nunion all\r\nselect * from multiple_birth_dates_test\r\nunion all\r\nselect * from multiple_death_dates_test\r\nunion all\r\nselect * from birth_date_after_death_date", "language": "sql", "refs": [{"name": "normalized_input__eligibility", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_eligibility_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith eligiblity as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_eligibility\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, multiple_genders_test as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple genders'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.gender) > 1\n\n)\n\n, multiple_races_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple races'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.race) > 1\n\n)\n\n, multiple_birth_dates_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple birth dates'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.birth_date) > 1\n\n)\n\n, multiple_death_dates_test as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'multiple death dates'\n and test_catalog.source_table = 'normalized_input__eligibility'\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n having count(distinct eligiblity.death_date) > 1\n\n)\n\n, birth_date_after_death_date as(\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'patient_id' as grain\n , eligiblity.patient_id\n , eligiblity.data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from eligiblity\n left join test_catalog\n on test_catalog.test_name = 'birth date after death date'\n and test_catalog.source_table = 'normalized_input__eligibility'\n where eligiblity.birth_date > eligiblity.death_date\n group by\n eligiblity.patient_id\n , eligiblity.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from multiple_genders_test\nunion all\nselect * from multiple_races_test\nunion all\nselect * from multiple_birth_dates_test\nunion all\nselect * from multiple_death_dates_test\nunion all\nselect * from birth_date_after_death_date", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_institutional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_institutional_header_fail_details"], "alias": "_int_claims_preprocessing_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "812963ea27bec2d240008e7830bbdb4a32388cb6a1add219889237ff777a0a61"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_institutional_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_institutional_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.364033, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set institutional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'admission_date'\r\n , 'discharge_date'\r\n , 'admit_source_code'\r\n , 'admit_type_code'\r\n , 'discharge_disposition_code'\r\n , 'bill_type_code'\r\n , 'ms_drg_code'\r\n , 'facility_npi'\r\n , 'billing_npi'\r\n , 'rendering_npi'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'diagnosis_poa_1'\r\n , 'diagnosis_poa_2'\r\n , 'diagnosis_poa_3'\r\n , 'diagnosis_poa_4'\r\n , 'diagnosis_poa_5'\r\n , 'diagnosis_poa_6'\r\n , 'diagnosis_poa_7'\r\n , 'diagnosis_poa_8'\r\n , 'diagnosis_poa_9'\r\n , 'diagnosis_poa_10'\r\n , 'diagnosis_poa_11'\r\n , 'diagnosis_poa_12'\r\n , 'diagnosis_poa_13'\r\n , 'diagnosis_poa_14'\r\n , 'diagnosis_poa_15'\r\n , 'diagnosis_poa_16'\r\n , 'diagnosis_poa_17'\r\n , 'diagnosis_poa_18'\r\n , 'diagnosis_poa_19'\r\n , 'diagnosis_poa_20'\r\n , 'diagnosis_poa_21'\r\n , 'diagnosis_poa_22'\r\n , 'diagnosis_poa_23'\r\n , 'diagnosis_poa_24'\r\n , 'diagnosis_poa_25'\r\n , 'procedure_code_type'\r\n , 'procedure_code_1'\r\n , 'procedure_code_2'\r\n , 'procedure_code_3'\r\n , 'procedure_code_4'\r\n , 'procedure_code_5'\r\n , 'procedure_code_6'\r\n , 'procedure_code_7'\r\n , 'procedure_code_8'\r\n , 'procedure_code_9'\r\n , 'procedure_code_10'\r\n , 'procedure_code_11'\r\n , 'procedure_code_12'\r\n , 'procedure_code_13'\r\n , 'procedure_code_14'\r\n , 'procedure_code_15'\r\n , 'procedure_code_16'\r\n , 'procedure_code_17'\r\n , 'procedure_code_18'\r\n , 'procedure_code_19'\r\n , 'procedure_code_20'\r\n , 'procedure_code_21'\r\n , 'procedure_code_22'\r\n , 'procedure_code_23'\r\n , 'procedure_code_24'\r\n , 'procedure_code_25'\r\n , 'procedure_date_1'\r\n , 'procedure_date_2'\r\n , 'procedure_date_3'\r\n , 'procedure_date_4'\r\n , 'procedure_date_5'\r\n , 'procedure_date_6'\r\n , 'procedure_date_7'\r\n , 'procedure_date_8'\r\n , 'procedure_date_9'\r\n , 'procedure_date_10'\r\n , 'procedure_date_11'\r\n , 'procedure_date_12'\r\n , 'procedure_date_13'\r\n , 'procedure_date_14'\r\n , 'procedure_date_15'\r\n , 'procedure_date_16'\r\n , 'procedure_date_17'\r\n , 'procedure_date_18'\r\n , 'procedure_date_19'\r\n , 'procedure_date_20'\r\n , 'procedure_date_21'\r\n , 'procedure_date_22'\r\n , 'procedure_date_23'\r\n , 'procedure_date_24'\r\n , 'procedure_date_25'\r\n , 'data_source'\r\n] -%}\r\n\r\n\r\nwith institutional_header_duplicates as (\r\n\r\n {{ medical_claim_header_duplicate_check(builtins.ref('normalized_input__medical_claim'), institutional_header_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , institutional_header_duplicates.claim_id\r\n , institutional_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = institutional_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n and test_catalog.claim_type = 'institutional'\r\ngroup by \r\n institutional_header_duplicates.claim_id\r\n , institutional_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_institutional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith institutional_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'admission_date' as column_checked\n , count(distinct admission_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admission_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'discharge_date' as column_checked\n , count(distinct discharge_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct discharge_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'admit_source_code' as column_checked\n , count(distinct admit_source_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admit_source_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'admit_type_code' as column_checked\n , count(distinct admit_type_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct admit_type_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'discharge_disposition_code' as column_checked\n , count(distinct discharge_disposition_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct discharge_disposition_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_checked\n , count(distinct bill_type_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct bill_type_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'ms_drg_code' as column_checked\n , count(distinct ms_drg_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct ms_drg_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'facility_npi' as column_checked\n , count(distinct facility_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct facility_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n , count(distinct rendering_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct rendering_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_1' as column_checked\n , count(distinct diagnosis_poa_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_2' as column_checked\n , count(distinct diagnosis_poa_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_3' as column_checked\n , count(distinct diagnosis_poa_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_4' as column_checked\n , count(distinct diagnosis_poa_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_5' as column_checked\n , count(distinct diagnosis_poa_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_6' as column_checked\n , count(distinct diagnosis_poa_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_7' as column_checked\n , count(distinct diagnosis_poa_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_8' as column_checked\n , count(distinct diagnosis_poa_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_9' as column_checked\n , count(distinct diagnosis_poa_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_10' as column_checked\n , count(distinct diagnosis_poa_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_11' as column_checked\n , count(distinct diagnosis_poa_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_12' as column_checked\n , count(distinct diagnosis_poa_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_13' as column_checked\n , count(distinct diagnosis_poa_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_14' as column_checked\n , count(distinct diagnosis_poa_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_15' as column_checked\n , count(distinct diagnosis_poa_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_16' as column_checked\n , count(distinct diagnosis_poa_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_17' as column_checked\n , count(distinct diagnosis_poa_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_18' as column_checked\n , count(distinct diagnosis_poa_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_19' as column_checked\n , count(distinct diagnosis_poa_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_20' as column_checked\n , count(distinct diagnosis_poa_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_21' as column_checked\n , count(distinct diagnosis_poa_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_22' as column_checked\n , count(distinct diagnosis_poa_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_23' as column_checked\n , count(distinct diagnosis_poa_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_24' as column_checked\n , count(distinct diagnosis_poa_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_poa_25' as column_checked\n , count(distinct diagnosis_poa_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_poa_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_type' as column_checked\n , count(distinct procedure_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_1' as column_checked\n , count(distinct procedure_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_2' as column_checked\n , count(distinct procedure_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_3' as column_checked\n , count(distinct procedure_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_4' as column_checked\n , count(distinct procedure_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_5' as column_checked\n , count(distinct procedure_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_6' as column_checked\n , count(distinct procedure_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_7' as column_checked\n , count(distinct procedure_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_8' as column_checked\n , count(distinct procedure_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_9' as column_checked\n , count(distinct procedure_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_10' as column_checked\n , count(distinct procedure_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_11' as column_checked\n , count(distinct procedure_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_12' as column_checked\n , count(distinct procedure_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_13' as column_checked\n , count(distinct procedure_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_14' as column_checked\n , count(distinct procedure_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_15' as column_checked\n , count(distinct procedure_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_16' as column_checked\n , count(distinct procedure_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_17' as column_checked\n , count(distinct procedure_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_18' as column_checked\n , count(distinct procedure_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_19' as column_checked\n , count(distinct procedure_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_20' as column_checked\n , count(distinct procedure_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_21' as column_checked\n , count(distinct procedure_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_22' as column_checked\n , count(distinct procedure_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_23' as column_checked\n , count(distinct procedure_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_24' as column_checked\n , count(distinct procedure_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_code_25' as column_checked\n , count(distinct procedure_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_1' as column_checked\n , count(distinct procedure_date_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_2' as column_checked\n , count(distinct procedure_date_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_3' as column_checked\n , count(distinct procedure_date_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_4' as column_checked\n , count(distinct procedure_date_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_5' as column_checked\n , count(distinct procedure_date_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_6' as column_checked\n , count(distinct procedure_date_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_7' as column_checked\n , count(distinct procedure_date_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_8' as column_checked\n , count(distinct procedure_date_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_9' as column_checked\n , count(distinct procedure_date_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_10' as column_checked\n , count(distinct procedure_date_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_11' as column_checked\n , count(distinct procedure_date_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_12' as column_checked\n , count(distinct procedure_date_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_13' as column_checked\n , count(distinct procedure_date_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_14' as column_checked\n , count(distinct procedure_date_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_15' as column_checked\n , count(distinct procedure_date_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_16' as column_checked\n , count(distinct procedure_date_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_17' as column_checked\n , count(distinct procedure_date_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_18' as column_checked\n , count(distinct procedure_date_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_19' as column_checked\n , count(distinct procedure_date_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_20' as column_checked\n , count(distinct procedure_date_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_21' as column_checked\n , count(distinct procedure_date_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_22' as column_checked\n , count(distinct procedure_date_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_23' as column_checked\n , count(distinct procedure_date_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_24' as column_checked\n , count(distinct procedure_date_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_25' as column_checked\n , count(distinct procedure_date_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct procedure_date_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n group by\n claim_id\n , data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , institutional_header_duplicates.claim_id\n , institutional_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom institutional_header_duplicates\n left join test_catalog\n on test_catalog.test_name = institutional_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n and test_catalog.claim_type = 'institutional'\ngroup by \n institutional_header_duplicates.claim_id\n , institutional_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_dates"], "alias": "_int_claims_preprocessing_medical_claim_dates", "checksum": {"name": "sha256", "checksum": "4d7d5e4488b27473dd0ecfafbd76343301b8aa659f6b8a11654c9e289ee91075"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_dates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_dates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4070413, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set claim_date_column_list = [\r\n 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'claim_line_start_date'\r\n , 'claim_line_end_date'\r\n , 'paid_date'\r\n , 'procedure_date_1'\r\n , 'procedure_date_2'\r\n , 'procedure_date_3'\r\n , 'procedure_date_4'\r\n , 'procedure_date_5'\r\n , 'procedure_date_6'\r\n , 'procedure_date_7'\r\n , 'procedure_date_8'\r\n , 'procedure_date_9'\r\n , 'procedure_date_10'\r\n , 'procedure_date_11'\r\n , 'procedure_date_12'\r\n , 'procedure_date_13'\r\n , 'procedure_date_14'\r\n , 'procedure_date_15'\r\n , 'procedure_date_16'\r\n , 'procedure_date_17'\r\n , 'procedure_date_18'\r\n , 'procedure_date_19'\r\n , 'procedure_date_20'\r\n , 'procedure_date_21'\r\n , 'procedure_date_22'\r\n , 'procedure_date_23'\r\n , 'procedure_date_24'\r\n , 'procedure_date_25'\r\n] -%}\r\n\r\nwith claim_dates as (\r\n\r\n {{ medical_claim_date_check(builtins.ref('normalized_input__medical_claim'), claim_date_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_dates\r\n left join test_catalog\r\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_date_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates.sql", "compiled": true, "compiled_code": "\n\nwith claim_dates as (\n\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_start_date = cal.full_date\n where cal.full_date is null\n and rel.claim_start_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_end_date = cal.full_date\n where cal.full_date is null\n and rel.claim_end_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_line_start_date = cal.full_date\n where cal.full_date is null\n and rel.claim_line_start_date is not null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.claim_line_end_date = cal.full_date\n where cal.full_date is null\n and rel.claim_line_end_date is not null\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.paid_date = cal.full_date\n where cal.full_date is null\n and rel.paid_date is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_1 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_1 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_2' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_2 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_2 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_3' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_3 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_3 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_4' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_4 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_4 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_5' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_5 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_5 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_6' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_6 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_6 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_7' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_7 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_7 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_8' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_8 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_8 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_9' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_9 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_9 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_10' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_10 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_10 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_11' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_11 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_11 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_12' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_12 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_12 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_13' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_13 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_13 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_14' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_14 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_14 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_15' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_15 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_15 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_16' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_16 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_16 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_17' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_17 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_17 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_18' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_18 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_18 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_19' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_19 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_19 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_20' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_20 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_20 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_21' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_21 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_21 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_22' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_22 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_22 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_23' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_23 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_23 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_24' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_24 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_24 is not null\n union all\n select\n claim_id\n , data_source\n , 'procedure_date_25' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.procedure_date_25 = cal.full_date\n where cal.full_date is null\n and rel.procedure_date_25 is not null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom claim_dates\n left join test_catalog\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_dates_inst", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_dates_inst"], "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "checksum": {"name": "sha256", "checksum": "309aeeb63444b99834cfa914285903e7ff1feb578fc7d2834bf2c90e110c72f2"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_dates_inst", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.411026, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates_inst", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set claim_date_column_list = [\r\n 'admission_date'\r\n , 'discharge_date'\r\n] -%}\r\n\r\nwith claim_dates as (\r\n\r\n {{ medical_claim_date_check(builtins.ref('normalized_input__medical_claim'), claim_date_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_dates\r\n left join test_catalog\r\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_dates.claim_id\r\n , claim_dates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_date_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_dates_inst.sql", "compiled": true, "compiled_code": "\n\nwith claim_dates as (\n\n select\n claim_id\n , data_source\n , 'admission_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.admission_date = cal.full_date\n where cal.full_date is null\n and rel.admission_date is not null\n and rel.claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'discharge_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.terminology.calendar as cal\n on rel.discharge_date = cal.full_date\n where cal.full_date is null\n and rel.discharge_date is not null\n and rel.claim_type = 'institutional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom claim_dates\n left join test_catalog\n on test_catalog.test_name = claim_dates.column_checked||' invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_dates.claim_id\n , claim_dates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_denominators"], "alias": "_int_claims_preprocessing_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "5229da26627ac72855e20350b2d27afe882366e3665a4b743067a401bf8a5c60"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_denominators", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_denominators", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.399503, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Denominator logic for invalid value tests is dependent on whether that\r\n specific field is populated or not. We created a macro to automatically\r\n generate the CTE. All invalid value tests must have a\r\n test_category = 'invalid_values' in the catalog seed.\r\n*/\r\nwith professional_denominator as (\r\n\r\n select\r\n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , cast(count(distinct claim_id||data_source) as int) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type = 'professional'\r\n\r\n)\r\n\r\n, institutional_denominator as (\r\n\r\n select\r\n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id||data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type = 'institutional'\r\n\r\n)\r\n\r\n, all_claim_denominator as (\r\n\r\n select\r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id||data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('normalized_input__medical_claim') }}\r\n where claim_type is not null\r\n\r\n)\r\n\r\n, invalid_value_denominators as (\r\n\r\n {{ medical_claim_denominator_invalid_values(builtins.ref('normalized_input__medical_claim')) }}\r\n\r\n)\r\n\r\nselect * from institutional_denominator\r\nunion all \r\nselect * from professional_denominator\r\nunion all\r\nselect * from all_claim_denominator\r\nunion all\r\nselect * from invalid_value_denominators", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.medical_claim_denominator_invalid_values"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_denominators.sql", "compiled": true, "compiled_code": "\n/*\n Denominator logic for invalid value tests is dependent on whether that\n specific field is populated or not. We created a macro to automatically\n generate the CTE. All invalid value tests must have a\n test_category = 'invalid_values' in the catalog seed.\n*/\nwith professional_denominator as (\n\n select\n cast('professional' as TEXT ) as test_denominator_name\n , cast(count(distinct claim_id||data_source) as int) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n\n)\n\n, institutional_denominator as (\n\n select\n cast('institutional' as TEXT ) as test_denominator_name\n , count(distinct claim_id||data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'institutional'\n\n)\n\n, all_claim_denominator as (\n\n select\n cast('all' as TEXT ) as test_denominator_name\n , count(distinct claim_id||data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type is not null\n\n)\n\n, invalid_value_denominators as (\n\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'admit_source_code'\n where rel.admit_source_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'admit_type_code'\n where rel.admit_type_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'apr_drg_code'\n where rel.apr_drg_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'bill_type_code'\n where rel.bill_type_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'billing_npi'\n where rel.billing_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'claim_type'\n where rel.claim_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_code_1'\n where rel.diagnosis_code_1 is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_code_type'\n where rel.diagnosis_code_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'diagnosis_poa_1'\n where rel.diagnosis_poa_1 is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'discharge_disposition_code'\n where rel.discharge_disposition_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'facility_npi'\n where rel.facility_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'ms_drg_code'\n where rel.ms_drg_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'place_of_service_code'\n where rel.place_of_service_code is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'procedure_code_type'\n where rel.procedure_code_type is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'rendering_npi'\n where rel.rendering_npi is not null\n group by cat.test_name\n union all\n select\n cat.test_name\n , count(distinct rel.claim_id||rel.data_source) as denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim as rel\n left join dev_thuxuan.data_quality._value_set_test_catalog as cat\n on cat.test_category = 'invalid_values'\n and cat.source_table = 'normalized_input__medical_claim'\n and cat.test_field = 'revenue_center_code'\n where rel.revenue_center_code is not null\n group by cat.test_name\n \n\n)\n\nselect * from institutional_denominator\nunion all \nselect * from professional_denominator\nunion all\nselect * from all_claim_denominator\nunion all\nselect * from invalid_value_denominators", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_duplicates"], "alias": "_int_claims_preprocessing_medical_claim_duplicates", "checksum": {"name": "sha256", "checksum": "b0dfebfd62030737d7bf585961d468544ced4137eefe9aeee7b8411e4d32f8ff"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3935027, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__medical_claim') }}\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate medical claims'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.data_quality__test_catalog", "model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n left join test_catalog\n on test_catalog.test_name = 'duplicate medical claims'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n claim_id\n , claim_line_number\n , data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_inst_missing_values"], "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "checksum": {"name": "sha256", "checksum": "c6827faa41e7316f5c965981dd2fb294ecee5e38606fe236f0d9b92b7d460b92"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_inst_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3797374, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set institutional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'bill_type_code'\r\n , 'revenue_center_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'facility_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith institutional_missing as (\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('normalized_input__medical_claim'), institutional_missing_column_list, 'institutional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , institutional_missing.claim_id\r\n , institutional_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_missing\r\n left join test_catalog\r\n on test_catalog.test_name = institutional_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n institutional_missing.claim_id\r\n , institutional_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_inst_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith institutional_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_line_number is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where patient_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where member_id is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where payer is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where plan is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_start_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_end_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'bill_type_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where bill_type_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'revenue_center_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where revenue_center_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'hcpcs_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where hcpcs_code is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where rendering_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where billing_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'facility_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where facility_npi is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_date is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_amount is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_type is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_1 is null\n and claim_type = 'institutional'\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where data_source is null\n and claim_type = 'institutional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'institutional' as claim_type\n , 'claim_id' as grain\n , institutional_missing.claim_id\n , institutional_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom institutional_missing\n left join test_catalog\n on test_catalog.test_name = institutional_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n institutional_missing.claim_id\n , institutional_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_invalid_npi", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_invalid_npi"], "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "checksum": {"name": "sha256", "checksum": "a936358a09a6066d89d4f5e970a9cb51a6bef309ab3bd40e6637b34529377b49"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_invalid_npi", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3828528, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_npi", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_billing_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.billing_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.billing_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'billing_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.billing_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_facility_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.facility_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.facility_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'facility_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.facility_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_rendering_npi as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.rendering_npi) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__provider')}} pro\r\n on medical_claim.rendering_npi = pro.npi\r\n left join test_catalog\r\n on test_catalog.test_name = 'rendering_npi invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where pro.npi is null\r\n and medical_claim.rendering_npi is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_billing_npi\r\nunion all\r\nselect * from valid_facility_npi\r\nunion all\r\nselect * from valid_rendering_npi", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_npi.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_billing_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.billing_npi) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.billing_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'billing_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.billing_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_facility_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.facility_npi) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.facility_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'facility_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.facility_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_rendering_npi as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.rendering_npi) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.provider pro\n on medical_claim.rendering_npi = pro.npi\n left join test_catalog\n on test_catalog.test_name = 'rendering_npi invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where pro.npi is null\n and medical_claim.rendering_npi is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_billing_npi\nunion all\nselect * from valid_facility_npi\nunion all\nselect * from valid_rendering_npi", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_invalid_values"], "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "checksum": {"name": "sha256", "checksum": "babd7d2de39c87ccfb57489b9f92ff8f5fdb945017bcfbd670f14f32e2ef1565"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_invalid_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3737366, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, valid_bill_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.bill_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__bill_type')}} tob\r\n on medical_claim.bill_type_code = tob.bill_type_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'bill_type_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and tob.bill_type_code is null\r\n and medical_claim.bill_type_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_revenue_center as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.revenue_center_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__revenue_center') }} rev\r\n on medical_claim.revenue_center_code = rev.revenue_center_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'revenue_center_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and rev.revenue_center_code is null\r\n and medical_claim.revenue_center_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_discharge_disposition as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.discharge_disposition_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__discharge_disposition') }} discharge\r\n on medical_claim.discharge_disposition_code = discharge.discharge_disposition_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'discharge_disposition_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and discharge.discharge_disposition_code is null\r\n and medical_claim.discharge_disposition_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_admit_source as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.admit_source_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__admit_source') }} adsource\r\n on medical_claim.admit_source_code = adsource.admit_source_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'admit_source_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and adsource.admit_source_code is null\r\n and medical_claim.admit_source_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_admit_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.admit_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__admit_type') }} adtype\r\n on medical_claim.admit_type_code = adtype.admit_type_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'admit_type_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and adtype.admit_type_code is null\r\n and medical_claim.admit_type_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_ms_drg as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.ms_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__ms_drg') }} msdrg\r\n on medical_claim.ms_drg_code = msdrg.ms_drg_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'ms_drg_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and msdrg.ms_drg_code is null\r\n and medical_claim.ms_drg_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_apr_drg as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.apr_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__apr_drg') }} aprdrg\r\n on medical_claim.apr_drg_code = aprdrg.apr_drg_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'apr_drg_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and aprdrg.apr_drg_code is null\r\n and medical_claim.apr_drg_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_present_on_admission as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_poa_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__present_on_admission') }} poa\r\n on medical_claim.diagnosis_poa_1 = poa.present_on_admit_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_poa_1 invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and poa.present_on_admit_code is null\r\n and medical_claim.diagnosis_poa_1 is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_procedure_code_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.procedure_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on medical_claim.procedure_code_type = codetype.code_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'procedure_code_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claim_type = 'institutional'\r\n and codetype.code_type is null\r\n and medical_claim.procedure_code_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_place_of_service as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.place_of_service_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__place_of_service') }} pos\r\n on medical_claim.place_of_service_code = pos.place_of_service_code\r\n left join test_catalog\r\n on test_catalog.test_name = 'place_of_service_code invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claim_type = 'professional'\r\n and pos.place_of_service_code is null\r\n and medical_claim.place_of_service_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_diagnosis_code_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on medical_claim.diagnosis_code_type = codetype.code_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_code_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where codetype.code_type is null\r\n and medical_claim.diagnosis_code_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_diagnosis_code as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.diagnosis_code_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__icd_10_cm') }} icd\r\n on medical_claim.diagnosis_code_1 = icd.icd_10_cm\r\n left join test_catalog\r\n on test_catalog.test_name = 'diagnosis_code_1 invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where diagnosis_code_type = 'icd-10-cm'\r\n and icd.icd_10_cm is null\r\n and medical_claim.diagnosis_code_1 is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, valid_claim_type as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(medical_claim.claim_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join {{ ref('terminology__claim_type') }} claimtype\r\n on medical_claim.claim_type = claimtype.claim_type\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_type invalid'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where claimtype.claim_type is null\r\n and medical_claim.claim_type is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from valid_bill_type\r\nunion all \r\nselect * from valid_revenue_center\r\nunion all \r\nselect * from valid_discharge_disposition\r\nunion all \r\nselect * from valid_admit_source\r\nunion all \r\nselect * from valid_admit_type\r\nunion all \r\nselect * from valid_ms_drg\r\nunion all \r\nselect * from valid_apr_drg\r\nunion all \r\nselect * from valid_present_on_admission\r\nunion all \r\nselect * from valid_diagnosis_code_type\r\nunion all \r\nselect * from valid_procedure_code_type\r\nunion all \r\nselect * from valid_diagnosis_code\r\nunion all \r\nselect * from valid_claim_type\r\nunion all \r\nselect * from valid_place_of_service", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "terminology__bill_type", "package": null, "version": null}, {"name": "terminology__revenue_center", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__admit_source", "package": null, "version": null}, {"name": "terminology__admit_type", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}, {"name": "terminology__apr_drg", "package": null, "version": null}, {"name": "terminology__present_on_admission", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "terminology__place_of_service", "package": null, "version": null}, {"name": "terminology__code_type", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "terminology__claim_type", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__revenue_center", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__present_on_admission", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__claim_type"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_invalid_values.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, valid_bill_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.bill_type_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.bill_type tob\n on medical_claim.bill_type_code = tob.bill_type_code\n left join test_catalog\n on test_catalog.test_name = 'bill_type_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and tob.bill_type_code is null\n and medical_claim.bill_type_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_revenue_center as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.revenue_center_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.revenue_center rev\n on medical_claim.revenue_center_code = rev.revenue_center_code\n left join test_catalog\n on test_catalog.test_name = 'revenue_center_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and rev.revenue_center_code is null\n and medical_claim.revenue_center_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_discharge_disposition as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.discharge_disposition_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.discharge_disposition discharge\n on medical_claim.discharge_disposition_code = discharge.discharge_disposition_code\n left join test_catalog\n on test_catalog.test_name = 'discharge_disposition_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and discharge.discharge_disposition_code is null\n and medical_claim.discharge_disposition_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_admit_source as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.admit_source_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.admit_source adsource\n on medical_claim.admit_source_code = adsource.admit_source_code\n left join test_catalog\n on test_catalog.test_name = 'admit_source_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and adsource.admit_source_code is null\n and medical_claim.admit_source_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_admit_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.admit_type_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.admit_type adtype\n on medical_claim.admit_type_code = adtype.admit_type_code\n left join test_catalog\n on test_catalog.test_name = 'admit_type_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and adtype.admit_type_code is null\n and medical_claim.admit_type_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_ms_drg as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.ms_drg_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.ms_drg msdrg\n on medical_claim.ms_drg_code = msdrg.ms_drg_code\n left join test_catalog\n on test_catalog.test_name = 'ms_drg_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and msdrg.ms_drg_code is null\n and medical_claim.ms_drg_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_apr_drg as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.apr_drg_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.apr_drg aprdrg\n on medical_claim.apr_drg_code = aprdrg.apr_drg_code\n left join test_catalog\n on test_catalog.test_name = 'apr_drg_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and aprdrg.apr_drg_code is null\n and medical_claim.apr_drg_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_present_on_admission as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_poa_1) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.present_on_admission poa\n on medical_claim.diagnosis_poa_1 = poa.present_on_admit_code\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_poa_1 invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and poa.present_on_admit_code is null\n and medical_claim.diagnosis_poa_1 is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_procedure_code_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.procedure_code_type) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.code_type codetype\n on medical_claim.procedure_code_type = codetype.code_type\n left join test_catalog\n on test_catalog.test_name = 'procedure_code_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claim_type = 'institutional'\n and codetype.code_type is null\n and medical_claim.procedure_code_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_place_of_service as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.place_of_service_code) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.place_of_service pos\n on medical_claim.place_of_service_code = pos.place_of_service_code\n left join test_catalog\n on test_catalog.test_name = 'place_of_service_code invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claim_type = 'professional'\n and pos.place_of_service_code is null\n and medical_claim.place_of_service_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_diagnosis_code_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_code_type) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.code_type codetype\n on medical_claim.diagnosis_code_type = codetype.code_type\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_code_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where codetype.code_type is null\n and medical_claim.diagnosis_code_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_diagnosis_code as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.diagnosis_code_1) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.icd_10_cm icd\n on medical_claim.diagnosis_code_1 = icd.icd_10_cm\n left join test_catalog\n on test_catalog.test_name = 'diagnosis_code_1 invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where diagnosis_code_type = 'icd-10-cm'\n and icd.icd_10_cm is null\n and medical_claim.diagnosis_code_1 is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, valid_claim_type as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(medical_claim.claim_type) as filled_row_count\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join dev_thuxuan.terminology.claim_type claimtype\n on medical_claim.claim_type = claimtype.claim_type\n left join test_catalog\n on test_catalog.test_name = 'claim_type invalid'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where claimtype.claim_type is null\n and medical_claim.claim_type is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from valid_bill_type\nunion all \nselect * from valid_revenue_center\nunion all \nselect * from valid_discharge_disposition\nunion all \nselect * from valid_admit_source\nunion all \nselect * from valid_admit_type\nunion all \nselect * from valid_ms_drg\nunion all \nselect * from valid_apr_drg\nunion all \nselect * from valid_present_on_admission\nunion all \nselect * from valid_diagnosis_code_type\nunion all \nselect * from valid_procedure_code_type\nunion all \nselect * from valid_diagnosis_code\nunion all \nselect * from valid_claim_type\nunion all \nselect * from valid_place_of_service", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_line_numbers", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_line_numbers"], "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "checksum": {"name": "sha256", "checksum": "15a7483f89ea4930dac5e70f6a93a2ebec28be9caacbf3018fdf4e45091fa294"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_line_numbers", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3768246, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_line_numbers", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, add_row_num as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_line_number\r\n , row_number() over (\r\n partition by claim_id, data_source\r\n order by claim_line_number\r\n ) as expected_line_number\r\n from medical_claim\r\n\r\n)\r\n\r\n, line_num_check as (\r\n\r\n select\r\n add_row_num.claim_id\r\n , add_row_num.data_source\r\n , add_row_num.claim_line_number\r\n , add_row_num.expected_line_number\r\n from add_row_num\r\n left join medical_claim\r\n on add_row_num.claim_id = medical_claim.claim_id\r\n and add_row_num.data_source = medical_claim.data_source\r\n and add_row_num.expected_line_number = medical_claim.claim_line_number\r\n where medical_claim.claim_line_number is null\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom line_num_check\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_line_number non-sequential'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_line_numbers.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select\n claim_id\n , claim_line_number\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, add_row_num as (\n\n select\n claim_id\n , data_source\n , claim_line_number\n , row_number() over (\n partition by claim_id, data_source\n order by claim_line_number\n ) as expected_line_number\n from medical_claim\n\n)\n\n, line_num_check as (\n\n select\n add_row_num.claim_id\n , add_row_num.data_source\n , add_row_num.claim_line_number\n , add_row_num.expected_line_number\n from add_row_num\n left join medical_claim\n on add_row_num.claim_id = medical_claim.claim_id\n and add_row_num.data_source = medical_claim.data_source\n and add_row_num.expected_line_number = medical_claim.claim_line_number\n where medical_claim.claim_line_number is null\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom line_num_check\n left join test_catalog\n on test_catalog.test_name = 'claim_line_number non-sequential'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_plausibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_plausibility"], "alias": "_int_claims_preprocessing_medical_claim_plausibility", "checksum": {"name": "sha256", "checksum": "62567cc9718593c742b583de73c9c9e071444e0da023033ebec248d2ad2229bd"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_plausibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_plausibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4030213, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith medical_claim as (\r\n\r\n select *\r\n from {{ ref('normalized_input__medical_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, claim_start_date_after_claim_end_date as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'all' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_start_date after claim_end_date'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_start_date > medical_claim.claim_end_date\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, admission_date_after_discharge_date as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'institutional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'admission_date after discharge_date'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and medical_claim.admission_date > medical_claim.discharge_date\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, admission_date_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'admission_date incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.admission_date is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, discharge_date_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'discharge_date incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.discharge_date is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, revenue_center_code_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'revenue_center_code incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and medical_claim.revenue_center_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, institutional_header_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'institutional header-level fields incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'professional'\r\n and (\r\n medical_claim.admit_type_code is not null\r\n or medical_claim.admit_type_code is not null\r\n or medical_claim.admit_source_code is not null\r\n or medical_claim.discharge_disposition_code is not null\r\n or medical_claim.bill_type_code is not null\r\n or medical_claim.ms_drg_code is not null\r\n or medical_claim.apr_drg_code is not null\r\n )\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\n, place_of_service_code_incorrect as (\r\n\r\n select\r\n test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , test_catalog.source_table\r\n , 'professional' as claim_type\r\n , test_catalog.test_category\r\n , 'claim_id' as grain\r\n , medical_claim.claim_id\r\n , medical_claim.data_source\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from medical_claim\r\n left join test_catalog\r\n on test_catalog.test_name = 'place_of_service_code incorrectly populated'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n where medical_claim.claim_type = 'institutional'\r\n and medical_claim.place_of_service_code is not null\r\n group by\r\n medical_claim.claim_id\r\n , medical_claim.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n\r\n)\r\n\r\nselect * from claim_start_date_after_claim_end_date\r\nunion all\r\nselect * from admission_date_after_discharge_date\r\nunion all\r\nselect * from admission_date_incorrect\r\nunion all\r\nselect * from discharge_date_incorrect\r\nunion all\r\nselect * from revenue_center_code_incorrect\r\nunion all\r\nselect * from institutional_header_incorrect\r\nunion all\r\nselect * from place_of_service_code_incorrect", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_plausibility.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim as (\n\n select *\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, claim_start_date_after_claim_end_date as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'all' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'claim_start_date after claim_end_date'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_start_date > medical_claim.claim_end_date\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, admission_date_after_discharge_date as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'institutional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'admission_date after discharge_date'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and medical_claim.admission_date > medical_claim.discharge_date\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, admission_date_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'admission_date incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.admission_date is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, discharge_date_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'discharge_date incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.discharge_date is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, revenue_center_code_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'revenue_center_code incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and medical_claim.revenue_center_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, institutional_header_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'institutional header-level fields incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'professional'\n and (\n medical_claim.admit_type_code is not null\n or medical_claim.admit_type_code is not null\n or medical_claim.admit_source_code is not null\n or medical_claim.discharge_disposition_code is not null\n or medical_claim.bill_type_code is not null\n or medical_claim.ms_drg_code is not null\n or medical_claim.apr_drg_code is not null\n )\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\n, place_of_service_code_incorrect as (\n\n select\n test_catalog.test_name\n , test_catalog.pipeline_test\n , test_catalog.source_table\n , 'professional' as claim_type\n , test_catalog.test_category\n , 'claim_id' as grain\n , medical_claim.claim_id\n , medical_claim.data_source\n , count(*) as counts\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from medical_claim\n left join test_catalog\n on test_catalog.test_name = 'place_of_service_code incorrectly populated'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n where medical_claim.claim_type = 'institutional'\n and medical_claim.place_of_service_code is not null\n group by\n medical_claim.claim_id\n , medical_claim.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n\n)\n\nselect * from claim_start_date_after_claim_end_date\nunion all\nselect * from admission_date_after_discharge_date\nunion all\nselect * from admission_date_incorrect\nunion all\nselect * from discharge_date_incorrect\nunion all\nselect * from revenue_center_code_incorrect\nunion all\nselect * from institutional_header_incorrect\nunion all\nselect * from place_of_service_code_incorrect", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_medical_claim_prof_missing_values"], "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "checksum": {"name": "sha256", "checksum": "0f2c7824ad332a3071b7dba6354c26a3e43c2e97e590aa5a2d4ff4f37700c1aa"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_medical_claim_prof_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3865151, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set professional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_missing as (\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('normalized_input__medical_claim'), professional_missing_column_list, 'professional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , professional_missing.claim_id\r\n , professional_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_missing\r\n left join test_catalog\r\n on test_catalog.test_name = professional_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\ngroup by\r\n professional_missing.claim_id\r\n , professional_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_medical_claim_prof_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith professional_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_line_number is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where patient_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where member_id is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where payer is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where plan is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_start_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_end_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'place_of_service_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where place_of_service_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'hcpcs_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where hcpcs_code is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'rendering_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where rendering_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where billing_npi is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_date is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where paid_amount is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_type is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where diagnosis_code_1 is null\n and claim_type = 'professional'\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where data_source is null\n and claim_type = 'professional'\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , professional_missing.claim_id\n , professional_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom professional_missing\n left join test_catalog\n on test_catalog.test_name = professional_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__medical_claim'\ngroup by\n professional_missing.claim_id\n , professional_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_duplicates"], "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "checksum": {"name": "sha256", "checksum": "fcc927d8b88262450bf7b2062615a843d09a2f8286c1b889b7c5ddc20b564651"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_duplicates", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4160264, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect distinct\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('normalized_input__pharmacy_claim') }}\r\n left join test_catalog\r\n on test_catalog.test_name = 'duplicate pharmacy claims'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\nhaving count(*) > 1", "language": "sql", "refs": [{"name": "data_quality__test_catalog", "package": null, "version": null}, {"name": "normalized_input__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.data_quality__test_catalog", "model.the_tuva_project.normalized_input__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_duplicates.sql", "compiled": true, "compiled_code": "\n\nwith test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect distinct\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , claim_id\n , data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n left join test_catalog\n on test_catalog.test_name = 'duplicate pharmacy claims'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n claim_id\n , claim_line_number\n , data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_line_numbers"], "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "checksum": {"name": "sha256", "checksum": "79d6c3baed4bc5fb9e34a47fe8a5525e3ed8f91ca091fe7e75aa3eab9811fbe7"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_line_numbers", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4205377, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_line_numbers", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith pharmacy_claim as (\r\n\r\n select\r\n claim_id\r\n , claim_line_number\r\n , data_source\r\n from {{ ref('normalized_input__pharmacy_claim') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\n, add_row_num as (\r\n\r\n select\r\n claim_id\r\n , data_source\r\n , claim_line_number\r\n , row_number() over (\r\n partition by claim_id, data_source\r\n order by claim_line_number\r\n ) as expected_line_number\r\n from pharmacy_claim\r\n\r\n)\r\n\r\n, line_num_check as (\r\n\r\n select\r\n add_row_num.claim_id\r\n , add_row_num.data_source\r\n , add_row_num.claim_line_number\r\n , add_row_num.expected_line_number\r\n from add_row_num\r\n left join pharmacy_claim\r\n on add_row_num.claim_id = pharmacy_claim.claim_id\r\n and add_row_num.data_source = pharmacy_claim.data_source\r\n and add_row_num.expected_line_number = pharmacy_claim.claim_line_number\r\n where pharmacy_claim.claim_line_number is null\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom line_num_check\r\n left join test_catalog\r\n on test_catalog.test_name = 'claim_line_number non-sequential'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n line_num_check.claim_id\r\n , line_num_check.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_line_numbers.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim as (\n\n select\n claim_id\n , claim_line_number\n , data_source\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\n, add_row_num as (\n\n select\n claim_id\n , data_source\n , claim_line_number\n , row_number() over (\n partition by claim_id, data_source\n order by claim_line_number\n ) as expected_line_number\n from pharmacy_claim\n\n)\n\n, line_num_check as (\n\n select\n add_row_num.claim_id\n , add_row_num.data_source\n , add_row_num.claim_line_number\n , add_row_num.expected_line_number\n from add_row_num\n left join pharmacy_claim\n on add_row_num.claim_id = pharmacy_claim.claim_id\n and add_row_num.data_source = pharmacy_claim.data_source\n and add_row_num.expected_line_number = pharmacy_claim.claim_line_number\n where pharmacy_claim.claim_line_number is null\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom line_num_check\n left join test_catalog\n on test_catalog.test_name = 'claim_line_number non-sequential'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n line_num_check.claim_id\n , line_num_check.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_claim_missing_values"], "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "checksum": {"name": "sha256", "checksum": "ebf0687fbcf78edbaa015af921b8558b13a8704f2d0c1278dd88845d2438b9a1"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_claim_missing_values", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.424536, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set pharmacy_claim_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'prescribing_provider_npi'\r\n , 'dispensing_provider_npi'\r\n , 'dispensing_date'\r\n , 'ndc_code'\r\n , 'quantity'\r\n , 'days_supply'\r\n , 'refills'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'allowed_amount'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith pharmacy_claim_missing as (\r\n\r\n {{ pharmacy_claim_missing_column_check(builtins.ref('normalized_input__pharmacy_claim'), pharmacy_claim_missing_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , pharmacy_claim_missing.claim_id\r\n , pharmacy_claim_missing.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pharmacy_claim_missing\r\n left join test_catalog\r\n on test_catalog.test_name = pharmacy_claim_missing.column_checked||' missing'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by\r\n pharmacy_claim_missing.claim_id\r\n , pharmacy_claim_missing.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_claim_missing_values.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim_missing as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where claim_id is null\n union all\n select\n claim_id\n , data_source\n , 'claim_line_number' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where claim_line_number is null\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where patient_id is null\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where member_id is null\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where payer is null\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where plan is null\n union all\n select\n claim_id\n , data_source\n , 'prescribing_provider_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where prescribing_provider_npi is null\n union all\n select\n claim_id\n , data_source\n , 'dispensing_provider_npi' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where dispensing_provider_npi is null\n union all\n select\n claim_id\n , data_source\n , 'dispensing_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where dispensing_date is null\n union all\n select\n claim_id\n , data_source\n , 'ndc_code' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where ndc_code is null\n union all\n select\n claim_id\n , data_source\n , 'quantity' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where quantity is null\n union all\n select\n claim_id\n , data_source\n , 'days_supply' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where days_supply is null\n union all\n select\n claim_id\n , data_source\n , 'refills' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where refills is null\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where paid_date is null\n union all\n select\n claim_id\n , data_source\n , 'paid_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where paid_amount is null\n union all\n select\n claim_id\n , data_source\n , 'allowed_amount' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where allowed_amount is null\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n where data_source is null\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , pharmacy_claim_missing.claim_id\n , pharmacy_claim_missing.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pharmacy_claim_missing\n left join test_catalog\n on test_catalog.test_name = pharmacy_claim_missing.column_checked||' missing'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by\n pharmacy_claim_missing.claim_id\n , pharmacy_claim_missing.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_pharmacy_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_pharmacy_header_fail_details"], "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "checksum": {"name": "sha256", "checksum": "ac9d78a05fb7b5ba771f1f42d4951d0f5874713f370cd02ef8ad424e395a930e"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_pharmacy_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3697367, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set pharmacy_header_column_list = [\r\n 'claim_id'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith pharmacy_header_duplicates as (\r\n\r\n {{ pharmacy_claim_header_duplicate_check(builtins.ref('normalized_input__pharmacy_claim'), pharmacy_header_column_list) }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , pharmacy_header_duplicates.claim_id\r\n , pharmacy_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom pharmacy_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = pharmacy_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\r\ngroup by \r\n pharmacy_header_duplicates.claim_id\r\n , pharmacy_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_pharmacy_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n group by claim_id, data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'all' as claim_type\n , 'claim_id' as grain\n , pharmacy_header_duplicates.claim_id\n , pharmacy_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom pharmacy_header_duplicates\n left join test_catalog\n on test_catalog.test_name = pharmacy_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__pharmacy_claim'\ngroup by \n pharmacy_header_duplicates.claim_id\n , pharmacy_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_professional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_professional_header_fail_details"], "alias": "_int_claims_preprocessing_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "1a782a236c32b224aa1efb3edef580eedee0c530c54e2563e961e0c0c25e3779"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_professional_header_fail_details", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_professional_header_fail_details", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3660257, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n{% set professional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'payer'\r\n , 'plan'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_header_duplicates as (\r\n\r\n {{ medical_claim_header_duplicate_check(builtins.ref('normalized_input__medical_claim'), professional_header_column_list, 'professional') }}\r\n\r\n)\r\n\r\n, test_catalog as (\r\n\r\n select\r\n source_table\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\n , claim_type\r\n from {{ ref('data_quality__test_catalog') }}\r\n\r\n)\r\n\r\nselect\r\n test_catalog.source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , professional_header_duplicates.claim_id\r\n , professional_header_duplicates.data_source\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_header_duplicates\r\n left join test_catalog\r\n on test_catalog.test_name = professional_header_duplicates.column_checked||' non-unique'\r\n and test_catalog.source_table = 'normalized_input__medical_claim'\r\n and test_catalog.claim_type = 'professional'\r\ngroup by \r\n professional_header_duplicates.claim_id\r\n , professional_header_duplicates.data_source\r\n , test_catalog.source_table\r\n , test_catalog.test_category\r\n , test_catalog.test_name\r\n , test_catalog.pipeline_test", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}, {"name": "data_quality__test_catalog", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_header_duplicate_check"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_professional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith professional_header_duplicates as (\n\n \n select\n claim_id\n , data_source\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_type' as column_checked\n , count(distinct claim_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'patient_id' as column_checked\n , count(distinct patient_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct patient_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'member_id' as column_checked\n , count(distinct member_id) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct member_id) > 1\n union all\n select\n claim_id\n , data_source\n , 'payer' as column_checked\n , count(distinct payer) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct payer) > 1\n union all\n select\n claim_id\n , data_source\n , 'plan' as column_checked\n , count(distinct plan) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct plan) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_start_date' as column_checked\n , count(distinct claim_start_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_start_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'claim_end_date' as column_checked\n , count(distinct claim_end_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct claim_end_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'place_of_service_code' as column_checked\n , count(distinct place_of_service_code) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct place_of_service_code) > 1\n union all\n select\n claim_id\n , data_source\n , 'billing_npi' as column_checked\n , count(distinct billing_npi) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct billing_npi) > 1\n union all\n select\n claim_id\n , data_source\n , 'paid_date' as column_checked\n , count(distinct paid_date) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct paid_date) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_type' as column_checked\n , count(distinct diagnosis_code_type) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_type) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_1' as column_checked\n , count(distinct diagnosis_code_1) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_1) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_2' as column_checked\n , count(distinct diagnosis_code_2) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_2) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_3' as column_checked\n , count(distinct diagnosis_code_3) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_3) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_4' as column_checked\n , count(distinct diagnosis_code_4) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_4) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_5' as column_checked\n , count(distinct diagnosis_code_5) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_5) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_6' as column_checked\n , count(distinct diagnosis_code_6) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_6) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_7' as column_checked\n , count(distinct diagnosis_code_7) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_7) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_8' as column_checked\n , count(distinct diagnosis_code_8) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_8) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_9' as column_checked\n , count(distinct diagnosis_code_9) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_9) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_10' as column_checked\n , count(distinct diagnosis_code_10) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_10) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_11' as column_checked\n , count(distinct diagnosis_code_11) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_11) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_12' as column_checked\n , count(distinct diagnosis_code_12) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_12) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_13' as column_checked\n , count(distinct diagnosis_code_13) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_13) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_14' as column_checked\n , count(distinct diagnosis_code_14) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_14) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_15' as column_checked\n , count(distinct diagnosis_code_15) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_15) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_16' as column_checked\n , count(distinct diagnosis_code_16) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_16) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_17' as column_checked\n , count(distinct diagnosis_code_17) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_17) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_18' as column_checked\n , count(distinct diagnosis_code_18) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_18) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_19' as column_checked\n , count(distinct diagnosis_code_19) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_19) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_20' as column_checked\n , count(distinct diagnosis_code_20) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_20) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_21' as column_checked\n , count(distinct diagnosis_code_21) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_21) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_22' as column_checked\n , count(distinct diagnosis_code_22) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_22) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_23' as column_checked\n , count(distinct diagnosis_code_23) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_23) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_24' as column_checked\n , count(distinct diagnosis_code_24) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_24) > 1\n union all\n select\n claim_id\n , data_source\n , 'diagnosis_code_25' as column_checked\n , count(distinct diagnosis_code_25) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct diagnosis_code_25) > 1\n union all\n select\n claim_id\n , data_source\n , 'data_source' as column_checked\n , count(distinct data_source) as duplicate_count\n from dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\n where claim_type = 'professional'\n group by\n claim_id\n , data_source\n having count(distinct data_source) > 1\n \n\n)\n\n, test_catalog as (\n\n select\n source_table\n , test_category\n , test_name\n , pipeline_test\n , claim_type\n from dev_thuxuan.data_quality._value_set_test_catalog\n\n)\n\nselect\n test_catalog.source_table\n , 'professional' as claim_type\n , 'claim_id' as grain\n , professional_header_duplicates.claim_id\n , professional_header_duplicates.data_source\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom professional_header_duplicates\n left join test_catalog\n on test_catalog.test_name = professional_header_duplicates.column_checked||' non-unique'\n and test_catalog.source_table = 'normalized_input__medical_claim'\n and test_catalog.claim_type = 'professional'\ngroup by \n professional_header_duplicates.claim_id\n , professional_header_duplicates.data_source\n , test_catalog.source_table\n , test_catalog.test_category\n , test_catalog.test_name\n , test_catalog.pipeline_test", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_eligibility"], "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "checksum": {"name": "sha256", "checksum": "d7e30d81f98b23e5eb3a81d5fd94ebf3dcaec7e6128ec30303205f35d530b04d"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_eligibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.357942, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_invalid_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_eligibility_plausibility') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_eligibility_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_plausibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_plausibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "d1ed13a49eb5766e4b1bed9e44befe89d0ce4bd8c645a21e84a71518f06c5d26"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_medical_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4140263, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n \r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_institutional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_professional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_inst_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_prof_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_claim_type_unmapped') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_claim_type_mapping_failures') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_plausibility') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_dates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_dates_inst') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_line_numbers') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_medical_claim_invalid_npi') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_institutional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_professional_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_inst_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_prof_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_unmapped", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_claim_type_mapping_failures", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_plausibility", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_dates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_dates_inst", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_line_numbers", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_invalid_npi", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n \nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_institutional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_professional_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_inst_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_prof_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_unmapped\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_claim_type_mapping_failures\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_plausibility\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_dates_inst\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_line_numbers\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_invalid_npi", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "6646b4baef24d7c537c96f0d03b8da68193bf5758cc37ebd69814a631d810f69"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_detail_stage_pharmacy_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4300463, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_detail_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id as foreign_key\r\n , data_source\r\n , test_category\r\n , test_name\r\n , pipeline_test\r\nfrom {{ ref('data_quality__claims_preprocessing_pharmacy_claim_line_numbers') }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_pharmacy_claim_duplicates", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_missing_values", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_header_fail_details", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_duplicates\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_missing_values\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_header_fail_details\nunion all\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id as foreign_key\n , data_source\n , test_category\n , test_name\n , pipeline_test\nfrom dev_thuxuan.data_quality._int_claims_preprocessing_pharmacy_claim_line_numbers", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_eligibility"], "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "ee709476894a6a2db7502fa17fae9ad0a4105eabaa1ba2f8ae0e041aba58a69f"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_eligibility", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3474166, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Tests with the category 'invalid_values' are joined to the denominator model\r\n on test_name since that denominator logic is dependent on whether that\r\n specific field is populated or not.\r\n\r\n All other tests are joined to the denominator model on claim_type.\r\n*/\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_eligibility_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__eligibility'\r\nand test_category <> 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_eligibility_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__eligibility'\r\nand test_category = 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_denominators", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_eligibility_denominators", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_eligibility.sql", "compiled": true, "compiled_code": "\n/*\n Tests with the category 'invalid_values' are joined to the denominator model\n on test_name since that denominator logic is dependent on whether that\n specific field is populated or not.\n\n All other tests are joined to the denominator model on claim_type.\n*/\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'normalized_input__eligibility'\nand test_category <> 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_eligibility_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'normalized_input__eligibility'\nand test_category = 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_medical_claim"], "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "4e0dda9ef2c4378f49f25306f0028cc4944a775d31df6fa73b0e314195eb6030"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_medical_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.3965032, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n/*\r\n Tests with the category 'invalid_values' are joined to the denominator model\r\n on test_name since that denominator logic is dependent on whether that\r\n specific field is populated or not.\r\n\r\n All other tests are joined to the denominator model on claim_type.\r\n*/\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_medical_claim_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__medical_claim'\r\nand test_category <> 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_quality__claims_preprocessing_test_detail') }} det\r\ninner join {{ ref('data_quality__claims_preprocessing_medical_claim_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'normalized_input__medical_claim'\r\nand test_category = 'invalid_values'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , denom.denominator", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_denominators", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_medical_claim_denominators", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n/*\n Tests with the category 'invalid_values' are joined to the denominator model\n on test_name since that denominator logic is dependent on whether that\n specific field is populated or not.\n\n All other tests are joined to the denominator model on claim_type.\n*/\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators denom\n on det.claim_type = denom.test_denominator_name\nwhere source_table = 'normalized_input__medical_claim'\nand test_category <> 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator\n\nunion all\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n , denom.denominator\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail det\ninner join dev_thuxuan.data_quality._int_claims_preprocessing_medical_claim_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'normalized_input__medical_claim'\nand test_category = 'invalid_values'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "original_file_path": "models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing", "intermediate", "data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"], "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "3423b4d2cabdecc7038372f51d19d4c4a9762b4281b249494635376eb1f3c2e9"}, "config": {"enabled": true, "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\data_quality\\data_quality_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "data_quality", "alias": "_int_claims_preprocessing_test_result_stage_pharmacy_claim", "tags": ["data_quality", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4275367, "relation_name": "dev_thuxuan.data_quality._int_claims_preprocessing_test_result_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith pharmacy_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as claim_type\r\n , cast(count(distinct claim_id||data_source) as int) as count\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\n from {{ ref('normalized_input__pharmacy_claim') }}\r\n)\r\n\r\n, distinct_patient_per_category as(\r\n select\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n , count(distinct foreign_key||data_source) as failures\r\n from {{ ref('data_quality__claims_preprocessing_test_detail') }}\r\n where source_table = 'normalized_input__pharmacy_claim'\r\n group by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , pipeline_test\r\n )\r\n\r\n select\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , pipeline_test\r\n , claim.failures\r\n , denom.count as denominator\r\n , tuva_last_run\r\n from distinct_patient_per_category claim\r\n left join pharmacy_claim_denominator denom\r\n on claim.claim_type = denom.claim_type\r\n group by\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , pipeline_test\r\n , claim.failures\r\n , denom.count\r\n , tuva_last_run", "language": "sql", "refs": [{"name": "normalized_input__pharmacy_claim", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\claims_preprocessing\\intermediate\\data_quality__claims_preprocessing_test_result_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nwith pharmacy_claim_denominator as(\n select \n cast('all' as TEXT ) as claim_type\n , cast(count(distinct claim_id||data_source) as int) as count\n , cast('2024-05-16 18:33:00.017657+00:00' as TEXT ) as tuva_last_run\n from dev_thuxuan.claims_preprocessing.normalized_input_pharmacy_claim\n)\n\n, distinct_patient_per_category as(\n select\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n , count(distinct foreign_key||data_source) as failures\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where source_table = 'normalized_input__pharmacy_claim'\n group by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , pipeline_test\n )\n\n select\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , pipeline_test\n , claim.failures\n , denom.count as denominator\n , tuva_last_run\n from distinct_patient_per_category claim\n left join pharmacy_claim_denominator denom\n on claim.claim_type = denom.claim_type\n group by\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , pipeline_test\n , claim.failures\n , denom.count\n , tuva_last_run", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__summary": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\final\\ed_classification__summary.sql", "original_file_path": "models\\ed_classification\\final\\ed_classification__summary.sql", "unique_id": "model.the_tuva_project.ed_classification__summary", "fqn": ["the_tuva_project", "ed_classification", "final", "ed_classification__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "9290d8250597c0341bfa2c94b64a7660c3a7a069a6bf30ef425bcf24bf41d14b"}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "ED Classification as a cube that can be summarized\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ed_classification_description": {"name": "ed_classification_description", "description": "ED classification category.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/ed_classification/ed_classification__categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ed_classification_order": {"name": "ed_classification_order", "description": "The order of the classification.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/ed_classification/ed_classification__categories.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Year and month of the encounter end date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_name": {"name": "facility_name", "description": "The name of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_state": {"name": "facility_state", "description": "The state of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_city": {"name": "facility_city", "description": "The city of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_zip_code": {"name": "facility_zip_code", "description": "The zip code of the facility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_sex": {"name": "patient_sex", "description": "The sex of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The age of the patient at the time of the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_zip_code": {"name": "patient_zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_latitude": {"name": "patient_latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_longitude": {"name": "patient_longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "summary", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4610791, "relation_name": "dev_thuxuan.ed_classification.summary", "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nselect\r\n class.encounter_id\r\n , cat.classification_name as ed_classification_description\r\n , cat.classification_order as ed_classification_order\r\n , class.patient_id\r\n , class.encounter_end_date\r\n , cast({{ date_part(\"year\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}) \r\n || right('0'||cast({{ date_part(\"month\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}),2) \r\n as year_month\r\n , class.primary_diagnosis_code\r\n , class.primary_diagnosis_description\r\n , class.paid_amount\r\n , class.allowed_amount\r\n , class.charge_amount\r\n , class.facility_npi\r\n , fac_prov.provider_organization_name as facility_name\r\n , practice_state as facility_state\r\n , practice_city as facility_city\r\n , practice_zip_code as facility_zip_code\r\n-- , null as facility_latitude\r\n-- , null as facility_longitude\r\n , pat.sex as patient_sex\r\n , floor({{ datediff('pat.birth_date', 'class.encounter_end_date', 'hour') }} / 8766.0) as patient_age\r\n , zip_code as patient_zip_code\r\n , latitude as patient_latitude\r\n , longitude as patient_longitude\r\n , race as patient_race\r\nfrom {{ ref('ed_classification__int_filter_encounter_with_classification') }} class\r\ninner join {{ ref('ed_classification__categories') }} cat\r\n using(classification)\r\nleft join {{ ref('terminology__provider') }} fac_prov \r\n on class.facility_npi = fac_prov.npi\r\nleft join {{ ref('ed_classification__stg_patient') }} pat\r\n on class.patient_id = pat.patient_id", "language": "sql", "refs": [{"name": "ed_classification__int_filter_encounter_with_classification", "package": null, "version": null}, {"name": "ed_classification__categories", "package": null, "version": null}, {"name": "terminology__provider", "package": null, "version": null}, {"name": "ed_classification__stg_patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__stg_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\final\\ed_classification__summary.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient\n)select\n class.encounter_id\n , cat.classification_name as ed_classification_description\n , cat.classification_order as ed_classification_order\n , class.patient_id\n , class.encounter_end_date\n , cast(date_part('year', class.encounter_end_date) as TEXT) \n || right('0'||cast(date_part('month', class.encounter_end_date) as TEXT),2) \n as year_month\n , class.primary_diagnosis_code\n , class.primary_diagnosis_description\n , class.paid_amount\n , class.allowed_amount\n , class.charge_amount\n , class.facility_npi\n , fac_prov.provider_organization_name as facility_name\n , practice_state as facility_state\n , practice_city as facility_city\n , practice_zip_code as facility_zip_code\n-- , null as facility_latitude\n-- , null as facility_longitude\n , pat.sex as patient_sex\n , floor(datediff(\n hour,\n pat.birth_date,\n class.encounter_end_date\n ) / 8766.0) as patient_age\n , zip_code as patient_zip_code\n , latitude as patient_latitude\n , longitude as patient_longitude\n , race as patient_race\nfrom dev_thuxuan.ed_classification._int_filter_encounter_with_classification class\ninner join dev_thuxuan.ed_classification._value_set_categories cat\n using(classification)\nleft join dev_thuxuan.terminology.provider fac_prov \n on class.facility_npi = fac_prov.npi\nleft join __dbt__cte__ed_classification__stg_patient pat\n on class.patient_id = pat.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__int_filter_encounter_with_classification", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_filter_encounter_with_classification"], "alias": "_int_filter_encounter_with_classification", "checksum": {"name": "sha256", "checksum": "957e5c16209eec1ea32bacfe72782ba0e54835625b1bd7cbfde214edc2466b6f"}, "config": {"enabled": true, "alias": "_int_filter_encounter_with_classification", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filter out ED visits that were not classified", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_filter_encounter_with_classification", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4640968, "relation_name": "dev_thuxuan.ed_classification._int_filter_encounter_with_classification", "raw_code": "/*\r\nFilter conditions to those that were classified and pick the classification\r\nwith the greatest probability (that's the greatest logic). This logic removes\r\nany rows that were not classified.\r\n*/\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n a.*\r\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\r\n when edcnnpa then 'edcnnpa'\r\n when edcnpa then 'edcnpa'\r\n when epct then 'epct'\r\n when noner then 'noner'\r\n when injury then 'injury'\r\n when psych then 'psych'\r\n when alcohol then 'alcohol'\r\n when drug then 'drug'\r\n else 'unclassified'\r\n end as classification\r\nfrom {{ ref('ed_classification__int_map_primary_dx') }} a\r\nwhere ed_classification_capture = 1", "language": "sql", "refs": [{"name": "ed_classification__int_map_primary_dx", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_map_primary_dx"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "compiled": true, "compiled_code": "/*\nFilter conditions to those that were classified and pick the classification\nwith the greatest probability (that's the greatest logic). This logic removes\nany rows that were not classified.\n*/\n\n\nselect\n a.*\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom dev_thuxuan.ed_classification._int_by_provider_parent_organization a\nwhere ed_classification_capture = 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__int_map_primary_dx", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_map_primary_dx"], "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "0877b4a072661d4cfb43b0be26e3085401e870f4d2df058815f590467c8fcbe7"}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Map ED encounter primary dx to classification", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_by_provider_parent_organization", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4661012, "relation_name": "dev_thuxuan.ed_classification._int_by_provider_parent_organization", "raw_code": "/*\r\nAll condition discharge diagnosis left join with probabilistic\r\nindicators of ED classification terminology\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\r\n\r\nwith condition as (\r\n select * \r\n from {{ ref('ed_classification__stg_encounter') }}\r\n where encounter_type = 'emergency department'\r\n)\r\n, icd9 as (\r\n select\r\n icd9 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd9') }}\r\n)\r\n, icd10 as (\r\n select\r\n icd10 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd10') }}\r\n)\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd10.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\r\nfrom condition a\r\nleft join icd10\r\n on a.primary_diagnosis_code = icd10.code \r\n and a.primary_diagnosis_code_type = 'icd-10-cm'\r\n\r\nunion all\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd9.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\r\nfrom condition a\r\ninner join icd9\r\n on a.primary_diagnosis_code = icd9.code \r\n and a.primary_diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [{"name": "ed_classification__stg_encounter", "package": null, "version": null}, {"name": "ed_classification__johnston_icd9", "package": null, "version": null}, {"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "compiled": true, "compiled_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n\n\n\nwith __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter\n),condition as (\n select * \n from __dbt__cte__ed_classification__stg_encounter\n where encounter_type = 'emergency department'\n)\n, icd9 as (\n select\n icd9 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from dev_thuxuan.ed_classification._value_set_johnston_icd9\n)\n, icd10 as (\n select\n icd10 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from dev_thuxuan.ed_classification._value_set_johnston_icd10\n)\n\nselect\n a.*\n \n , icd10.edcnnpa\n \n , icd10.edcnpa\n \n , icd10.epct\n \n , icd10.noner\n \n , icd10.injury\n \n , icd10.psych\n \n , icd10.alcohol\n \n , icd10.drug\n \n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\n on a.primary_diagnosis_code = icd10.code \n and a.primary_diagnosis_code_type = 'icd-10-cm'\n\nunion all\n\nselect\n a.*\n \n , icd9.edcnnpa\n \n , icd9.edcnpa\n \n , icd9.epct\n \n , icd9.noner\n \n , icd9.injury\n \n , icd9.psych\n \n , icd9.alcohol\n \n , icd9.drug\n \n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\n on a.primary_diagnosis_code = icd9.code \n and a.primary_diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_encounter", "sql": " __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_encounter": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__stg_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_encounter.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_encounter", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_encounter"], "alias": "ed_classification__stg_encounter", "checksum": {"name": "sha256", "checksum": "a0586bb4e020076c0b4c14d272cd0808734200f74277e8aca9f34ddb47ac8edf"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4696562, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n , encounter_type\r\n , patient_id\r\n , encounter_end_date\r\n , facility_npi\r\n , primary_diagnosis_code_type\r\n , primary_diagnosis_code\r\n , primary_diagnosis_description\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom dev_thuxuan.core.encounter", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.ed_classification__stg_patient": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__stg_patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\staging\\ed_classification__stg_patient.sql", "original_file_path": "models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "unique_id": "model.the_tuva_project.ed_classification__stg_patient", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_patient"], "alias": "ed_classification__stg_patient", "checksum": {"name": "sha256", "checksum": "93bf9eadd001ac5f3e55956ede7e67da0b6f74958c993f297531954824a8e919"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\ed_classification\\ed_classification_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4736547, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\n , zip_code\r\n , latitude\r\n , longitude\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__member_months", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__member_months.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "unique_id": "model.the_tuva_project.financial_pmpm__member_months", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__member_months"], "alias": "member_months", "checksum": {"name": "sha256", "checksum": "7c54724495bd17f114ae67af6d82308aaeb770e0cf6ab58ef5f39de02f22d95a"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "member_months", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4776785, "relation_name": "dev_thuxuan.financial_pmpm.member_months", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith month_start_and_end_dates as (\r\nselect \r\n concat(cast(year as {{ dbt.type_string() }} ),lpad(cast(month as {{ dbt.type_string() }}),2,'0')) as year_month\r\n, min(full_date) as month_start_date\r\n, max(full_date) as month_end_date\r\nfrom {{ ref('terminology__calendar')}}\r\ngroup by 1\r\n)\r\n\r\nselect distinct\r\n a.patient_id\r\n, year_month\r\n, a.payer\r\n, a.plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('financial_pmpm__stg_eligibility') }} a\r\ninner join month_start_and_end_dates b\r\n on a.enrollment_start_date <= b.month_end_date\r\n and a.enrollment_end_date >= b.month_start_date", "language": "sql", "refs": [{"name": "terminology__calendar", "package": null, "version": null}, {"name": "financial_pmpm__stg_eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n),month_start_and_end_dates as (\nselect \n concat(cast(year as TEXT ),lpad(cast(month as TEXT),2,'0')) as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom dev_thuxuan.terminology.calendar\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, a.plan\n, data_source\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__financial_pmpm__stg_eligibility a\ninner join month_start_and_end_dates b\n on a.enrollment_start_date <= b.month_end_date\n and a.enrollment_end_date >= b.month_start_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "sql": " __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_payer": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_payer", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_payer"], "alias": "pmpm_payer", "checksum": {"name": "sha256", "checksum": "1ace13ef8132f31f22a0d1a1ebba3407b8e182ce5ad2772acff20e1c11799dd5"}, "config": {"enabled": true, "alias": "pmpm_payer", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep. This version of the table computes at the payer grain.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_payer", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.5317967, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_payer", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n)}}\r\n\r\nSELECT \r\n year_month,\r\n payer,\r\n data_source,\r\n count(1) as member_months,\r\n SUM(total_paid) / COUNT(1) AS total_paid,\r\n SUM(medical_paid) / COUNT(1) AS medical_paid,\r\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\r\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\r\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\r\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\r\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\r\n SUM(other_paid) / COUNT(1) AS other_paid,\r\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\r\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\r\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\r\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\r\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\r\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\r\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\r\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\r\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\r\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\r\n SUM(lab_paid) / COUNT(1) AS lab_paid,\r\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\r\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\r\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\r\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\r\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\r\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\r\n SUM(total_allowed) / COUNT(1) AS total_allowed,\r\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\r\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\r\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\r\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\r\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\r\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\r\n SUM(other_allowed) / COUNT(1) AS other_allowed,\r\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\r\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\r\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\r\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\r\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\r\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\r\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\r\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\r\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\r\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\r\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\r\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\r\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\r\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\r\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\r\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\r\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\r\nGROUP BY 1,2,3", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\n payer,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nFROM dev_thuxuan.financial_pmpm.pmpm_prep a\nGROUP BY 1,2,3", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_payer_plan", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_payer_plan"], "alias": "pmpm_payer_plan", "checksum": {"name": "sha256", "checksum": "b404c6f8663ba7c5e552f01aba10d930fb19227711c5deb1ad67c9526ed9f95a"}, "config": {"enabled": true, "alias": "pmpm_payer_plan", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep. This version of the table computes at the payer and plan grain.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_payer_plan", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.5157268, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_payer_plan", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n)}}\r\n\r\nSELECT \r\n year_month,\r\n payer,\r\n plan,\r\n data_source,\r\n count(1) as member_months,\r\n SUM(total_paid) / COUNT(1) AS total_paid,\r\n SUM(medical_paid) / COUNT(1) AS medical_paid,\r\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\r\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\r\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\r\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\r\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\r\n SUM(other_paid) / COUNT(1) AS other_paid,\r\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\r\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\r\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\r\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\r\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\r\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\r\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\r\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\r\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\r\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\r\n SUM(lab_paid) / COUNT(1) AS lab_paid,\r\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\r\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\r\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\r\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\r\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\r\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\r\n SUM(total_allowed) / COUNT(1) AS total_allowed,\r\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\r\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\r\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\r\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\r\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\r\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\r\n SUM(other_allowed) / COUNT(1) AS other_allowed,\r\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\r\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\r\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\r\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\r\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\r\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\r\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\r\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\r\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\r\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\r\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\r\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\r\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\r\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\r\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\r\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\r\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\r\nGROUP BY 1,2,3,4", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_payer_plan.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\n payer,\n plan,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nFROM dev_thuxuan.financial_pmpm.pmpm_prep a\nGROUP BY 1,2,3,4", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__pmpm_prep", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "original_file_path": "models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_prep"], "alias": "pmpm_prep", "checksum": {"name": "sha256", "checksum": "501e2b0133d5e6d7a90d626d503b77c0753fdcbe014b5cf6b09a53a8f9ac1f61"}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_prep", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.4971962, "relation_name": "dev_thuxuan.financial_pmpm.pmpm_prep", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith combine as (\r\nSELECT\r\n a.patient_id,\r\n a.year_month,\r\n a.payer,\r\n a.plan, \r\n a.data_source,\r\n \r\n -- service cat 1 paid\r\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\r\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\r\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\r\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\r\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\r\n COALESCE(b.other_paid, 0) AS other_paid,\r\n \r\n -- service cat 2 paid\r\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\r\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\r\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\r\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\r\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\r\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\r\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\r\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\r\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\r\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\r\n COALESCE(c.lab_paid, 0) AS lab_paid,\r\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\r\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\r\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\r\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\r\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\r\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\r\n \r\n -- service cat 1 allowed\r\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\r\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\r\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\r\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\r\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\r\n COALESCE(d.other_allowed, 0) AS other_allowed,\r\n \r\n -- service cat 2 allowed\r\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\r\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\r\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\r\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\r\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\r\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\r\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\r\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\r\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\r\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\r\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\r\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\r\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\r\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\r\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\r\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\r\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\r\nFROM {{ ref('financial_pmpm__member_months') }} a\r\nleft join {{ ref('financial_pmpm__service_category_1_paid_pivot') }} b\r\n on a.patient_id = b.patient_id\r\n and a.year_month = b.year_month\r\n and a.payer = b.payer\r\n and a.plan = b.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_paid_pivot') }} c\r\n on a.patient_id = c.patient_id\r\n and a.year_month = c.year_month\r\n and a.payer = c.payer\r\n and a.plan = c.plan\r\nleft join {{ ref('financial_pmpm__service_category_1_allowed_pivot') }} d\r\n on a.patient_id = d.patient_id\r\n and a.year_month = d.year_month\r\n and a.payer = d.payer\r\n and a.plan = d.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_allowed_pivot') }} e\r\n on a.patient_id = e.patient_id\r\n and a.year_month = e.year_month\r\n and a.payer = e.payer\r\n and a.plan = e.plan \r\n)\r\n\r\nselect *\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine", "language": "sql", "refs": [{"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_paid_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_1_allowed_pivot", "package": null, "version": null}, {"name": "financial_pmpm__service_category_2_allowed_pivot", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "compiled": true, "compiled_code": "\n\nwith combine as (\nSELECT\n a.patient_id,\n a.year_month,\n a.payer,\n a.plan, \n a.data_source,\n \n -- service cat 1 paid\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\n COALESCE(b.other_paid, 0) AS other_paid,\n \n -- service cat 2 paid\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\n COALESCE(c.lab_paid, 0) AS lab_paid,\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\n \n -- service cat 1 allowed\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\n COALESCE(d.other_allowed, 0) AS other_allowed,\n \n -- service cat 2 allowed\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\nFROM dev_thuxuan.financial_pmpm.member_months a\nleft join dev_thuxuan.financial_pmpm._int_service_category_1_paid_pivot b\n on a.patient_id = b.patient_id\n and a.year_month = b.year_month\n and a.payer = b.payer\n and a.plan = b.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_2_paid_pivot c\n on a.patient_id = c.patient_id\n and a.year_month = c.year_month\n and a.payer = c.payer\n and a.plan = c.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_1_allowed_pivot d\n on a.patient_id = d.patient_id\n and a.year_month = d.year_month\n and a.payer = d.payer\n and a.plan = d.plan\nleft join dev_thuxuan.financial_pmpm._int_service_category_2_allowed_pivot e\n on a.patient_id = e.patient_id\n and a.year_month = e.year_month\n and a.payer = e.payer\n and a.plan = e.plan \n)\n\nselect *\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom combine", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__patient_spend_with_service_categories", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__patient_spend_with_service_categories"], "alias": "_int_patient_spend_with_service_categories", "checksum": {"name": "sha256", "checksum": "76ca55c6b220bea069a99cea0e72084bb7c72a5c0db880460e7f73407680ae02"}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_patient_spend_with_service_categories", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.5343213, "relation_name": "dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith claims_with_service_categories as (\r\n select\r\n a.patient_id\r\n , a.payer\r\n , a.plan\r\n , a.service_category_1\r\n , a.service_category_2\r\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\r\n , a.paid_amount\r\n , a.allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_medical_claim') }} a\r\n)\r\n\r\n, medical_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from claims_with_service_categories\r\n)\r\n\r\n, rx_claims as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , 'Pharmacy' as service_category_1\r\n , cast(null as {{ dbt.type_string() }}) as service_category_2\r\n , {{try_to_cast_date('dispensing_date','YYYMMDD') }} as claim_date\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_pharmacy_claim') }}\r\n)\r\n\r\n, rx_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from rx_claims\r\n)\r\n\r\n, combine_medical_and_rx as (\r\nselect *\r\nfrom medical_claims_year_month\r\n\r\nunion all\r\n\r\nselect *\r\nfrom rx_claims_year_month\r\n)\r\n\r\nselect\r\n patient_id\r\n , year_month\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , sum(paid_amount) as total_paid\r\n , sum(allowed_amount) as total_allowed\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from combine_medical_and_rx\r\ngroup by 1,2,3,4,5,6,9", "language": "sql", "refs": [{"name": "financial_pmpm__stg_medical_claim", "package": null, "version": null}, {"name": "financial_pmpm__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date"], "nodes": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n), __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n),claims_with_service_categories as (\n select\n a.patient_id\n , a.payer\n , a.plan\n , a.service_category_1\n , a.service_category_2\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\n , a.paid_amount\n , a.allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_medical_claim a\n)\n\n, medical_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from claims_with_service_categories\n)\n\n, rx_claims as (\n select\n patient_id\n , payer\n , plan\n , 'Pharmacy' as service_category_1\n , cast(null as TEXT) as service_category_2\n , try_cast( dispensing_date as date ) as claim_date\n , paid_amount\n , allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_pharmacy_claim\n)\n\n, rx_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from rx_claims\n)\n\n, combine_medical_and_rx as (\nselect *\nfrom medical_claims_year_month\n\nunion all\n\nselect *\nfrom rx_claims_year_month\n)\n\nselect\n patient_id\n , year_month\n , payer\n , plan\n , service_category_1\n , service_category_2\n , sum(paid_amount) as total_paid\n , sum(allowed_amount) as total_allowed\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n from combine_medical_and_rx\ngroup by 1,2,3,4,5,6,9", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "sql": " __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n)"}, {"id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "sql": " __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_1_allowed_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_allowed_pivot"], "alias": "_int_service_category_1_allowed_pivot", "checksum": {"name": "sha256", "checksum": "d7670c26f5543ff55f06266d65d6c7bc716e4c5d4c7f7ca162f1688607ad631b"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.538375, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_1_allowed_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_allowed) as total_allowed\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_allowed\n else 0\n end\n )\n \n \n as ancillary_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_allowed\n else 0\n end\n )\n \n \n as other_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_allowed\n else 0\n end\n )\n \n \n as pharmacy_allowed\n \n \n \n \n\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_1_paid_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_paid_pivot"], "alias": "_int_service_category_1_paid_pivot", "checksum": {"name": "sha256", "checksum": "109e47fb5265f6efb0a765109920a5f73cbfc3f403700996b7f06d70e7695da4"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.5443773, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_1_paid_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_1 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_paid) as total_paid\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_paid\n else 0\n end\n )\n \n \n as ancillary_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_paid\n else 0\n end\n )\n \n \n as other_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_paid\n else 0\n end\n )\n \n \n as pharmacy_paid\n \n \n \n \n\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_2_allowed_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_allowed_pivot"], "alias": "_int_service_category_2_allowed_pivot", "checksum": {"name": "sha256", "checksum": "fa9f6160300e6ed651e3530511e4d277204261368dd39278b161fcc1841e66ce"}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.541373, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_2_allowed_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id \r\n, year_month \r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_allowed) as total_allowed\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id \n, year_month \n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as acute_inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulance_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulatory_surgery_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_allowed\n else 0\n end\n )\n \n \n as dialysis_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_allowed\n else 0\n end\n )\n \n \n as durable_medical_equipment_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_allowed\n else 0\n end\n )\n \n \n as emergency_department_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_allowed\n else 0\n end\n )\n \n \n as home_health_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_allowed\n else 0\n end\n )\n \n \n as hospice_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_allowed\n else 0\n end\n )\n \n \n as lab_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_allowed\n else 0\n end\n )\n \n \n as skilled_nursing_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_allowed\n else 0\n end\n )\n \n \n as urgent_care_allowed\n \n \n \n \n\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "dev_thuxuan", "schema": "financial_pmpm", "name": "financial_pmpm__service_category_2_paid_pivot", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "original_file_path": "models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_paid_pivot"], "alias": "_int_service_category_2_paid_pivot", "checksum": {"name": "sha256", "checksum": "db092a4f2b87bf0e9b6dc7ae299032026beefa111e735c9d1569317538fe11fb"}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.5473719, "relation_name": "dev_thuxuan.financial_pmpm._int_service_category_2_paid_pivot", "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nwith service_cat_2 as (\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [{"name": "financial_pmpm__patient_spend_with_service_categories", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_paid) as total_paid\nfrom dev_thuxuan.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as acute_inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_paid\n else 0\n end\n )\n \n \n as ambulance_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_paid\n else 0\n end\n )\n \n \n as ambulatory_surgery_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_paid\n else 0\n end\n )\n \n \n as dialysis_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_paid\n else 0\n end\n )\n \n \n as durable_medical_equipment_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_paid\n else 0\n end\n )\n \n \n as emergency_department_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_paid\n else 0\n end\n )\n \n \n as home_health_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_paid\n else 0\n end\n )\n \n \n as hospice_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_paid\n else 0\n end\n )\n \n \n as lab_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_paid\n else 0\n end\n )\n \n \n as skilled_nursing_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_paid\n else 0\n end\n )\n \n \n as urgent_care_paid\n \n \n \n \n\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_eligibility"], "alias": "financial_pmpm__stg_eligibility", "checksum": {"name": "sha256", "checksum": "5d748a17a0f5a9eb9d32f6490b0340ce31b7ca73d915267033d5a7f7d94497e8"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["financial_pmpm"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.549354, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [{"name": "core__eligibility", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.eligibility", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_medical_claim"], "alias": "financial_pmpm__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "2b54ef7b2265108ae6c9fa4b2ff6542a9adbfbd502b4def9140b075b7f21e5cb"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6163507, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , claim_start_date\r\n , claim_end_date\r\n , service_category_1\r\n , service_category_2\r\n , paid_amount\r\n , allowed_amount\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n , claim_id\n , claim_line_number\n , claim_start_date\n , claim_end_date\n , service_category_1\n , service_category_2\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "test", "name": "financial_pmpm__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "original_file_path": "models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_pharmacy_claim"], "alias": "financial_pmpm__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "52660c53aafffd07b26e62aab32b85efa64080bfcd0248ac69c2106fac7c80ed"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6188884, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n patient_id\r\n , dispensing_date\r\n , paid_amount\r\n , allowed_amount\r\n , payer\r\n , plan\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n , dispensing_date\n , paid_amount\n , allowed_amount\n , payer\n , plan\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__list": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__list", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__list.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__list.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__list", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__list"], "alias": "list", "checksum": {"name": "sha256", "checksum": "02ca23ae8dfb65e6b4337e7a240d70e2758fd01067ecdc40290d6e2939c92f19"}, "config": {"enabled": true, "alias": "list", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays the list of suspecting conditions per patient, data_source, hcc, and diagnosis code with the reason and contributing factors.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition, observation, result, etc. was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "list", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.625888, "relation_name": "dev_thuxuan.hcc_suspecting.list", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith hcc_history_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, comorbidity_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_comorbidity_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, observation_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_observation_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, lab_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_lab_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, medication_suspects as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n from {{ ref('hcc_suspecting__int_medication_suspects') }}\r\n where (current_year_billed = false\r\n or current_year_billed is null)\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from hcc_history_suspects\r\n union all\r\n select * from comorbidity_suspects\r\n union all\r\n select * from observation_suspects\r\n union all\r\n select * from lab_suspects\r\n union all\r\n select * from medication_suspects\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}, {"name": "hcc_suspecting__int_comorbidity_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_observation_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_lab_suspects", "package": null, "version": null}, {"name": "hcc_suspecting__int_medication_suspects", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__list.sql", "compiled": true, "compiled_code": "\n\nwith hcc_history_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, comorbidity_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_comorbidity_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, observation_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_observation_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, lab_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_lab_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, medication_suspects as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n from dev_thuxuan.hcc_suspecting._int_medication_suspects\n where (current_year_billed = false\n or current_year_billed is null)\n\n)\n\n, unioned as (\n\n select * from hcc_history_suspects\n union all\n select * from comorbidity_suspects\n union all\n select * from observation_suspects\n union all\n select * from lab_suspects\n union all\n select * from medication_suspects\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from unioned\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__list_rollup": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__list_rollup", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__list_rollup"], "alias": "list_rollup", "checksum": {"name": "sha256", "checksum": "af9e01b29e7dbef236a892e44c24386aa71a33395f9429c03213361449d9e5bd"}, "config": {"enabled": true, "alias": "list_rollup", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays the list of suspecting conditions per patient and hcc with the latest contributing factor rolled up.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "latest_suspect_date": {"name": "latest_suspect_date", "description": "Latest date when the suspecting condition, observation, result, etc. was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "list_rollup", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6303978, "relation_name": "dev_thuxuan.hcc_suspecting.list_rollup", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith list as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , row_number() over (\r\n partition by\r\n patient_id\r\n , hcc_code\r\n order by suspect_date desc\r\n ) as row_num\r\n from {{ ref('hcc_suspecting__list') }}\r\n\r\n)\r\n\r\n, list_dedupe as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , suspect_date as latest_suspect_date\r\n from list\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(latest_suspect_date as date) as latest_suspect_date\r\n from list_dedupe\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , reason\r\n , contributing_factor\r\n , latest_suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__list", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__list"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__list_rollup.sql", "compiled": true, "compiled_code": "\n\nwith list as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date\n , row_number() over (\n partition by\n patient_id\n , hcc_code\n order by suspect_date desc\n ) as row_num\n from dev_thuxuan.hcc_suspecting.list\n\n)\n\n, list_dedupe as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , suspect_date as latest_suspect_date\n from list\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(latest_suspect_date as date) as latest_suspect_date\n from list_dedupe\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , reason\n , contributing_factor\n , latest_suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__summary": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\final\\hcc_suspecting__summary.sql", "original_file_path": "models\\hcc_suspecting\\final\\hcc_suspecting__summary.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__summary", "fqn": ["the_tuva_project", "hcc_suspecting", "final", "hcc_suspecting__summary"], "alias": "summary", "checksum": {"name": "sha256", "checksum": "ba92ab6650921a4cbf6f93a52d370768beb0288776da11b44ac00b0a7c691125"}, "config": {"enabled": true, "alias": "summary", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This final model displays a rollup of suspecting conditions per patient.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_sex": {"name": "patient_sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient's current age.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspecting_gaps": {"name": "suspecting_gaps", "description": "Count of suspecting conditions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "summary", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.634908, "relation_name": "dev_thuxuan.hcc_suspecting.summary", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , floor({{ datediff('birth_date', 'current_date', 'hour') }} / 8766.0) as age\r\n from {{ ref('hcc_suspecting__stg_core__patient') }}\r\n where death_date is null\r\n\r\n)\r\n\r\n, suspecting_list as (\r\n\r\n select\r\n patient_id\r\n , count(*) as gaps\r\n from {{ ref('hcc_suspecting__list') }}\r\n group by patient_id\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n patients.patient_id\r\n , patients.sex\r\n , patients.birth_date\r\n , patients.age\r\n , suspecting_list.gaps\r\n from patients\r\n inner join suspecting_list\r\n on patients.patient_id = suspecting_list.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(sex as {{ dbt.type_string() }}) as patient_sex\r\n , cast(birth_date as date) as patient_birth_date\r\n , cast(age as integer) as patient_age\r\n , cast(gaps as integer) as suspecting_gaps\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , patient_sex\r\n , patient_birth_date\r\n , patient_age\r\n , suspecting_gaps\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__patient", "package": null, "version": null}, {"name": "hcc_suspecting__list", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__patient", "model.the_tuva_project.hcc_suspecting__list"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\final\\hcc_suspecting__summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient\n),patients as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n current_date\n ) / 8766.0) as age\n from __dbt__cte__hcc_suspecting__stg_core__patient\n where death_date is null\n\n)\n\n, suspecting_list as (\n\n select\n patient_id\n , count(*) as gaps\n from dev_thuxuan.hcc_suspecting.list\n group by patient_id\n\n)\n\n, joined as (\n\n select\n patients.patient_id\n , patients.sex\n , patients.birth_date\n , patients.age\n , suspecting_list.gaps\n from patients\n inner join suspecting_list\n on patients.patient_id = suspecting_list.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(sex as TEXT) as patient_sex\n , cast(birth_date as date) as patient_birth_date\n , cast(age as integer) as patient_age\n , cast(gaps as integer) as suspecting_gaps\n from joined\n\n)\n\nselect\n patient_id\n , patient_sex\n , patient_birth_date\n , patient_age\n , suspecting_gaps\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__patient", "sql": " __dbt__cte__hcc_suspecting__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_all_conditions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_all_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_all_conditions"], "alias": "_int_all_conditions", "checksum": {"name": "sha256", "checksum": "31f7087d7800109df25b4f2bd2bfe15bef163cdf1ed470c43c7fd6be9bf04ff5"}, "config": {"enabled": true, "alias": "_int_all_conditions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "All historical conditions mapped to HCCs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_all_conditions", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.638913, "relation_name": "dev_thuxuan.hcc_suspecting._int_all_conditions", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n diagnosis_code\r\n , cms_hcc_v28 as hcc_code\r\n from {{ ref('hcc_suspecting__icd_10_cm_mappings') }}\r\n where cms_hcc_v28 is not null\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_hcc_mapping.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from conditions\r\n left join seed_hcc_mapping\r\n on conditions.code = seed_hcc_mapping.diagnosis_code\r\n left join seed_hcc_descriptions\r\n on seed_hcc_mapping.hcc_code = seed_hcc_descriptions.hcc_code\r\n where conditions.code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__icd_10_cm_mappings", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_conditions.sql", "compiled": true, "compiled_code": "\n\nwith conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v28 as hcc_code\n from dev_thuxuan.hcc_suspecting._value_set_icd_10_cm_mappings\n where cms_hcc_v28 is not null\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, joined as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code\n , conditions.data_source\n , seed_hcc_mapping.hcc_code\n , seed_hcc_descriptions.hcc_description\n from conditions\n left join seed_hcc_mapping\n on conditions.code = seed_hcc_mapping.diagnosis_code\n left join seed_hcc_descriptions\n on seed_hcc_mapping.hcc_code = seed_hcc_descriptions.hcc_code\n where conditions.code_type = 'icd-10-cm'\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(data_source as TEXT) as data_source\n from joined\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_all_medications": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_all_medications", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_all_medications"], "alias": "_int_all_medications", "checksum": {"name": "sha256", "checksum": "f1698a3af45d12bf1514f7f9c76cba5e93eb85f88349473f05795ec3205509be"}, "config": {"enabled": true, "alias": "_int_all_medications", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Union of medications and pharmacy claims.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed or paid date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug_code": {"name": "drug_code", "description": "NDC or rxnorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_system": {"name": "code_system", "description": "The type of drug code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_all_medications", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.642913, "relation_name": "dev_thuxuan.hcc_suspecting._int_all_medications", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claims as (\r\n\r\n select\r\n patient_id\r\n , coalesce(dispensing_date, paid_date) as dispensing_date\r\n , ndc_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__pharmacy_claim') }}\r\n\r\n)\r\n\r\n, ndc_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from medications\r\n where ndc_code is not null\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code as drug_code\r\n , 'ndc' as code_system\r\n , data_source\r\n from medications\r\n where lower(source_code_type) = 'ndc'\r\n\r\n)\r\n\r\n, rxnorm_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , rxnorm_code as drug_code\r\n , 'rxnorm' as code_system\r\n , data_source\r\n from medications\r\n where rxnorm_code is not null\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code as drug_code\r\n , 'rxnorm' as code_system\r\n , data_source\r\n from medications\r\n where lower(source_code_type) = 'rxnorm'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from pharmacy_claims\r\n union all\r\n select * from ndc_medications\r\n union all\r\n select * from rxnorm_medications\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(dispensing_date as date) as dispensing_date\r\n , cast(drug_code as {{ dbt.type_string() }}) as drug_code\r\n , cast(code_system as {{ dbt.type_string() }}) as code_system\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , drug_code\r\n , code_system\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__medication", "package": null, "version": null}, {"name": "hcc_suspecting__stg_core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_all_medications.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__medication as (\n\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n\n), __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n),medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__medication\n\n)\n\n, pharmacy_claims as (\n\n select\n patient_id\n , coalesce(dispensing_date, paid_date) as dispensing_date\n , ndc_code as drug_code\n , 'ndc' as code_system\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim\n\n)\n\n, ndc_medications as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code as drug_code\n , 'ndc' as code_system\n , data_source\n from medications\n where ndc_code is not null\n\n union all\n\n select\n patient_id\n , dispensing_date\n , source_code as drug_code\n , 'ndc' as code_system\n , data_source\n from medications\n where lower(source_code_type) = 'ndc'\n\n)\n\n, rxnorm_medications as (\n\n select\n patient_id\n , dispensing_date\n , rxnorm_code as drug_code\n , 'rxnorm' as code_system\n , data_source\n from medications\n where rxnorm_code is not null\n\n union all\n\n select\n patient_id\n , dispensing_date\n , source_code as drug_code\n , 'rxnorm' as code_system\n , data_source\n from medications\n where lower(source_code_type) = 'rxnorm'\n\n)\n\n, unioned as (\n\n select * from pharmacy_claims\n union all\n select * from ndc_medications\n union all\n select * from rxnorm_medications\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(dispensing_date as date) as dispensing_date\n , cast(drug_code as TEXT) as drug_code\n , cast(code_system as TEXT) as code_system\n , cast(data_source as TEXT) as data_source\n from unioned\n\n)\n\nselect\n patient_id\n , dispensing_date\n , drug_code\n , code_system\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__medication", "sql": " __dbt__cte__hcc_suspecting__stg_core__medication as (\n\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "sql": " __dbt__cte__hcc_suspecting__stg_core__pharmacy_claim as (\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_comorbidity_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_comorbidity_suspects"], "alias": "_int_comorbidity_suspects", "checksum": {"name": "sha256", "checksum": "940c1d10889c686d746892a5f1fa149f8b168c7d57d96b1774f3fdfe9c9d29ab"}, "config": {"enabled": true, "alias": "_int_comorbidity_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting comorbidities.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_concept_name": {"name": "condition_1_concept_name", "description": "Clinical concept name for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_code": {"name": "condition_1_code", "description": "Condition code for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_1_recorded_date": {"name": "condition_1_recorded_date", "description": "Recorded date for the first comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_concept_name": {"name": "condition_2_concept_name", "description": "Clinical concept name for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_code": {"name": "condition_2_code", "description": "Condition code for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_2_recorded_date": {"name": "condition_2_recorded_date", "description": "Recorded date for the second comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_comorbidity_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6489131, "relation_name": "dev_thuxuan.hcc_suspecting._int_comorbidity_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN HCC 37 logic */\r\n, ckd_stage_1_or_2 as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n , row_number() over (\r\n partition by\r\n conditions.patient_id\r\n , conditions.data_source\r\n order by\r\n conditions.recorded_date desc\r\n , conditions.code desc\r\n ) as row_num\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) in (\r\n 'chronic kidney disease, stage 1'\r\n , 'chronic kidney disease, stage 2'\r\n )\r\n\r\n)\r\n\r\n, ckd_stage_1_or_2_dedupe as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n from ckd_stage_1_or_2\r\n where row_num = 1\r\n\r\n)\r\n\r\n, diabetes as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n , row_number() over (\r\n partition by\r\n conditions.patient_id\r\n , conditions.data_source\r\n order by\r\n conditions.recorded_date desc\r\n , conditions.code desc\r\n ) as row_num\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\r\n)\r\n\r\n, diabetes_dedupe as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n from diabetes\r\n where row_num = 1\r\n\r\n)\r\n\r\n, hcc_37_suspect as (\r\n\r\n select\r\n diabetes_dedupe.patient_id\r\n , diabetes_dedupe.data_source\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n , diabetes_dedupe.concept_name as condition_1_concept_name\r\n , diabetes_dedupe.code as condition_1_code\r\n , diabetes_dedupe.recorded_date as condition_1_recorded_date\r\n , ckd_stage_1_or_2_dedupe.concept_name as condition_2_concept_name\r\n , ckd_stage_1_or_2_dedupe.code as condition_2_code\r\n , ckd_stage_1_or_2_dedupe.recorded_date as condition_2_recorded_date\r\n from diabetes_dedupe\r\n inner join ckd_stage_1_or_2_dedupe\r\n on diabetes_dedupe.patient_id = ckd_stage_1_or_2_dedupe.patient_id\r\n and diabetes_dedupe.data_source = ckd_stage_1_or_2_dedupe.data_source\r\n /* ensure conditions overlap in the same year */\r\n and extract(year from diabetes_dedupe.recorded_date) = extract(year from ckd_stage_1_or_2_dedupe.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '37'\r\n\r\n)\r\n/* END HCC 37 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_37_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.condition_1_concept_name\r\n , unioned.condition_1_code\r\n , unioned.condition_1_recorded_date\r\n , unioned.condition_2_concept_name\r\n , unioned.condition_2_code\r\n , unioned.condition_2_recorded_date\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , condition_1_concept_name\r\n , condition_1_code\r\n , condition_1_recorded_date\r\n , condition_2_concept_name\r\n , condition_2_code\r\n , condition_2_recorded_date\r\n , current_year_billed\r\n , cast('Comorbidity suspect' as {{ dbt.type_string() }}) as reason\r\n , condition_1_concept_name\r\n || ' ('\r\n || condition_1_code\r\n || ' on '\r\n || condition_1_recorded_date\r\n || ')'\r\n || ' and '\r\n || condition_2_concept_name\r\n || ' ('\r\n || condition_2_code\r\n || ' on '\r\n || condition_2_recorded_date\r\n || ')'\r\n as contributing_factor\r\n , condition_1_recorded_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(condition_1_concept_name as {{ dbt.type_string() }}) as condition_1_concept_name\r\n , cast(condition_1_code as {{ dbt.type_string() }}) as condition_1_code\r\n , cast(condition_1_recorded_date as date) as condition_1_recorded_date\r\n , cast(condition_2_concept_name as {{ dbt.type_string() }}) as condition_2_concept_name\r\n , cast(condition_2_code as {{ dbt.type_string() }}) as condition_2_code\r\n , cast(condition_2_recorded_date as date) as condition_2_recorded_date\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , condition_1_concept_name\r\n , condition_1_code\r\n , condition_1_recorded_date\r\n , condition_2_concept_name\r\n , condition_2_code\r\n , condition_2_recorded_date\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_comorbidity_suspects.sql", "compiled": true, "compiled_code": "\n\nwith conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN HCC 37 logic */\n, ckd_stage_1_or_2 as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n , row_number() over (\n partition by\n conditions.patient_id\n , conditions.data_source\n order by\n conditions.recorded_date desc\n , conditions.code desc\n ) as row_num\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) in (\n 'chronic kidney disease, stage 1'\n , 'chronic kidney disease, stage 2'\n )\n\n)\n\n, ckd_stage_1_or_2_dedupe as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , concept_name\n from ckd_stage_1_or_2\n where row_num = 1\n\n)\n\n, diabetes as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n , row_number() over (\n partition by\n conditions.patient_id\n , conditions.data_source\n order by\n conditions.recorded_date desc\n , conditions.code desc\n ) as row_num\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\n)\n\n, diabetes_dedupe as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , concept_name\n from diabetes\n where row_num = 1\n\n)\n\n, hcc_37_suspect as (\n\n select\n diabetes_dedupe.patient_id\n , diabetes_dedupe.data_source\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n , diabetes_dedupe.concept_name as condition_1_concept_name\n , diabetes_dedupe.code as condition_1_code\n , diabetes_dedupe.recorded_date as condition_1_recorded_date\n , ckd_stage_1_or_2_dedupe.concept_name as condition_2_concept_name\n , ckd_stage_1_or_2_dedupe.code as condition_2_code\n , ckd_stage_1_or_2_dedupe.recorded_date as condition_2_recorded_date\n from diabetes_dedupe\n inner join ckd_stage_1_or_2_dedupe\n on diabetes_dedupe.patient_id = ckd_stage_1_or_2_dedupe.patient_id\n and diabetes_dedupe.data_source = ckd_stage_1_or_2_dedupe.data_source\n /* ensure conditions overlap in the same year */\n and extract(year from diabetes_dedupe.recorded_date) = extract(year from ckd_stage_1_or_2_dedupe.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '37'\n\n)\n/* END HCC 37 logic */\n\n, unioned as (\n\n select * from hcc_37_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.condition_1_concept_name\n , unioned.condition_1_code\n , unioned.condition_1_recorded_date\n , unioned.condition_2_concept_name\n , unioned.condition_2_code\n , unioned.condition_2_recorded_date\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , condition_1_concept_name\n , condition_1_code\n , condition_1_recorded_date\n , condition_2_concept_name\n , condition_2_code\n , condition_2_recorded_date\n , current_year_billed\n , cast('Comorbidity suspect' as TEXT) as reason\n , condition_1_concept_name\n || ' ('\n || condition_1_code\n || ' on '\n || condition_1_recorded_date\n || ')'\n || ' and '\n || condition_2_concept_name\n || ' ('\n || condition_2_code\n || ' on '\n || condition_2_recorded_date\n || ')'\n as contributing_factor\n , condition_1_recorded_date as suspect_date\n from add_billed_flag\n\n)\n\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(condition_1_concept_name as TEXT) as condition_1_concept_name\n , cast(condition_1_code as TEXT) as condition_1_code\n , cast(condition_1_recorded_date as date) as condition_1_recorded_date\n , cast(condition_2_concept_name as TEXT) as condition_2_concept_name\n , cast(condition_2_code as TEXT) as condition_2_code\n , cast(condition_2_recorded_date as date) as condition_2_recorded_date\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , condition_1_concept_name\n , condition_1_code\n , condition_1_recorded_date\n , condition_2_concept_name\n , condition_2_code\n , condition_2_recorded_date\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_lab_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_lab_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_lab_suspects"], "alias": "_int_lab_suspects", "checksum": {"name": "sha256", "checksum": "449554c7c59402b1dd00c92140045ae1c317c87985dcf2f32b74d1309a0c3fb5"}, "config": {"enabled": true, "alias": "_int_lab_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting conditions based on labs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "Cleaned numeric result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "lab_code": {"name": "lab_code", "description": "The normalized code or source code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting lab result was recorded.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_lab_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6550775, "relation_name": "dev_thuxuan.hcc_suspecting._int_lab_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n from {{ ref('hcc_suspecting__int_prep_egfr_labs') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN CKD logic */\r\n\r\n/*\r\n Find a patient\u2019s two most recent eGFR lab results that are spaced by at\r\n least 90 days.\r\n*/\r\n, max_lab_date as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , max(result_date) as max_result_date\r\n from egfr_labs\r\n group by\r\n patient_id\r\n , data_source\r\n\r\n)\r\n\r\n, lab_lookback as (\r\n\r\n select\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , max_lab_date.max_result_date\r\n , max(egfr_labs.result_date) as lookback_result_date\r\n from egfr_labs\r\n left join max_lab_date\r\n on egfr_labs.patient_id = max_lab_date.patient_id\r\n and egfr_labs.data_source = max_lab_date.data_source\r\n where egfr_labs.result_date <= {{ dateadd('day', -90, 'max_result_date') }}\r\n group by\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , max_lab_date.max_result_date\r\n\r\n)\r\n\r\n/*\r\n Take the highest eGFR result that occurred between the date range.\r\n*/\r\n, eligible_labs as (\r\n\r\n select\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n , egfr_labs.code_type\r\n , egfr_labs.code\r\n , egfr_labs.result_date\r\n , egfr_labs.result\r\n , row_number() over (\r\n partition by\r\n egfr_labs.patient_id\r\n , egfr_labs.data_source\r\n order by egfr_labs.result desc\r\n ) as row_num\r\n from egfr_labs\r\n inner join lab_lookback\r\n on egfr_labs.patient_id = lab_lookback.patient_id\r\n and egfr_labs.data_source = lab_lookback.data_source\r\n where egfr_labs.result_date >= lab_lookback.lookback_result_date\r\n\r\n)\r\n\r\n/*\r\n Assign a patient's kidney disease stage based on the highest eGFR based on\r\n the following range:\r\n\r\n CKD 3a: eGFR in the range (45-59)\r\n CKD 3b: eGFR in the range (30-44)\r\n CKD 4: eGFR in the range (15-29)\r\n CKD 5: eGFR in the range (0-14)\r\n*/\r\n, ckd_suspects as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code as lab_code\r\n , result_date\r\n , result\r\n , case\r\n when result between 0 and 14 then '326'\r\n when result between 15 and 29 then '327'\r\n when result between 30 and 44 then '328'\r\n when result between 45 and 59 then '329'\r\n end as hcc_code\r\n , 'eGFR ('\r\n || code\r\n || ') result '\r\n || cast(result as {{ dbt.type_string() }})\r\n || ' on '\r\n || result_date\r\n as contributing_factor\r\n from eligible_labs\r\n where row_num = 1\r\n\r\n)\r\n/* END CKD logic */\r\n\r\n, unioned as (\r\n\r\n select * from ckd_suspects\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.result_date\r\n , unioned.result\r\n , unioned.lab_code\r\n , unioned.hcc_code\r\n , unioned.contributing_factor\r\n , seed_hcc_descriptions.hcc_description\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n inner join seed_hcc_descriptions\r\n on unioned.hcc_code = seed_hcc_descriptions.hcc_code\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , result_date\r\n , result\r\n , lab_code\r\n , hcc_code\r\n , hcc_description\r\n , contributing_factor\r\n , current_year_billed\r\n , cast('Lab result suspect' as {{ dbt.type_string() }}) as reason\r\n , result_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(result_date as date) as result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n , cast(lab_code as {{ dbt.type_string() }}) as lab_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , result_date\r\n , result\r\n , lab_code\r\n , hcc_code\r\n , hcc_description\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_egfr_labs", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_lab_suspects.sql", "compiled": true, "compiled_code": "\n\nwith egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n from dev_thuxuan.hcc_suspecting._int_prep_egfr_labs\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN CKD logic */\n\n/*\n Find a patient\u2019s two most recent eGFR lab results that are spaced by at\n least 90 days.\n*/\n, max_lab_date as (\n\n select\n patient_id\n , data_source\n , max(result_date) as max_result_date\n from egfr_labs\n group by\n patient_id\n , data_source\n\n)\n\n, lab_lookback as (\n\n select\n egfr_labs.patient_id\n , egfr_labs.data_source\n , max_lab_date.max_result_date\n , max(egfr_labs.result_date) as lookback_result_date\n from egfr_labs\n left join max_lab_date\n on egfr_labs.patient_id = max_lab_date.patient_id\n and egfr_labs.data_source = max_lab_date.data_source\n where egfr_labs.result_date <= \n\n dateadd(\n day,\n -90,\n max_result_date\n )\n\n\n group by\n egfr_labs.patient_id\n , egfr_labs.data_source\n , max_lab_date.max_result_date\n\n)\n\n/*\n Take the highest eGFR result that occurred between the date range.\n*/\n, eligible_labs as (\n\n select\n egfr_labs.patient_id\n , egfr_labs.data_source\n , egfr_labs.code_type\n , egfr_labs.code\n , egfr_labs.result_date\n , egfr_labs.result\n , row_number() over (\n partition by\n egfr_labs.patient_id\n , egfr_labs.data_source\n order by egfr_labs.result desc\n ) as row_num\n from egfr_labs\n inner join lab_lookback\n on egfr_labs.patient_id = lab_lookback.patient_id\n and egfr_labs.data_source = lab_lookback.data_source\n where egfr_labs.result_date >= lab_lookback.lookback_result_date\n\n)\n\n/*\n Assign a patient's kidney disease stage based on the highest eGFR based on\n the following range:\n\n CKD 3a: eGFR in the range (45-59)\n CKD 3b: eGFR in the range (30-44)\n CKD 4: eGFR in the range (15-29)\n CKD 5: eGFR in the range (0-14)\n*/\n, ckd_suspects as (\n\n select\n patient_id\n , data_source\n , code_type\n , code as lab_code\n , result_date\n , result\n , case\n when result between 0 and 14 then '326'\n when result between 15 and 29 then '327'\n when result between 30 and 44 then '328'\n when result between 45 and 59 then '329'\n end as hcc_code\n , 'eGFR ('\n || code\n || ') result '\n || cast(result as TEXT)\n || ' on '\n || result_date\n as contributing_factor\n from eligible_labs\n where row_num = 1\n\n)\n/* END CKD logic */\n\n, unioned as (\n\n select * from ckd_suspects\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.result_date\n , unioned.result\n , unioned.lab_code\n , unioned.hcc_code\n , unioned.contributing_factor\n , seed_hcc_descriptions.hcc_description\n , billed_hccs.current_year_billed\n from unioned\n inner join seed_hcc_descriptions\n on unioned.hcc_code = seed_hcc_descriptions.hcc_code\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , result_date\n , result\n , lab_code\n , hcc_code\n , hcc_description\n , contributing_factor\n , current_year_billed\n , cast('Lab result suspect' as TEXT) as reason\n , result_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(result_date as date) as result_date\n , cast(result as numeric(28,6)) as result\n , cast(lab_code as TEXT) as lab_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , result_date\n , result\n , lab_code\n , hcc_code\n , hcc_description\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_medication_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_medication_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_medication_suspects"], "alias": "_int_medication_suspects", "checksum": {"name": "sha256", "checksum": "da72f5441fa9684f3829633759ccd5dbcd574f6a271a4b04f39c9f659d90b184"}, "config": {"enabled": true, "alias": "_int_medication_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting conditions based on medications.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed or paid date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug_code": {"name": "drug_code", "description": "NDC or rxnorm code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting medication was dispensed or paid.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_medication_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6600928, "relation_name": "dev_thuxuan.hcc_suspecting._int_medication_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , drug_code\r\n , code_system\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_all_medications') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\r\n\r\n antidepressant medication taken within the past five years\r\n*/\r\n, hcc_155_suspect as (\r\n\r\n select\r\n all_medications.patient_id\r\n , all_medications.dispensing_date\r\n , all_medications.drug_code\r\n , all_medications.code_system\r\n , all_medications.data_source\r\n , seed_clinical_concepts.concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from all_medications\r\n inner join seed_clinical_concepts\r\n on all_medications.code_system = seed_clinical_concepts.code_system\r\n and all_medications.drug_code = seed_clinical_concepts.code\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '155'\r\n where lower(seed_clinical_concepts.concept_name) = 'antidepressant medication'\r\n and all_medications.dispensing_date >= {{ dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -5\r\n , from_date_or_timestamp = dbt.current_timestamp()\r\n ) }}\r\n\r\n)\r\n/* END HCC 155 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_155_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.concept_name\r\n , unioned.dispensing_date\r\n , unioned.drug_code\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , dispensing_date\r\n , drug_code\r\n , current_year_billed\r\n , cast('Medication suspect' as {{ dbt.type_string() }}) as reason\r\n , concept_name\r\n || ' ('\r\n || drug_code\r\n || ')'\r\n || ' dispensed on '\r\n || dispensing_date\r\n as contributing_factor\r\n , dispensing_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(dispensing_date as date) as dispensing_date\r\n , cast(drug_code as {{ dbt.type_string() }}) as drug_code\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , dispensing_date\r\n , drug_code\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_all_medications", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_all_medications", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_medication_suspects.sql", "compiled": true, "compiled_code": "\n\nwith all_medications as (\n\n select\n patient_id\n , dispensing_date\n , drug_code\n , code_system\n , data_source\n from dev_thuxuan.hcc_suspecting._int_all_medications\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\n\n antidepressant medication taken within the past five years\n*/\n, hcc_155_suspect as (\n\n select\n all_medications.patient_id\n , all_medications.dispensing_date\n , all_medications.drug_code\n , all_medications.code_system\n , all_medications.data_source\n , seed_clinical_concepts.concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from all_medications\n inner join seed_clinical_concepts\n on all_medications.code_system = seed_clinical_concepts.code_system\n and all_medications.drug_code = seed_clinical_concepts.code\n inner join seed_hcc_descriptions\n on hcc_code = '155'\n where lower(seed_clinical_concepts.concept_name) = 'antidepressant medication'\n and all_medications.dispensing_date >= \n\n dateadd(\n year,\n -5,\n convert_timezone('UTC', current_timestamp())\n )\n\n\n\n)\n/* END HCC 155 logic */\n\n, unioned as (\n\n select * from hcc_155_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.concept_name\n , unioned.dispensing_date\n , unioned.drug_code\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , dispensing_date\n , drug_code\n , current_year_billed\n , cast('Medication suspect' as TEXT) as reason\n , concept_name\n || ' ('\n || drug_code\n || ')'\n || ' dispensed on '\n || dispensing_date\n as contributing_factor\n , dispensing_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(dispensing_date as date) as dispensing_date\n , cast(drug_code as TEXT) as drug_code\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , dispensing_date\n , drug_code\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_observation_suspects": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_observation_suspects", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_observation_suspects"], "alias": "_int_observation_suspects", "checksum": {"name": "sha256", "checksum": "d3a25d5592ec92c9e64cc2f6a935a94fcdccbd1ef4dcb7327bb5f2ee76134bff"}, "config": {"enabled": true, "alias": "_int_observation_suspects", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Suspecting observation conditions.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_result": {"name": "observation_result", "description": "The result of the observation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The code for the comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_date": {"name": "condition_date", "description": "Recorded date for the condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_concept_name": {"name": "condition_concept_name", "description": "Clinical concept name for the comorbid condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting observation was recorded.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_observation_suspects", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6660929, "relation_name": "dev_thuxuan.hcc_suspecting._int_observation_suspects", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__int_prep_conditions') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , result\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__observation') }}\r\n\r\n)\r\n\r\n, numeric_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , cast(result as numeric) as result\r\n , code_type\r\n , code\r\n , data_source\r\n from observations\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }}\r\n\r\n)\r\n\r\n, seed_clinical_concepts as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__hcc_descriptions') }}\r\n\r\n)\r\n\r\n, billed_hccs as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , current_year_billed\r\n from {{ ref('hcc_suspecting__int_patient_hcc_history') }}\r\n\r\n)\r\n\r\n, depression_assessment as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.observation_date\r\n , numeric_observations.result\r\n , numeric_observations.code_type\r\n , numeric_observations.code\r\n , numeric_observations.data_source\r\n , seed_clinical_concepts.concept_name\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'depression assessment (phq-9)'\r\n\r\n)\r\n\r\n, diabetes as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\r\n\r\n)\r\n\r\n, hypertension as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'essential hypertension'\r\n\r\n)\r\n\r\n, obstructive_sleep_apnea as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code_type\r\n , conditions.code\r\n , conditions.data_source\r\n , seed_clinical_concepts.concept_name\r\n from conditions\r\n inner join seed_clinical_concepts\r\n on conditions.code_type = seed_clinical_concepts.code_system\r\n and conditions.code = seed_clinical_concepts.code\r\n where lower(seed_clinical_concepts.concept_name) = 'obstructive sleep apnea'\r\n\r\n)\r\n\r\n/* BEGIN HCC 48 logic (Morbid Obesity) */\r\n, bmi_over_30_with_osa as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , obstructive_sleep_apnea.code as condition_code\r\n , obstructive_sleep_apnea.recorded_date as condition_date\r\n , obstructive_sleep_apnea.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join obstructive_sleep_apnea\r\n on numeric_observations.patient_id = obstructive_sleep_apnea.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from obstructive_sleep_apnea.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 30\r\n\r\n)\r\n\r\n, bmi_over_35_with_diabetes as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , diabetes.code as condition_code\r\n , diabetes.recorded_date as condition_date\r\n , diabetes.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join diabetes\r\n on numeric_observations.patient_id = diabetes.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from diabetes.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 35\r\n\r\n)\r\n\r\n, bmi_over_35_with_hypertension as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , hypertension.code as condition_code\r\n , hypertension.recorded_date as condition_date\r\n , hypertension.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join hypertension\r\n on numeric_observations.patient_id = hypertension.patient_id\r\n /* ensure bmi and condition overlaps in the same year */\r\n and extract(year from numeric_observations.observation_date) = extract(year from hypertension.recorded_date)\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 35\r\n\r\n)\r\n\r\n, bmi_over_40 as (\r\n\r\n select\r\n numeric_observations.patient_id\r\n , numeric_observations.data_source\r\n , numeric_observations.observation_date\r\n , numeric_observations.result as observation_result\r\n , cast(null as {{ dbt.type_string() }}) as condition_code\r\n , cast(null as date) as condition_date\r\n , cast(null as {{ dbt.type_string() }}) as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n from numeric_observations\r\n inner join seed_clinical_concepts\r\n on numeric_observations.code_type = seed_clinical_concepts.code_system\r\n and numeric_observations.code = seed_clinical_concepts.code\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '48'\r\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\r\n and result >= 40\r\n\r\n)\r\n\r\n, hcc_48_unioned as (\r\n\r\n select * from bmi_over_30_with_osa\r\n union all\r\n select * from bmi_over_35_with_diabetes\r\n union all\r\n select * from bmi_over_35_with_hypertension\r\n union all\r\n select * from bmi_over_40\r\n\r\n)\r\n\r\n, hcc_48_suspect as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , 'BMI result '\r\n || cast(observation_result as {{ dbt.type_string() }})\r\n || case\r\n when condition_code is null then ''\r\n else ' with '\r\n || condition_concept_name\r\n || ' ('\r\n || condition_code\r\n || ' on '\r\n || condition_date\r\n || ')'\r\n end\r\n as contributing_factor\r\n from hcc_48_unioned\r\n\r\n)\r\n/* END HCC 48 logic */\r\n\r\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\r\n\r\n to determine a positive PHQ-9 assessment, we look at the past 3 screenings\r\n for a patient and take the highest result\r\n*/\r\n, eligible_depression_assessments as (\r\n\r\n select\r\n depression_assessment.patient_id\r\n , depression_assessment.observation_date\r\n , depression_assessment.result\r\n , depression_assessment.code_type\r\n , depression_assessment.code\r\n , depression_assessment.data_source\r\n , depression_assessment.concept_name\r\n , row_number() over (\r\n partition by\r\n depression_assessment.patient_id\r\n , depression_assessment.data_source\r\n order by depression_assessment.observation_date desc nulls last\r\n ) as assessment_order\r\n from depression_assessment\r\n\r\n)\r\n\r\n, depression_assessments_ordered as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , code_type\r\n , code\r\n , data_source\r\n , concept_name\r\n , result\r\n , row_number() over (\r\n partition by\r\n patient_id\r\n , data_source\r\n order by result desc nulls last\r\n ) as result_order --order the last three assessments by result value\r\n from eligible_depression_assessments\r\n where assessment_order <= 3\r\n\r\n)\r\n\r\n, hcc_155_suspect as (\r\n\r\n select\r\n depression_assessments_ordered.patient_id\r\n , depression_assessments_ordered.data_source\r\n , depression_assessments_ordered.observation_date\r\n , depression_assessments_ordered.result as observation_result\r\n , cast(null as {{ dbt.type_string() }}) as condition_code\r\n , cast(null as date) as condition_date\r\n , depression_assessments_ordered.concept_name as condition_concept_name\r\n , seed_hcc_descriptions.hcc_code\r\n , seed_hcc_descriptions.hcc_description\r\n , 'PHQ-9 result '\r\n || cast(depression_assessments_ordered.result as {{ dbt.type_string() }})\r\n || ' on '\r\n || depression_assessments_ordered.observation_date\r\n as contributing_factor\r\n from depression_assessments_ordered\r\n inner join seed_hcc_descriptions\r\n on hcc_code = '155'\r\n where result_order = 1\r\n and result >= 15\r\n\r\n)\r\n\r\n/* END HCC 155 logic */\r\n\r\n, unioned as (\r\n\r\n select * from hcc_48_suspect\r\n union all\r\n select * from hcc_155_suspect\r\n\r\n)\r\n\r\n, add_billed_flag as (\r\n\r\n select\r\n unioned.patient_id\r\n , unioned.data_source\r\n , unioned.observation_date\r\n , unioned.observation_result\r\n , unioned.condition_code\r\n , unioned.condition_date\r\n , unioned.condition_concept_name\r\n , unioned.hcc_code\r\n , unioned.hcc_description\r\n , unioned.contributing_factor\r\n , billed_hccs.current_year_billed\r\n from unioned\r\n left join billed_hccs\r\n on unioned.patient_id = billed_hccs.patient_id\r\n and unioned.data_source = billed_hccs.data_source\r\n and unioned.hcc_code = billed_hccs.hcc_code\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , contributing_factor\r\n , current_year_billed\r\n , cast('Observation suspect' as {{ dbt.type_string() }}) as reason\r\n , observation_date as suspect_date\r\n from add_billed_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(observation_date as date) as observation_date\r\n , cast(observation_result as {{ dbt.type_string() }}) as observation_result\r\n , cast(condition_code as {{ dbt.type_string() }}) as condition_code\r\n , cast(condition_date as date) as condition_date\r\n , cast(condition_concept_name as {{ dbt.type_string() }}) as condition_concept_name\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , observation_date\r\n , observation_result\r\n , condition_code\r\n , condition_date\r\n , condition_concept_name\r\n , hcc_code\r\n , hcc_description\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_prep_conditions", "package": null, "version": null}, {"name": "hcc_suspecting__stg_core__observation", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}, {"name": "hcc_suspecting__hcc_descriptions", "package": null, "version": null}, {"name": "hcc_suspecting__int_patient_hcc_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.apply_regex", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "model.the_tuva_project.hcc_suspecting__stg_core__observation", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_observation_suspects.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n\n),conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from dev_thuxuan.hcc_suspecting._int_prep_conditions\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , result\n , code_type\n , code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__observation\n\n)\n\n, numeric_observations as (\n\n select\n patient_id\n , observation_date\n , cast(result as numeric) as result\n , code_type\n , code\n , data_source\n from observations\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$')\n\n)\n\n, seed_clinical_concepts as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions\n\n)\n\n, billed_hccs as (\n\n select distinct\n patient_id\n , data_source\n , hcc_code\n , current_year_billed\n from dev_thuxuan.hcc_suspecting._int_patient_hcc_history\n\n)\n\n, depression_assessment as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.observation_date\n , numeric_observations.result\n , numeric_observations.code_type\n , numeric_observations.code\n , numeric_observations.data_source\n , seed_clinical_concepts.concept_name\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'depression assessment (phq-9)'\n\n)\n\n, diabetes as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'diabetes'\n\n)\n\n, hypertension as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'essential hypertension'\n\n)\n\n, obstructive_sleep_apnea as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code_type\n , conditions.code\n , conditions.data_source\n , seed_clinical_concepts.concept_name\n from conditions\n inner join seed_clinical_concepts\n on conditions.code_type = seed_clinical_concepts.code_system\n and conditions.code = seed_clinical_concepts.code\n where lower(seed_clinical_concepts.concept_name) = 'obstructive sleep apnea'\n\n)\n\n/* BEGIN HCC 48 logic (Morbid Obesity) */\n, bmi_over_30_with_osa as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , obstructive_sleep_apnea.code as condition_code\n , obstructive_sleep_apnea.recorded_date as condition_date\n , obstructive_sleep_apnea.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join obstructive_sleep_apnea\n on numeric_observations.patient_id = obstructive_sleep_apnea.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from obstructive_sleep_apnea.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 30\n\n)\n\n, bmi_over_35_with_diabetes as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , diabetes.code as condition_code\n , diabetes.recorded_date as condition_date\n , diabetes.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join diabetes\n on numeric_observations.patient_id = diabetes.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from diabetes.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 35\n\n)\n\n, bmi_over_35_with_hypertension as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , hypertension.code as condition_code\n , hypertension.recorded_date as condition_date\n , hypertension.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join hypertension\n on numeric_observations.patient_id = hypertension.patient_id\n /* ensure bmi and condition overlaps in the same year */\n and extract(year from numeric_observations.observation_date) = extract(year from hypertension.recorded_date)\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 35\n\n)\n\n, bmi_over_40 as (\n\n select\n numeric_observations.patient_id\n , numeric_observations.data_source\n , numeric_observations.observation_date\n , numeric_observations.result as observation_result\n , cast(null as TEXT) as condition_code\n , cast(null as date) as condition_date\n , cast(null as TEXT) as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n from numeric_observations\n inner join seed_clinical_concepts\n on numeric_observations.code_type = seed_clinical_concepts.code_system\n and numeric_observations.code = seed_clinical_concepts.code\n inner join seed_hcc_descriptions\n on hcc_code = '48'\n where lower(seed_clinical_concepts.concept_name) = 'bmi'\n and result >= 40\n\n)\n\n, hcc_48_unioned as (\n\n select * from bmi_over_30_with_osa\n union all\n select * from bmi_over_35_with_diabetes\n union all\n select * from bmi_over_35_with_hypertension\n union all\n select * from bmi_over_40\n\n)\n\n, hcc_48_suspect as (\n\n select\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , 'BMI result '\n || cast(observation_result as TEXT)\n || case\n when condition_code is null then ''\n else ' with '\n || condition_concept_name\n || ' ('\n || condition_code\n || ' on '\n || condition_date\n || ')'\n end\n as contributing_factor\n from hcc_48_unioned\n\n)\n/* END HCC 48 logic */\n\n/* BEGIN HCC 155 logic (Major Depression, Moderate or Severe, without Psychosis)\n\n to determine a positive PHQ-9 assessment, we look at the past 3 screenings\n for a patient and take the highest result\n*/\n, eligible_depression_assessments as (\n\n select\n depression_assessment.patient_id\n , depression_assessment.observation_date\n , depression_assessment.result\n , depression_assessment.code_type\n , depression_assessment.code\n , depression_assessment.data_source\n , depression_assessment.concept_name\n , row_number() over (\n partition by\n depression_assessment.patient_id\n , depression_assessment.data_source\n order by depression_assessment.observation_date desc nulls last\n ) as assessment_order\n from depression_assessment\n\n)\n\n, depression_assessments_ordered as (\n\n select\n patient_id\n , observation_date\n , code_type\n , code\n , data_source\n , concept_name\n , result\n , row_number() over (\n partition by\n patient_id\n , data_source\n order by result desc nulls last\n ) as result_order --order the last three assessments by result value\n from eligible_depression_assessments\n where assessment_order <= 3\n\n)\n\n, hcc_155_suspect as (\n\n select\n depression_assessments_ordered.patient_id\n , depression_assessments_ordered.data_source\n , depression_assessments_ordered.observation_date\n , depression_assessments_ordered.result as observation_result\n , cast(null as TEXT) as condition_code\n , cast(null as date) as condition_date\n , depression_assessments_ordered.concept_name as condition_concept_name\n , seed_hcc_descriptions.hcc_code\n , seed_hcc_descriptions.hcc_description\n , 'PHQ-9 result '\n || cast(depression_assessments_ordered.result as TEXT)\n || ' on '\n || depression_assessments_ordered.observation_date\n as contributing_factor\n from depression_assessments_ordered\n inner join seed_hcc_descriptions\n on hcc_code = '155'\n where result_order = 1\n and result >= 15\n\n)\n\n/* END HCC 155 logic */\n\n, unioned as (\n\n select * from hcc_48_suspect\n union all\n select * from hcc_155_suspect\n\n)\n\n, add_billed_flag as (\n\n select\n unioned.patient_id\n , unioned.data_source\n , unioned.observation_date\n , unioned.observation_result\n , unioned.condition_code\n , unioned.condition_date\n , unioned.condition_concept_name\n , unioned.hcc_code\n , unioned.hcc_description\n , unioned.contributing_factor\n , billed_hccs.current_year_billed\n from unioned\n left join billed_hccs\n on unioned.patient_id = billed_hccs.patient_id\n and unioned.data_source = billed_hccs.data_source\n and unioned.hcc_code = billed_hccs.hcc_code\n\n)\n\n, add_standard_fields as (\n\n select\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , contributing_factor\n , current_year_billed\n , cast('Observation suspect' as TEXT) as reason\n , observation_date as suspect_date\n from add_billed_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(observation_date as date) as observation_date\n , cast(observation_result as TEXT) as observation_result\n , cast(condition_code as TEXT) as condition_code\n , cast(condition_date as date) as condition_date\n , cast(condition_concept_name as TEXT) as condition_concept_name\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , observation_date\n , observation_result\n , condition_code\n , condition_date\n , condition_concept_name\n , hcc_code\n , hcc_description\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__observation", "sql": " __dbt__cte__hcc_suspecting__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_patient_hcc_history", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_patient_hcc_history"], "alias": "_int_patient_hcc_history", "checksum": {"name": "sha256", "checksum": "f4ec22767e68112d095fba9659e7887bed20e220f30878556c94c9641bb86849"}, "config": {"enabled": true, "alias": "_int_patient_hcc_history", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "This intermediate model displays the full history of a patient's recorded HCCs with a flag for recorded during the current year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the ICD-10-CM condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__icd_10_cm_mappings.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/tuva/blob/main/seeds/value_sets/hcc_suspecting/hcc_suspecting__hcc_descriptions.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "first_recorded": {"name": "first_recorded", "description": "Date the HCC was first recorded in the patient's record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_recorded": {"name": "last_recorded", "description": "Date the HCC was last recorded in the patient's record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "last_billed": {"name": "last_billed", "description": "Date the HCC was last billed in the patient's record (where condition_type <> 'problem').\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "current_year_billed": {"name": "current_year_billed", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC has been billed during the payment year.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Standardized reason for the suspecting condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contributing_factor": {"name": "contributing_factor", "description": "Description of the contributing factor(s) for the suspecting condition.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "suspect_date": {"name": "suspect_date", "description": "Date when the suspecting condition was recorded or billed.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_patient_hcc_history", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6736836, "relation_name": "dev_thuxuan.hcc_suspecting._int_patient_hcc_history", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith all_conditions as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n from {{ ref('hcc_suspecting__int_all_conditions') }}\r\n where hcc_code is not null\r\n\r\n)\r\n\r\n, hcc_grouped as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , min(recorded_date) as first_recorded\r\n , max(recorded_date) as last_recorded\r\n from all_conditions\r\n where hcc_code is not null\r\n group by\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n\r\n)\r\n\r\n, hcc_billed as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , hcc_code\r\n , hcc_description\r\n , max(recorded_date) as last_billed\r\n from all_conditions\r\n where hcc_code is not null\r\n and lower(condition_type) <> 'problem'\r\n group by\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , data_source\r\n\r\n)\r\n\r\n, add_flag as (\r\n\r\n select\r\n hcc_grouped.patient_id\r\n , hcc_grouped.data_source\r\n , hcc_grouped.hcc_code\r\n , hcc_grouped.hcc_description\r\n , hcc_grouped.first_recorded\r\n , hcc_grouped.last_recorded\r\n , hcc_billed.last_billed\r\n , case\r\n when extract(year from hcc_billed.last_billed) = extract(year from {{ dbt.current_timestamp() }} )\r\n then 1\r\n else 0\r\n end as current_year_billed\r\n from hcc_grouped\r\n left join hcc_billed\r\n on hcc_grouped.patient_id = hcc_billed.patient_id\r\n and hcc_grouped.hcc_code = hcc_billed.hcc_code\r\n and hcc_grouped.data_source = hcc_billed.data_source\r\n\r\n)\r\n\r\n, all_conditions_with_flag as (\r\n\r\n select distinct\r\n all_conditions.patient_id\r\n , all_conditions.data_source\r\n , all_conditions.recorded_date\r\n , all_conditions.condition_type\r\n , all_conditions.icd_10_cm_code\r\n , all_conditions.hcc_code\r\n , all_conditions.hcc_description\r\n , add_flag.first_recorded\r\n , add_flag.last_recorded\r\n , add_flag.last_billed\r\n , add_flag.current_year_billed\r\n , cast('Prior coding history' as {{ dbt.type_string() }}) as reason\r\n , icd_10_cm_code\r\n || case\r\n when last_billed is not null then ' last billed on ' || last_billed\r\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\r\n else ' (missing recorded and billing dates) '\r\n end as contributing_factor\r\n , coalesce(last_billed, last_recorded) as condition_date\r\n from all_conditions\r\n left join add_flag\r\n on all_conditions.patient_id = add_flag.patient_id\r\n and all_conditions.hcc_code = add_flag.hcc_code\r\n and all_conditions.data_source = add_flag.data_source\r\n\r\n)\r\n\r\n, add_standard_fields as (\r\n\r\n select distinct\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , last_billed\r\n , current_year_billed\r\n , 'Prior coding history' as reason\r\n , icd_10_cm_code\r\n || case\r\n when last_billed is not null then ' last billed on ' || last_billed\r\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\r\n else ' (missing recorded and billing dates) '\r\n end as contributing_factor\r\n , coalesce(last_billed, last_recorded) as suspect_date\r\n from all_conditions_with_flag\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(icd_10_cm_code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(first_recorded as date) as first_recorded\r\n , cast(last_recorded as date) as last_recorded\r\n , cast(last_billed as date) as last_billed\r\n , cast(current_year_billed as boolean) as current_year_billed\r\n , cast(reason as {{ dbt.type_string() }}) as reason\r\n , cast(contributing_factor as {{ dbt.type_string() }}) as contributing_factor\r\n , cast(suspect_date as date) as suspect_date\r\n from add_standard_fields\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , last_billed\r\n , current_year_billed\r\n , reason\r\n , contributing_factor\r\n , suspect_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__int_all_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_patient_hcc_history.sql", "compiled": true, "compiled_code": "\n\nwith all_conditions as (\n\n select\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n from dev_thuxuan.hcc_suspecting._int_all_conditions\n where hcc_code is not null\n\n)\n\n, hcc_grouped as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , min(recorded_date) as first_recorded\n , max(recorded_date) as last_recorded\n from all_conditions\n where hcc_code is not null\n group by\n patient_id\n , hcc_code\n , hcc_description\n , data_source\n\n)\n\n, hcc_billed as (\n\n select\n patient_id\n , data_source\n , hcc_code\n , hcc_description\n , max(recorded_date) as last_billed\n from all_conditions\n where hcc_code is not null\n and lower(condition_type) <> 'problem'\n group by\n patient_id\n , hcc_code\n , hcc_description\n , data_source\n\n)\n\n, add_flag as (\n\n select\n hcc_grouped.patient_id\n , hcc_grouped.data_source\n , hcc_grouped.hcc_code\n , hcc_grouped.hcc_description\n , hcc_grouped.first_recorded\n , hcc_grouped.last_recorded\n , hcc_billed.last_billed\n , case\n when extract(year from hcc_billed.last_billed) = extract(year from convert_timezone('UTC', current_timestamp()) )\n then 1\n else 0\n end as current_year_billed\n from hcc_grouped\n left join hcc_billed\n on hcc_grouped.patient_id = hcc_billed.patient_id\n and hcc_grouped.hcc_code = hcc_billed.hcc_code\n and hcc_grouped.data_source = hcc_billed.data_source\n\n)\n\n, all_conditions_with_flag as (\n\n select distinct\n all_conditions.patient_id\n , all_conditions.data_source\n , all_conditions.recorded_date\n , all_conditions.condition_type\n , all_conditions.icd_10_cm_code\n , all_conditions.hcc_code\n , all_conditions.hcc_description\n , add_flag.first_recorded\n , add_flag.last_recorded\n , add_flag.last_billed\n , add_flag.current_year_billed\n , cast('Prior coding history' as TEXT) as reason\n , icd_10_cm_code\n || case\n when last_billed is not null then ' last billed on ' || last_billed\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\n else ' (missing recorded and billing dates) '\n end as contributing_factor\n , coalesce(last_billed, last_recorded) as condition_date\n from all_conditions\n left join add_flag\n on all_conditions.patient_id = add_flag.patient_id\n and all_conditions.hcc_code = add_flag.hcc_code\n and all_conditions.data_source = add_flag.data_source\n\n)\n\n, add_standard_fields as (\n\n select distinct\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , last_billed\n , current_year_billed\n , 'Prior coding history' as reason\n , icd_10_cm_code\n || case\n when last_billed is not null then ' last billed on ' || last_billed\n when last_billed is null and last_recorded is not null then ' last recorded on ' || last_recorded\n else ' (missing recorded and billing dates) '\n end as contributing_factor\n , coalesce(last_billed, last_recorded) as suspect_date\n from all_conditions_with_flag\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(icd_10_cm_code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(first_recorded as date) as first_recorded\n , cast(last_recorded as date) as last_recorded\n , cast(last_billed as date) as last_billed\n , cast(current_year_billed as boolean) as current_year_billed\n , cast(reason as TEXT) as reason\n , cast(contributing_factor as TEXT) as contributing_factor\n , cast(suspect_date as date) as suspect_date\n from add_standard_fields\n\n)\n\nselect\n patient_id\n , data_source\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , last_billed\n , current_year_billed\n , reason\n , contributing_factor\n , suspect_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_prep_conditions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_prep_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_prep_conditions"], "alias": "_int_prep_conditions", "checksum": {"name": "sha256", "checksum": "1e62f38c7c47c6b0de539861d3cd81d18120cc672f9b441bee2b0bf819a4c47e"}, "config": {"enabled": true, "alias": "_int_prep_conditions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Preparing conditions; mapping snomed-ct conditions to icd-10-cm.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_prep_conditions", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6796854, "relation_name": "dev_thuxuan.hcc_suspecting._int_prep_conditions", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from {{ ref('hcc_suspecting__stg_core__condition') }}\r\n\r\n)\r\n\r\n/*\r\n Default mapping guidance: Most map groups terminate with an unconditional\r\n rule \u2013 a rule whose predicate is \u201cTRUE\u201d or, equivalently, \u201cOTHERWISE TRUE\u201d.\r\n This rule is considered a \u201cdefault\u201d because it should be applied if\r\n nothing further is known about the patient\u2019s condition.\r\n*/\r\n, seed_snomed_icd_10_map as (\r\n\r\n select\r\n referenced_component_id as snomed_code\r\n , map_target as icd_10_code\r\n from {{ ref('terminology__snomed_icd_10_map') }}\r\n where lower(map_rule) in ('true', 'otherwise true')\r\n and map_group = '1'\r\n\r\n)\r\n\r\n, snomed_conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , 'icd-10-cm' as code_type\r\n , icd_10_code as code\r\n , data_source\r\n from conditions\r\n inner join seed_snomed_icd_10_map\r\n on conditions.code = seed_snomed_icd_10_map.snomed_code\r\n where conditions.code_type = 'snomed-ct'\r\n\r\n)\r\n\r\n, other_conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n from conditions\r\n where conditions.code_type <> 'snomed-ct'\r\n\r\n)\r\n\r\n, union_conditions as (\r\n\r\n select * from snomed_conditions\r\n union all\r\n select * from other_conditions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(code as {{ dbt.type_string() }}) as code\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n from union_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__condition", "package": null, "version": null}, {"name": "terminology__snomed_icd_10_map", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__condition", "seed.the_tuva_project.terminology__snomed_icd_10_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_conditions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition\n),conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from __dbt__cte__hcc_suspecting__stg_core__condition\n\n)\n\n/*\n Default mapping guidance: Most map groups terminate with an unconditional\n rule \u2013 a rule whose predicate is \u201cTRUE\u201d or, equivalently, \u201cOTHERWISE TRUE\u201d.\n This rule is considered a \u201cdefault\u201d because it should be applied if\n nothing further is known about the patient\u2019s condition.\n*/\n, seed_snomed_icd_10_map as (\n\n select\n referenced_component_id as snomed_code\n , map_target as icd_10_code\n from dev_thuxuan.terminology.snomed_icd_10_map\n where lower(map_rule) in ('true', 'otherwise true')\n and map_group = '1'\n\n)\n\n, snomed_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , 'icd-10-cm' as code_type\n , icd_10_code as code\n , data_source\n from conditions\n inner join seed_snomed_icd_10_map\n on conditions.code = seed_snomed_icd_10_map.snomed_code\n where conditions.code_type = 'snomed-ct'\n\n)\n\n, other_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n from conditions\n where conditions.code_type <> 'snomed-ct'\n\n)\n\n, union_conditions as (\n\n select * from snomed_conditions\n union all\n select * from other_conditions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(code_type as TEXT) as code_type\n , cast(code as TEXT) as code\n , cast(data_source as TEXT) as data_source\n from union_conditions\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n , data_source\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__condition", "sql": " __dbt__cte__hcc_suspecting__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__int_prep_egfr_labs", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "original_file_path": "models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "fqn": ["the_tuva_project", "hcc_suspecting", "intermediate", "hcc_suspecting__int_prep_egfr_labs"], "alias": "_int_prep_egfr_labs", "checksum": {"name": "sha256", "checksum": "7cc3aff1cef825a5ea34ae89c1dc8f2b16adcd7c52560a0718407bfbaea6fea8"}, "config": {"enabled": true, "alias": "_int_prep_egfr_labs", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Preparing eGFR labs with clean numeric results.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The normalized code type or source code type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized code or source code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "Cleaned numeric result of the lab test.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_int_prep_egfr_labs", "tags": "hcc_suspecting", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6882093, "relation_name": "dev_thuxuan.hcc_suspecting._int_prep_egfr_labs", "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith lab_result as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , status\r\n , result\r\n , result_date\r\n from {{ ref('hcc_suspecting__stg_core__lab_result') }}\r\n\r\n)\r\n\r\n, seed_egfr_codes as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('hcc_suspecting__clinical_concepts') }}\r\n where lower(concept_name) = 'estimated glomerular filtration rate'\r\n\r\n)\r\n\r\n, egfr_labs as (\r\n\r\n select distinct\r\n lab_result.patient_id\r\n , lab_result.data_source\r\n , lab_result.code_type\r\n , lab_result.code\r\n , lab_result.result_date\r\n , lab_result.result\r\n from lab_result\r\n inner join seed_egfr_codes\r\n on lab_result.code = seed_egfr_codes.code\r\n and lab_result.code_type = seed_egfr_codes.code_system\r\n where lab_result.result is not null\r\n and lower(lab_result.status) not in ('cancelled', 'entered-in-error')\r\n\r\n)\r\n\r\n, numeric_egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n from egfr_labs\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }}\r\n\r\n)\r\n\r\n, clean_non_numeric_egfr_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n , cast(case\r\n when lower(result) like '%unsatisfactory specimen%' then null\r\n when result like '%>%' then null\r\n when result like '%<%' then null\r\n when result like '%@%' then trim(replace(result,'@',''))\r\n when result like '%mL/min/1.73m2%' then trim(replace(result,'mL/min/1.73m2',''))\r\n else null\r\n end as {{ dbt.type_numeric() }}) as clean_result\r\n from egfr_labs\r\n where {{ apply_regex('result', '^[+-]?([0-9]*[.])?[0-9]+$') }} = False\r\n\r\n)\r\n\r\n, unioned_labs as (\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n from numeric_egfr_labs\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , clean_result as result\r\n from clean_non_numeric_egfr_labs\r\n where clean_result is not null\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast(code_type as {{ dbt.type_string() }}) as code_type\r\n , cast(code as {{ dbt.type_string() }}) as code\r\n , cast(result_date as date) as result_date\r\n , cast(result as {{ dbt.type_numeric() }}) as result\r\n from unioned_labs\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , data_source\r\n , code_type\r\n , code\r\n , result_date\r\n , result\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "hcc_suspecting__stg_core__lab_result", "package": null, "version": null}, {"name": "hcc_suspecting__clinical_concepts", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.the_tuva_project.apply_regex", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "seed.the_tuva_project.hcc_suspecting__clinical_concepts"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\intermediate\\hcc_suspecting__int_prep_egfr_labs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__hcc_suspecting__stg_core__lab_result as (\n\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n\n),lab_result as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , status\n , result\n , result_date\n from __dbt__cte__hcc_suspecting__stg_core__lab_result\n\n)\n\n, seed_egfr_codes as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.hcc_suspecting._value_set_clinical_concepts\n where lower(concept_name) = 'estimated glomerular filtration rate'\n\n)\n\n, egfr_labs as (\n\n select distinct\n lab_result.patient_id\n , lab_result.data_source\n , lab_result.code_type\n , lab_result.code\n , lab_result.result_date\n , lab_result.result\n from lab_result\n inner join seed_egfr_codes\n on lab_result.code = seed_egfr_codes.code\n and lab_result.code_type = seed_egfr_codes.code_system\n where lab_result.result is not null\n and lower(lab_result.status) not in ('cancelled', 'entered-in-error')\n\n)\n\n, numeric_egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , cast(result as numeric(28,6)) as result\n from egfr_labs\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$')\n\n)\n\n, clean_non_numeric_egfr_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n , cast(case\n when lower(result) like '%unsatisfactory specimen%' then null\n when result like '%>%' then null\n when result like '%<%' then null\n when result like '%@%' then trim(replace(result,'@',''))\n when result like '%mL/min/1.73m2%' then trim(replace(result,'mL/min/1.73m2',''))\n else null\n end as numeric(28,6)) as clean_result\n from egfr_labs\n where regexp_like(result, '^[+-]?([0-9]*[.])?[0-9]+$') = False\n\n)\n\n, unioned_labs as (\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n from numeric_egfr_labs\n\n union all\n\n select\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , clean_result as result\n from clean_non_numeric_egfr_labs\n where clean_result is not null\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(data_source as TEXT) as data_source\n , cast(code_type as TEXT) as code_type\n , cast(code as TEXT) as code\n , cast(result_date as date) as result_date\n , cast(result as numeric(28,6)) as result\n from unioned_labs\n\n)\n\nselect\n patient_id\n , data_source\n , code_type\n , code\n , result_date\n , result\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "sql": " __dbt__cte__hcc_suspecting__stg_core__lab_result as (\n\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__condition": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__condition", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "745c9b9ac8c84d1567536d8b9004b6158df4abeeb8f8d9e6ae2e8f7c02c7879e"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_condition", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.6942103, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , condition_type\r\n , lower(normalized_code_type) as code_type\r\n , normalized_code as code\r\n , data_source\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , lower(normalized_code_type) as code_type\n , normalized_code as code\n , data_source\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__lab_result"], "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "331fad9316618c8110b28f7cf90d49c3265eae9ad92d9c11ffd350095e11cfb7"}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging conditions from core.", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_lab_result", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.699214, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n lab_result_id\r\n , patient_id\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , status\r\n , result\r\n , result_date\r\n , data_source\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n lab_result_id\r\n , patient_id\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , status\r\n , result\r\n , result_date\r\n , data_source\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as code_type\r\n , cast(null as {{ dbt.type_string() }} ) as code\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n lab_result_id\n , patient_id\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , status\n , result\n , result_date\n , data_source\nfrom dev_thuxuan.core.lab_result\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__medication": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__medication", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__medication"], "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "05e79760b6c6bdba890466e9d41602ef19bda525ddee108b675bbcceac1738c1"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging medications from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_medication", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7047348, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n , data_source\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__medication.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n , data_source\nfrom dev_thuxuan.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__observation": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__observation", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__observation"], "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "713a9f995052ee452003d08059d64c1c42cb8998b33b9b2f2442e022f2e5ba2f"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging observations from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "code": {"name": "code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_observation", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7097464, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , result\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , data_source\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , result\r\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\r\n , coalesce(normalized_code,source_code) as code\r\n , data_source\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as code_type\r\n , cast(null as {{ dbt.type_string() }} ) as code\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , observation_date\n , result\n , lower(coalesce(normalized_code_type,source_code_type)) as code_type\n , coalesce(normalized_code,source_code) as code\n , data_source\nfrom dev_thuxuan.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__patient": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__patient", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "751bf83a7239d99b66b7156431ae7a9593c9c6fa536a6231f5f8c1d3e825d692"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging patients from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_patient", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7137449, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__stg_core__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "original_file_path": "models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "fqn": ["the_tuva_project", "hcc_suspecting", "staging", "hcc_suspecting__stg_core__pharmacy_claim"], "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "5bdb60655574ed35470ffedb608f408a7275efa5e7044d6471825e5dadf3b9c7"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Staging pharmacy claims from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\hcc_suspecting\\hcc_suspecting_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "hcc_suspecting", "alias": "_stg_pharmacy_claim", "tags": "hcc_suspecting", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7192566, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('hcc_suspecting_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , data_source\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , data_source\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\hcc_suspecting\\staging\\hcc_suspecting__stg_core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , data_source\nfrom dev_thuxuan.core.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_claim_type"], "alias": "count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "c01e48572ea6f3654f67289cdc65c27a267af5daeac27f7a04004252222fad62"}, "config": {"enabled": true, "alias": "count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by claim type.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.724255, "relation_name": "dev_thuxuan.insights.count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nselect \r\n claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\nunion all\r\nselect \r\n 'pharmacy'\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\n\nselect \n claim_type\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by claim_type\nunion all\nselect \n 'pharmacy'\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_date_column": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_date_column", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_date_column.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_date_column.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_date_column"], "alias": "count_claim_by_date_column", "checksum": {"name": "sha256", "checksum": "aaacd6758dd9d1e44444a80e2e0852d4b13bcf8b0fd630e983ee730292d86eb2"}, "config": {"enabled": true, "alias": "count_claim_by_date_column", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by multiple dates.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_date_column", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7318418, "relation_name": "dev_thuxuan.insights.count_claim_by_date_column", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith date_stage as(\r\n\r\n select\r\n 'claim_start_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_start_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_start_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'claim_end_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n union all\r\n\r\n select\r\n 'admission_date' as date_field\r\n , cast({{ date_part(\"year\", \"admission_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"admission_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'discharge_date' as date_field\r\n , cast({{ date_part(\"year\", \"discharge_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"discharge_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'medical paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'dispensing_date' as date_field\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'pharmacy paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all \r\n\r\n select\r\n 'member_months' as date_field\r\n , year_month\r\n , count(*) as distinct_count\r\n from {{ ref('financial_pmpm__member_months') }}\r\n group by\r\n year_month\r\n)\r\n\r\n\r\n, all_date_range as (\r\n select distinct \r\n replace(cal.year_month,'-','') as year_month\r\n from {{ ref('terminology__calendar') }} cal\r\n where (cal.year_month >= (select min(year_month) from date_stage)\r\n and cal.year_month <= (select max(year_month) from date_stage))\r\n \r\n)\r\n\r\nselect\r\n cast(all_date.year_month as {{ dbt.type_int() }} ) as year_month\r\n , member_months.distinct_count as member_months\r\n , claim_start.distinct_count as claim_start_date\r\n , claim_end.distinct_count as claim_end_date\r\n , admission_date.distinct_count as admission_date\r\n , discharge_date.distinct_count as discharge_date\r\n , med_paid_date.distinct_count as medical_paid_date\r\n , dispensing_date.distinct_count as dispensing_date\r\n , pharm_paid_date.distinct_count as pharmacy_paid_date\r\nfrom all_date_range all_date\r\nleft join date_stage member_months\r\n on all_date.year_month = member_months.year_month\r\n and member_months.date_field = 'member_months'\r\nleft join date_stage claim_start\r\n on all_date.year_month = claim_start.year_month\r\n and claim_start.date_field = 'claim_start_date'\r\nleft join date_stage claim_end\r\n on all_date.year_month = claim_end.year_month\r\n and claim_end.date_field = 'claim_end_date'\r\nleft join date_stage admission_date\r\n on all_date.year_month = admission_date.year_month\r\n and admission_date.date_field = 'admission_date'\r\nleft join date_stage discharge_date\r\n on all_date.year_month = discharge_date.year_month\r\n and discharge_date.date_field = 'discharge_date'\r\nleft join date_stage med_paid_date\r\n on all_date.year_month = med_paid_date.year_month\r\n and med_paid_date.date_field = 'medical paid_date'\r\nleft join date_stage dispensing_date\r\n on all_date.year_month = dispensing_date.year_month\r\n and dispensing_date.date_field = 'dispensing_date'\r\nleft join date_stage pharm_paid_date\r\n on all_date.year_month = pharm_paid_date.year_month\r\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "terminology__calendar", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.type_int"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_date_column.sql", "compiled": true, "compiled_code": "\n\nwith date_stage as(\n\n select\n 'claim_start_date' as date_field\n , cast(date_part('year', claim_start_date) as TEXT) || right('0'||cast(date_part('month', claim_start_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'claim_end_date' as date_field\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n union all\n\n select\n 'admission_date' as date_field\n , cast(date_part('year', admission_date) as TEXT) || right('0'||cast(date_part('month', admission_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'discharge_date' as date_field\n , cast(date_part('year', discharge_date) as TEXT) || right('0'||cast(date_part('month', discharge_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'medical paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'dispensing_date' as date_field\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n\n union all\n\n select\n 'pharmacy paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n\n union all \n\n select\n 'member_months' as date_field\n , year_month\n , count(*) as distinct_count\n from dev_thuxuan.financial_pmpm.member_months\n group by\n year_month\n)\n\n\n, all_date_range as (\n select distinct \n replace(cal.year_month,'-','') as year_month\n from dev_thuxuan.terminology.calendar cal\n where (cal.year_month >= (select min(year_month) from date_stage)\n and cal.year_month <= (select max(year_month) from date_stage))\n \n)\n\nselect\n cast(all_date.year_month as INT ) as year_month\n , member_months.distinct_count as member_months\n , claim_start.distinct_count as claim_start_date\n , claim_end.distinct_count as claim_end_date\n , admission_date.distinct_count as admission_date\n , discharge_date.distinct_count as discharge_date\n , med_paid_date.distinct_count as medical_paid_date\n , dispensing_date.distinct_count as dispensing_date\n , pharm_paid_date.distinct_count as pharmacy_paid_date\nfrom all_date_range all_date\nleft join date_stage member_months\n on all_date.year_month = member_months.year_month\n and member_months.date_field = 'member_months'\nleft join date_stage claim_start\n on all_date.year_month = claim_start.year_month\n and claim_start.date_field = 'claim_start_date'\nleft join date_stage claim_end\n on all_date.year_month = claim_end.year_month\n and claim_end.date_field = 'claim_end_date'\nleft join date_stage admission_date\n on all_date.year_month = admission_date.year_month\n and admission_date.date_field = 'admission_date'\nleft join date_stage discharge_date\n on all_date.year_month = discharge_date.year_month\n and discharge_date.date_field = 'discharge_date'\nleft join date_stage med_paid_date\n on all_date.year_month = med_paid_date.year_month\n and med_paid_date.date_field = 'medical paid_date'\nleft join date_stage dispensing_date\n on all_date.year_month = dispensing_date.year_month\n and dispensing_date.date_field = 'dispensing_date'\nleft join date_stage pharm_paid_date\n on all_date.year_month = pharm_paid_date.year_month\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__count_claim_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_service_category"], "alias": "count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "124b0ce56f0f8f67c32cae100a47e34ea7478bd60ba54b000c0da458314a9c54"}, "config": {"enabled": true, "alias": "count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by service category.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7364647, "relation_name": "dev_thuxuan.insights.count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect \r\n 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect \n 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect \n 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__orphan_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__orphan_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__orphan_claim_by_claim_type"], "alias": "orphan_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "85e2bf37a4ec730b078660ae5eec830c406e4280f5b8c2246ab0ae1aca2312c7"}, "config": {"enabled": true, "alias": "orphan_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of medical and pharmacy claims without a corresponding eligibilty record.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "orphan_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7403815, "relation_name": "dev_thuxuan.insights.orphan_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith medical_claim_orphan as(\r\nselect\r\n 'medical_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__medical_claim') }}\r\n)\r\n\r\n, pharmacy_claim_orphan as(\r\nselect\r\n 'pharmacy_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n)\r\n, union_orphans as(\r\n select \r\n med.* \r\n from medical_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n\r\n union all\r\n\r\n select \r\n med.* \r\n from pharmacy_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n)\r\n\r\nselect\r\n claim_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom union_orphans\r\ngroup by claim_category", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}, {"name": "financial_pmpm__member_months", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim_orphan as(\nselect\n 'medical_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\nfrom dev_thuxuan.core.medical_claim\n)\n\n, pharmacy_claim_orphan as(\nselect\n 'pharmacy_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\nfrom dev_thuxuan.core.pharmacy_claim\n)\n, union_orphans as(\n select \n med.* \n from medical_claim_orphan med\n left join dev_thuxuan.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n\n union all\n\n select \n med.* \n from pharmacy_claim_orphan med\n left join dev_thuxuan.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n)\n\nselect\n claim_category\n , count(distinct claim_id) as distinct_claim_count\nfrom union_orphans\ngroup by claim_category", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_claim_type"], "alias": "sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "732a164bcfdc86d47816a8a0ee706f34376b8a7b1798b89c9ec919da22523fd9"}, "config": {"enabled": true, "alias": "sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7453644, "relation_name": "dev_thuxuan.insights.sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect \r\n claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\n\r\nunion all\r\n\r\nselect \r\n 'pharmacy'\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , null as total_charge_amount\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by claim_type\n\nunion all\n\nselect \n 'pharmacy'\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , null as total_charge_amount\nfrom dev_thuxuan.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_service_category"], "alias": "sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "7aabf9570eb13c0960d1a6b2722813a6b057b9c4a6dd6e15d4bc46a8f362a504"}, "config": {"enabled": true, "alias": "sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7493627, "relation_name": "dev_thuxuan.insights.sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nselect\r\n 'service_category_1' as service_category_type\r\n , service_category_1\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect\r\n 'service_category_2' as service_category_type\r\n , service_category_2\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect\n 'service_category_1' as service_category_type\n , service_category_1\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect\n 'service_category_2' as service_category_type\n , service_category_2\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom dev_thuxuan.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_claim_type"], "alias": "trend_count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "c5ee3e86f2b7e68b0e472ec3aaf41a7cc6005fc95b6aafd77680354259a33d77"}, "config": {"enabled": true, "alias": "trend_count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7548773, "relation_name": "dev_thuxuan.insights.trend_count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_with_previous_count as(\r\n select \r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\r\n from trend_by_claim_type\r\n)\r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom trend_with_previous_count", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_with_previous_count as(\n select \n year_month\n , claim_type\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\n from trend_by_claim_type\n)\n\nselect\n year_month\n , claim_type\n , distinct_claim_count\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom trend_with_previous_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_service_category"], "alias": "trend_count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "d4e0c3634f4c7e270c36b9a310ff5d1c5fe4f134f7bd4844ffa7a46a91e7eb6c"}, "config": {"enabled": true, "alias": "trend_count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7598774, "relation_name": "dev_thuxuan.insights.trend_count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_service_category_1 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_1\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_2\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, previous_service_category_1_claim_count as(\r\n select\r\n year_month\r\n , service_category_1\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_1\r\n)\r\n, previous_service_category_2_claim_count as(\r\n select\r\n year_month\r\n , service_category_2\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_2\r\n)\r\nselect \r\n year_month\r\n , service_category_1 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_1_claim_count\r\n\r\n union all\r\n\r\n select \r\n year_month\r\n , service_category_2 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_2_claim_count", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_service_category_1 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_1\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_2\n , count(distinct claim_id) as distinct_claim_count\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, previous_service_category_1_claim_count as(\n select\n year_month\n , service_category_1\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_1\n)\n, previous_service_category_2_claim_count as(\n select\n year_month\n , service_category_2\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_2\n)\nselect \n year_month\n , service_category_1 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_1_claim_count\n\n union all\n\n select \n year_month\n , service_category_2 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_2_claim_count", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_claim_type"], "alias": "trend_sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "45c6027bf9a6e62f881f86b83e2792c74ba3d9fcec8135a665f28674db67527f"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7658935, "relation_name": "dev_thuxuan.insights.trend_sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\nwith trend_by_medical_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_by_pharmacy_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , cast('pharmacy' as {{ dbt.type_string() }}) as claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , 0 as total_charge_amount\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n)\r\n, trend_with_previous_medical_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_medical_claim_type\r\n)\r\n, trend_with_previous_pharmacy_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_pharmacy_claim_type\r\n)\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_medical_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_pharmacy_sum", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_medical_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_by_pharmacy_claim_type as(\n select\n cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , cast('pharmacy' as TEXT) as claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , 0 as total_charge_amount\n from dev_thuxuan.core.pharmacy_claim\n group by \n year_month\n)\n, trend_with_previous_medical_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_medical_claim_type\n)\n, trend_with_previous_pharmacy_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_pharmacy_claim_type\n)\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_medical_sum\n\nunion all \n\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_pharmacy_sum", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"database": "dev_thuxuan", "schema": "insights", "name": "insights__trend_sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_service_category"], "alias": "trend_sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "34291f05b11ce9daf8c55c5f5ee36f8c5bd9114b442392153df5c8ac9bfda815"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7764785, "relation_name": "dev_thuxuan.insights.trend_sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r | as_bool\n )\r\n}}\r\n\r\n\r\nwith trend_by_service_category_1 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, trend_with_previous_service_category_1_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_1\r\n)\r\n, trend_with_previous_service_category_2_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_2\r\n)\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_1_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_2_sum", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}, {"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\n\nwith trend_by_service_category_1 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from dev_thuxuan.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, trend_with_previous_service_category_1_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_1\n)\n, trend_with_previous_service_category_2_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_2\n)\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_1_sum\n\nunion all \n\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_2_sum", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_counts": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_counts", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_counts.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_counts.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_counts", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_counts"], "alias": "summary_counts", "checksum": {"name": "sha256", "checksum": "744c720898dd2acc91d01ccb4ec34c9f8f0a8b43d1b18d3ac1eed11fc010f4e8"}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_counts", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.813692, "relation_name": "dev_thuxuan.quality_measures.summary_counts", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith summary_long as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , performance_flag\r\n from {{ ref('quality_measures__summary_long') }}\r\n where measure_id is not null\r\n\r\n)\r\n\r\n, calculate_performance_rate as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , sum(denominator_flag) as denominator_sum\r\n , sum(numerator_flag) as numerator_sum\r\n , sum(exclusion_flag) as exclusion_sum\r\n , (\r\n cast(sum(performance_flag) as {{ dbt.type_numeric() }}) /\r\n (cast(count(performance_flag) as {{ dbt.type_numeric() }}) )\r\n )*100 as performance_rate\r\n from summary_long\r\n group by\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(denominator_sum as integer) as denominator_sum\r\n , cast(numerator_sum as integer) as numerator_sum\r\n , cast(exclusion_sum as integer) as exclusion_sum\r\n , round(cast(performance_rate as {{ dbt.type_numeric() }}),3) as performance_rate\r\n from calculate_performance_rate\r\n\r\n)\r\n\r\nselect\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_sum\r\n , numerator_sum\r\n , exclusion_sum\r\n , performance_rate\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_counts.sql", "compiled": true, "compiled_code": "\n\nwith summary_long as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , performance_flag\n from dev_thuxuan.quality_measures.summary_long\n where measure_id is not null\n\n)\n\n, calculate_performance_rate as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , sum(denominator_flag) as denominator_sum\n , sum(numerator_flag) as numerator_sum\n , sum(exclusion_flag) as exclusion_sum\n , (\n cast(sum(performance_flag) as numeric(28,6)) /\n (cast(count(performance_flag) as numeric(28,6)) )\n )*100 as performance_rate\n from summary_long\n group by\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n\n)\n\n, add_data_types as (\n\n select\n cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(denominator_sum as integer) as denominator_sum\n , cast(numerator_sum as integer) as numerator_sum\n , cast(exclusion_sum as integer) as exclusion_sum\n , round(cast(performance_rate as numeric(28,6)),3) as performance_rate\n from calculate_performance_rate\n\n)\n\nselect\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_sum\n , numerator_sum\n , exclusion_sum\n , performance_rate\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_long.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_long.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_long", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_long"], "alias": "summary_long", "checksum": {"name": "sha256", "checksum": "f98ffc0c6e0390d0d641077029b2fd78fe36869b8e7d7489ed46a9af42eb4526"}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_flag": {"name": "performance_flag", "description": "Performance flag calculated by using exclusion, numerator, and denominator flags. When excluded from a measure the flag is null.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8223917, "relation_name": "dev_thuxuan.quality_measures.summary_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* measures should already be at the full eligibility population grain */\r\nwith measures_unioned as (\r\n\r\n select * from {{ ref('quality_measures__int_nqf2372_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0034_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0059_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_cqm236_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_nqf0053_long') }}\r\n union all\r\n select * from {{ ref('quality_measures__int_cbe0055_long') }}\r\n \r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from measures_unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , case\r\n when exclusion_flag = 1 then null\r\n when numerator_flag = 1 then 1\r\n when denominator_flag = 1 then 0\r\n else null end as performance_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_long", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_long", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_long", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_cbe0055_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_long.sql", "compiled": true, "compiled_code": "\n\n/* measures should already be at the full eligibility population grain */\nwith measures_unioned as (\n\n select * from dev_thuxuan.quality_measures._int_nqf2372_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0034_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0059_long\n union all\n select * from dev_thuxuan.quality_measures._int_cqm236_long\n union all\n select * from dev_thuxuan.quality_measures._int_nqf0053_long\n union all\n select * from dev_thuxuan.quality_measures._int_cbe0055_long\n \n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from measures_unioned\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , case\n when exclusion_flag = 1 then null\n when numerator_flag = 1 then 1\n when denominator_flag = 1 then 0\n else null end as performance_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_wide.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_wide.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_wide", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_wide"], "alias": "summary_wide", "checksum": {"name": "sha256", "checksum": "a2ead89c56891798f32625804a1023e17c3886ca38c31a973c0d0200cc9b3b33"}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Performance flag for NQF2372, Breast Cancer Screening. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0034": {"name": "nqf_0034", "description": "Performance flag for NQF0034, Colorectal Cancer Screening. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0059": {"name": "nqf_0059", "description": "Performance flag for NQF0059, Diabetes: Hemoglobin A1c (HbA1c) Poor Control (> 9%). A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cqm_236": {"name": "cqm_236", "description": "Performance flag for CQM236, Controlling High Blood Pressure. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nqf_0053": {"name": "nqf_0053", "description": "Performance flag for NQF0053, Osteoporosis Management in Women Who Had a Fracture. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cbe_0055": {"name": "cbe_0055", "description": "Performance flag for CBE0055, Diabetes: Eye Exam. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_wide", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8272965, "relation_name": "dev_thuxuan.quality_measures.summary_wide", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Each measure is pivoted into a boolean column by evaluating the\r\n denominator, numerator, and exclusion flags.\r\n*/\r\nwith measures_long as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , performance_flag\r\n , measure_id\r\n from {{ ref('quality_measures__summary_long') }}\r\n\r\n)\r\n\r\n, nqf_2372 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF2372'\r\n\r\n)\r\n, nqf_0034 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0034'\r\n\r\n)\r\n\r\n, nqf_0059 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0059'\r\n\r\n)\r\n\r\n, cqm_236 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'CQM236'\r\n\r\n)\r\n\r\n, nqf_0053 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'NQF0053'\r\n\r\n)\r\n\r\n, cbe_0055 as (\r\n\r\n select\r\n patient_id\r\n , performance_flag\r\n from measures_long\r\n where measure_id = 'CBE0055'\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n measures_long.patient_id\r\n , nqf_2372.performance_flag as nqf_2372\r\n , nqf_0034.performance_flag as nqf_0034\r\n , nqf_0059.performance_flag as nqf_0059\r\n , cqm_236.performance_flag as cqm_236\r\n , nqf_0053.performance_flag as nqf_0053\r\n , cbe_0055.performance_flag as cbe_0055\r\n from measures_long\r\n left join nqf_2372\r\n on measures_long.patient_id = nqf_2372.patient_id\r\n left join nqf_0034\r\n on measures_long.patient_id = nqf_0034.patient_id\r\n left join nqf_0059\r\n on measures_long.patient_id = nqf_0059.patient_id\r\n left join cqm_236\r\n on measures_long.patient_id = cqm_236.patient_id\r\n left join nqf_0053\r\n on measures_long.patient_id = nqf_0053.patient_id\r\n left join cbe_0055\r\n on measures_long.patient_id = cbe_0055.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(nqf_2372 as integer) as nqf_2372\r\n , cast(nqf_0034 as integer) as nqf_0034\r\n , cast(nqf_0059 as integer) as nqf_0059\r\n , cast(cqm_236 as integer) as cqm_236\r\n , cast(nqf_0053 as integer) as nqf_0053\r\n , cast(cbe_0055 as integer) as cbe_0055\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , nqf_2372\r\n , nqf_0034\r\n , nqf_0059\r\n , cqm_236\r\n , nqf_0053\r\n , cbe_0055\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_wide.sql", "compiled": true, "compiled_code": "\n\n/*\n Each measure is pivoted into a boolean column by evaluating the\n denominator, numerator, and exclusion flags.\n*/\nwith measures_long as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , performance_flag\n , measure_id\n from dev_thuxuan.quality_measures.summary_long\n\n)\n\n, nqf_2372 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF2372'\n\n)\n, nqf_0034 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0034'\n\n)\n\n, nqf_0059 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0059'\n\n)\n\n, cqm_236 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'CQM236'\n\n)\n\n, nqf_0053 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'NQF0053'\n\n)\n\n, cbe_0055 as (\n\n select\n patient_id\n , performance_flag\n from measures_long\n where measure_id = 'CBE0055'\n\n)\n\n, joined as (\n\n select\n measures_long.patient_id\n , nqf_2372.performance_flag as nqf_2372\n , nqf_0034.performance_flag as nqf_0034\n , nqf_0059.performance_flag as nqf_0059\n , cqm_236.performance_flag as cqm_236\n , nqf_0053.performance_flag as nqf_0053\n , cbe_0055.performance_flag as cbe_0055\n from measures_long\n left join nqf_2372\n on measures_long.patient_id = nqf_2372.patient_id\n left join nqf_0034\n on measures_long.patient_id = nqf_0034.patient_id\n left join nqf_0059\n on measures_long.patient_id = nqf_0059.patient_id\n left join cqm_236\n on measures_long.patient_id = cqm_236.patient_id\n left join nqf_0053\n on measures_long.patient_id = nqf_0053.patient_id\n left join cbe_0055\n on measures_long.patient_id = cbe_0055.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(nqf_2372 as integer) as nqf_2372\n , cast(nqf_0034 as integer) as nqf_0034\n , cast(nqf_0059 as integer) as nqf_0059\n , cast(cqm_236 as integer) as cqm_236\n , cast(nqf_0053 as integer) as nqf_0053\n , cast(cbe_0055 as integer) as cbe_0055\n from joined\n\n)\n\nselect\n patient_id\n , nqf_2372\n , nqf_0034\n , nqf_0059\n , cqm_236\n , nqf_0053\n , cbe_0055\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cbe0055_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cbe0055_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cbe0055_diabetes_eye_exam", "quality_measures__int_cbe0055_exclusions"], "alias": "_int_cbe0055_exclusions", "checksum": {"name": "sha256", "checksum": "890d9f4e2b018eefc5ebec7728b5e17fe00bf719fcec857abdb9229306049fdb"}, "config": {"enabled": true, "alias": "_int_cbe0055_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of CBE 0055, Diabetes: Eye Exam.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cbe0055_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9878292, "relation_name": "dev_thuxuan.quality_measures._int_cbe0055_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_cbe0055__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_cbe0055__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n union all\r\n select * from valid_dementia_exclusions\r\n union all\r\n select * from valid_hospice_palliative\r\n union all\r\n select * from valid_institutional_snp\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ref('quality_measures__int_cbe0055__denominator')}} as denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type != 'hospice_palliative'\r\n and age >= 66\r\n\r\n union all\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_cbe0055__denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n\n)\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n )\n\n)\n\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cbe0055__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n union all\n select * from valid_dementia_exclusions\n union all\n select * from valid_hospice_palliative\n union all\n select * from valid_institutional_snp\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_cbe0055_denominator as denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select\n *\n from combined_exclusions\n where exclusion_type != 'hospice_palliative'\n and age >= 66\n\n union all\n\n select\n *\n from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cbe0055_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cbe0055_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cbe0055_diabetes_eye_exam", "quality_measures__int_cbe0055_long"], "alias": "_int_cbe0055_long", "checksum": {"name": "sha256", "checksum": "d1a339437faecbe440b3a795562008fdcd65d85525b0530b7caebdf6748e0213"}, "config": {"enabled": true, "alias": "_int_cbe0055_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of CBE 0055, Diabetes: Eye Exam before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cbe0055_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9958189, "relation_name": "dev_thuxuan.quality_measures._int_cbe0055_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_cbe0055__denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from {{ ref('quality_measures__int_cbe0055_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_cbe0055_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , numerator.evidence_value\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.evidence_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__denominator", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055_numerator", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_numerator", "model.the_tuva_project.quality_measures__int_cbe0055_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_cbe0055_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n , evidence_value\n from dev_thuxuan.quality_measures._int_cbe0055_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_cbe0055_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , numerator.evidence_value\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.evidence_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cbe0055_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cbe0055_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cbe0055_diabetes_eye_exam", "quality_measures__int_cbe0055_numerator"], "alias": "_int_cbe0055_numerator", "checksum": {"name": "sha256", "checksum": "f23e2bfdb17e492e32dc5f28cf6e50a3d5987f7ae9f429b9e8a6ea061aeb9e90"}, "config": {"enabled": true, "alias": "_int_cbe0055_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of CBE 0055, Diabetes: Eye Exam\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cbe0055_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9832988, "relation_name": "dev_thuxuan.quality_measures._int_cbe0055_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_cbe0055__denominator') }}\r\n\r\n)\r\n\r\n, retina_test_code as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'diabetic retinal eye exam met'\r\n , 'retinal or dilated eye exam'\r\n )\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select \r\n procedures.patient_id\r\n , procedures.procedure_date as evidence_date\r\n from procedures\r\n inner join {{ ref('quality_measures__int_cbe0055__performance_period') }} pp\r\n on procedure_date between\r\n performance_period_begin and performance_period_end\r\n inner join retina_test_code\r\n on procedures.code = retina_test_code.code\r\n and procedures.code_type = retina_test_code.code_system\r\n\r\n)\r\n\r\n, qualifying_patients_with_denominator as (\r\n\r\n select \r\n qualifying_patients.patient_id\r\n , qualifying_patients.evidence_date\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , cast('1' as integer) as numerator_flag\r\n from qualifying_patients\r\n inner join denominator\r\n on qualifying_patients.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from qualifying_patients_with_denominator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cbe0055__denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_cbe0055_denominator\n\n)\n\n, retina_test_code as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'diabetic retinal eye exam met'\n , 'retinal or dilated eye exam'\n )\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, qualifying_patients as (\n\n select \n procedures.patient_id\n , procedures.procedure_date as evidence_date\n from procedures\n inner join dev_thuxuan.quality_measures._int_cbe0055__performance_period pp\n on procedure_date between\n performance_period_begin and performance_period_end\n inner join retina_test_code\n on procedures.code = retina_test_code.code\n and procedures.code_type = retina_test_code.code_system\n\n)\n\n, qualifying_patients_with_denominator as (\n\n select \n qualifying_patients.patient_id\n , qualifying_patients.evidence_date\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , cast('1' as integer) as numerator_flag\n from qualifying_patients\n inner join denominator\n on qualifying_patients.patient_id = denominator.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(null as TEXT) as evidence_value\n , cast(numerator_flag as integer) as numerator_flag\n from qualifying_patients_with_denominator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cbe0055__denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cbe0055__denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cbe0055_diabetes_eye_exam", "quality_measures__int_cbe0055__denominator"], "alias": "_int_cbe0055_denominator", "checksum": {"name": "sha256", "checksum": "97a26ce72f45e51c9fa2a51d5d95c47c6b7dde111a4b660514959db5ae76d0e8"}, "config": {"enabled": true, "alias": "_int_cbe0055_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of Diabetes: Eye Exam\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cbe0055_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.977299, "relation_name": "dev_thuxuan.quality_measures._int_cbe0055_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'office visit'\r\n , 'home healthcare services'\r\n , 'preventive care services established office visit, 18 and up' \r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'annual wellness visit'\r\n , 'telephone visits'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'diabetes visit'\r\n , 'ophthalmological services'\r\n , 'diabetic retinopathy'\r\n )\r\n\r\n)\r\n\r\n, visits_encounters as (\r\n\r\n select patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n from {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_cbe0055__performance_period')}} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n)\r\n\r\n, procedure_encounters as (\r\n\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_cbe0055__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n)\r\n\r\n, claims_encounters as (\r\n \r\n select patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_cbe0055__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n)\r\n\r\n, all_encounters as (\r\n\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n\r\n union all\r\n\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n\r\n union all\r\n \r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n\r\n)\r\n\r\n, encounters_by_patient as (\r\n\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n\r\n)\r\n\r\n, diabetics_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'diabetes'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, diabetic_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join diabetics_codes\r\n on conditions.source_code_type = diabetics_codes.code_system\r\n and conditions.source_code = diabetics_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n\r\n select\r\n p.patient_id\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.patient_id = e.patient_id\r\n where p.death_date is null\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n diabetic_conditions.patient_id\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from diabetic_conditions\r\n left join patients_with_age\r\n on diabetic_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_cbe0055__performance_period')}} pp\r\n where max_age >= 18 and min_age <= 75\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cbe0055__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'office visit'\n , 'home healthcare services'\n , 'preventive care services established office visit, 18 and up' \n , 'preventive care services initial office visit, 18 and up'\n , 'annual wellness visit'\n , 'telephone visits'\n , 'outpatient'\n , 'observation'\n , 'diabetes visit'\n , 'ophthalmological services'\n , 'diabetic retinopathy'\n )\n\n)\n\n, visits_encounters as (\n\n select patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n from __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_cbe0055__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n)\n\n, procedure_encounters as (\n\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_cbe0055__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n)\n\n, claims_encounters as (\n \n select patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_cbe0055__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n)\n\n, all_encounters as (\n\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n\n union all\n\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n\n union all\n \n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n\n)\n\n, encounters_by_patient as (\n\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n\n)\n\n, diabetics_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'diabetes'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, diabetic_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join diabetics_codes\n on conditions.source_code_type = diabetics_codes.code_system\n and conditions.source_code = diabetics_codes.code\n\n)\n\n, patients_with_age as (\n\n select\n p.patient_id\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.patient_id = e.patient_id\n where p.death_date is null\n\n)\n\n, qualifying_patients as (\n\n select\n distinct\n diabetic_conditions.patient_id\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from diabetic_conditions\n left join patients_with_age\n on diabetic_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_cbe0055__performance_period pp\n where max_age >= 18 and min_age <= 75\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cbe0055__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cbe0055__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cbe0055_diabetes_eye_exam", "quality_measures__int_cbe0055__performance_period"], "alias": "_int_cbe0055__performance_period", "checksum": {"name": "sha256", "checksum": "451e6bbd1496ff25cdefb64c1e8bec8c36db0fc0d2a595b51a223244213482e5"}, "config": {"enabled": true, "alias": "_int_cbe0055__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Diabetes: Eye Exam\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cbe0055__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.972299, "relation_name": "dev_thuxuan.quality_measures._int_cbe0055__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CBE0055')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CBE0055')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CBE0055')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n \r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\nfrom period_begin", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cbe0055_diabetes_eye_exam\\quality_measures__int_cbe0055__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n \n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CBE0055') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CBE0055') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CBE0055') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\nfrom period_begin", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_denominator"], "alias": "_int_cqm236_denominator", "checksum": {"name": "sha256", "checksum": "35c363a48eeabb6290b6a9b30e2954e6a8dffb8484751335056adf685aca0427"}, "config": {"enabled": true, "alias": "_int_cqm236_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of CQM 236, Controlling Blood Pressure\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9213562, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'office visit'\r\n , 'home healthcare services'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'annual wellness visit'\r\n , 'telephone visits'\r\n , 'emergency department evaluation and management visit'\r\n )\r\n\r\n), visits_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n from {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'outpatient'\r\n , 'nonacute inpatient'\r\n , 'encounter inpatient'\r\n , 'acute_inpatient'\r\n , 'emergency_department'\r\n )\r\n\r\n)\r\n\r\n, procedure_encounters as (\r\n\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n)\r\n\r\n, claims_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_cqm236__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n, all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select\r\n patient_id\r\n , min(min_date) min_date\r\n , max(max_date) max_date\r\n , concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n\r\n)\r\n\r\n, hypertension_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'essential hypertension'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, hypertension_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join hypertension_codes\r\n on conditions.source_code_type = hypertension_codes.code_system\r\n and conditions.source_code = hypertension_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.patient_id\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.patient_id = e.patient_id\r\n where p.death_date is null\r\n\r\n)\r\n\r\n-- Patients 18-85 years of age who had a visit and diagnosis of essential hypertension starting before and continuing into, or starting during the first six months of the measurement period.\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n hypertension_conditions.patient_id\r\n , hypertension_conditions.recorded_date\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from hypertension_conditions\r\n left join patients_with_age\r\n on hypertension_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_cqm236__performance_period')}} pp\r\n where max_age >= 18 and min_age <= 85\r\n and hypertension_conditions.recorded_date between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )\r\n }}\r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )}}\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff", "macro.dbt.dateadd"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cqm236__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'office visit'\n , 'home healthcare services'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'annual wellness visit'\n , 'telephone visits'\n , 'emergency department evaluation and management visit'\n )\n\n), visits_encounters as (\n\n select \n patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n from __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n where lower(encounter_type) in (\n 'home health'\n , 'outpatient'\n , 'nonacute inpatient'\n , 'encounter inpatient'\n , 'acute_inpatient'\n , 'emergency_department'\n )\n\n)\n\n, procedure_encounters as (\n\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n)\n\n, claims_encounters as (\n\n select \n patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_cqm236__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n, all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select\n patient_id\n , min(min_date) min_date\n , max(max_date) max_date\n , concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n\n)\n\n, hypertension_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'essential hypertension'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, hypertension_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join hypertension_codes\n on conditions.source_code_type = hypertension_codes.code_system\n and conditions.source_code = hypertension_codes.code\n\n)\n\n, patients_with_age as (\n select\n p.patient_id\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.patient_id = e.patient_id\n where p.death_date is null\n\n)\n\n-- Patients 18-85 years of age who had a visit and diagnosis of essential hypertension starting before and continuing into, or starting during the first six months of the measurement period.\n, qualifying_patients as (\n\n select\n distinct\n hypertension_conditions.patient_id\n , hypertension_conditions.recorded_date\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from hypertension_conditions\n left join patients_with_age\n on hypertension_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_cqm236__performance_period pp\n where max_age >= 18 and min_age <= 85\n and hypertension_conditions.recorded_date between\n \n\n dateadd(\n month,\n -12,\n performance_period_begin\n )\n\n\n and \n \n\n dateadd(\n month,\n 6,\n performance_period_begin\n )\n\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_exclude_procedures_observations", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_exclude_procedures_observations"], "alias": "_int_cqm236_exclude_procedures_observations", "checksum": {"name": "sha256", "checksum": "34e76bf84dae9a3549bc9535f5bebbeead7fcd169bb247db04487fdd6f3a6c94"}, "config": {"enabled": true, "alias": "_int_cqm236_exclude_procedures_observations", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with certain observations and procedures for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_exclude_procedures_observations", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9243565, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_exclude_procedures_observations", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_cqm236_denominator') }}\r\n\r\n)\r\n\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'dialysis services'\r\n , 'end stage renal disease'\r\n , 'esrd monthly outpatient services'\r\n , 'kidney transplant'\r\n , 'kidney transplant recipient'\r\n , 'pregnancy'\r\n )\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n, excluded_patients as (\r\n\r\n select\r\n exclusions_unioned.*\r\n , case\r\n when exclusion_reason = 'pregnancy' then 1\r\n else 0\r\n end as is_pregnant\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.age\r\n from exclusions_unioned\r\n inner join denominator\r\n on exclusions_unioned.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, exclusions_filtered as (\r\n\r\n select\r\n *\r\n from excluded_patients\r\n where is_pregnant = 1\r\n and exclusion_date between performance_period_begin and performance_period_end\r\n \r\n union all\r\n\r\n select\r\n *\r\n from excluded_patients\r\n where is_pregnant = 0\r\n and exclusion_date between performance_period_begin and performance_period_end\r\n or (exclusion_date between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"performance_period_begin\") }}\r\n and performance_period_end)\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , age\r\n , 'measure specific exclusion for observation procedure' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n exclusions_filtered", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclude_procedures_observations.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'dialysis services'\n , 'end stage renal disease'\n , 'esrd monthly outpatient services'\n , 'kidney transplant'\n , 'kidney transplant recipient'\n , 'pregnancy'\n )\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, exclusions_unioned as (\n\n select\n patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select\n patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n, excluded_patients as (\n\n select\n exclusions_unioned.*\n , case\n when exclusion_reason = 'pregnancy' then 1\n else 0\n end as is_pregnant\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.age\n from exclusions_unioned\n inner join denominator\n on exclusions_unioned.patient_id = denominator.patient_id\n\n)\n\n, exclusions_filtered as (\n\n select\n *\n from excluded_patients\n where is_pregnant = 1\n and exclusion_date between performance_period_begin and performance_period_end\n \n union all\n\n select\n *\n from excluded_patients\n where is_pregnant = 0\n and exclusion_date between performance_period_begin and performance_period_end\n or (exclusion_date between \n\n dateadd(\n year,\n -1,\n performance_period_begin\n )\n\n\n and performance_period_end)\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , age\n , 'measure specific exclusion for observation procedure' as exclusion_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom\n exclusions_filtered", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_exclusions"], "alias": "_int_cqm236_exclusions", "checksum": {"name": "sha256", "checksum": "055adeb8a79bcb8346f45475eaabcbfd2e8e69bdf6a32fd0de3b2fa22c3f0ad1"}, "config": {"enabled": true, "alias": "_int_cqm236_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9273565, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_cqm236__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_cqm236__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , age\r\n from {{ref('quality_measures__int_cqm236_denominator')}}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, measure_specific_procedure_observation_exclusion as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n , age\r\n from {{ref('quality_measures__int_cqm236_exclude_procedures_observations')}}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select *\r\n from valid_advanced_illness_exclusions\r\n \r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select *\r\n from valid_institutional_snp\r\n\r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, frailty_exclusion_older_than_80 as (\r\n\r\n select\r\n frailty.patient_id\r\n , frailty.exclusion_date\r\n , frailty.exclusion_reason\r\n , 'measure specific exclusion for patients older than 80' as exclusion_type\r\n , denominator.age\r\n from frailty\r\n inner join denominator\r\n on frailty.patient_id = denominator.patient_id\r\n where denominator.age >= 81\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from combined_exclusions\r\n where exclusion_type != 'hospice_palliative'\r\n and age >= 66\r\n\r\n union all\r\n\r\n select * from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n union all\r\n\r\n select * from frailty_exclusion_older_than_80\r\n\r\n union all\r\n\r\n select * from measure_specific_procedure_observation_exclusion\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_cqm236__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_exclude_procedures_observations", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, denominator as (\n\n select\n patient_id\n , age\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_cqm236__performance_period\n\n)\n\n)\n\n, measure_specific_procedure_observation_exclusion as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n , age\n from dev_thuxuan.quality_measures._int_cqm236_exclude_procedures_observations\n\n)\n\n, exclusions as (\n\n select *\n from valid_advanced_illness_exclusions\n \n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from valid_hospice_palliative\n\n union all\n\n select *\n from valid_institutional_snp\n\n union all\n\n select *\n from valid_dementia_exclusions\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, frailty_exclusion_older_than_80 as (\n\n select\n frailty.patient_id\n , frailty.exclusion_date\n , frailty.exclusion_reason\n , 'measure specific exclusion for patients older than 80' as exclusion_type\n , denominator.age\n from frailty\n inner join denominator\n on frailty.patient_id = denominator.patient_id\n where denominator.age >= 81\n\n)\n\n, valid_exclusions as (\n\n select * from combined_exclusions\n where exclusion_type != 'hospice_palliative'\n and age >= 66\n\n union all\n\n select * from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n union all\n\n select * from frailty_exclusion_older_than_80\n\n union all\n\n select * from measure_specific_procedure_observation_exclusion\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_long"], "alias": "_int_cqm236_long", "checksum": {"name": "sha256", "checksum": "5c5f52a7d958f3f50a705d29892f0500931f6f852346aedd2c00282c1cfeb61d"}, "config": {"enabled": true, "alias": "_int_cqm236_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of CQM 236,Controlling Blood Pressure before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9392645, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_cqm236_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n from {{ ref('quality_measures__int_cqm236_numerator') }}\r\n where numerator_flag = 1\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_cqm236_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.observation_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.observation_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , observation_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(observation_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_numerator", "package": null, "version": null}, {"name": "quality_measures__int_cqm236_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , observation_date\n from dev_thuxuan.quality_measures._int_cqm236_numerator\n where numerator_flag = 1\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_cqm236_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.observation_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.observation_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , observation_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(observation_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236_numerator"], "alias": "_int_cqm236_numerator", "checksum": {"name": "sha256", "checksum": "bcb5c041509c225e00cc829eb48839b78348f5340a14b3ad31a78e486ab36d94"}, "config": {"enabled": true, "alias": "_int_cqm236_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of CQM 236, Controlling Blood Pressure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9330728, "relation_name": "dev_thuxuan.quality_measures._int_cqm236_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select * from {{ref('quality_measures__int_cqm236_denominator')}}\r\n\r\n)\r\n\r\n, encounters as (\r\n\r\n select * from {{ref('quality_measures__stg_core__encounter')}}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select * from {{ref('quality_measures__stg_core__observation')}}\r\n where lower(normalized_description) in \r\n (\r\n 'systolic blood pressure'\r\n , 'diastolic blood pressure'\r\n )\r\n and normalized_code not in (\r\n '99473' -- Self-measured blood pressure using a device validated for clinical accuracy; patient education/training and device calibration\r\n , '99474' -- Separate self-measurements of two readings one minute apart, twice daily over a 30-day period (minimum of 12 readings), collection of data reported by the patient and/or caregiver to the physician or other qualified health care professional, with report of average systolic and diastolic pressures and subsequent communication of a treatment plan to the patient\r\n )\r\n\r\n)\r\n\r\n, observations_within_range as (\r\n\r\n select\r\n observations.*\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from observations\r\n inner join denominator\r\n on observations.patient_id = denominator.patient_id\r\n and observations.observation_date between \r\n denominator.performance_period_begin and denominator.performance_period_end\r\n\r\n)\r\n\r\n, observations_with_encounters as (\r\n\r\n select\r\n observations_within_range.*\r\n , case\r\n when lower(encounters.encounter_type) in (\r\n 'emergency department'\r\n ,'acute inpatient'\r\n )\r\n then 0\r\n else 1\r\n end as is_valid_encounter_observation\r\n from observations_within_range\r\n left join encounters\r\n on observations_within_range.patient_id = encounters.patient_id\r\n and observations_within_range.observation_date between \r\n encounters.encounter_start_date and encounters.encounter_end_date\r\n)\r\n\r\n, valid_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , cast(result as {{ dbt.type_float() }}) as bp_reading\r\n , normalized_description\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n from observations_with_encounters\r\n where is_valid_encounter_observation = 1\r\n\r\n)\r\n\r\n, systolic_bp_observations as (\r\n\r\n select\r\n *\r\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\r\n from valid_observations\r\n where lower(normalized_description) = 'systolic blood pressure'\r\n\r\n)\r\n\r\n, diastolic_bp_observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading\r\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\r\n from valid_observations\r\n where lower(normalized_description) = 'diastolic blood pressure'\r\n\r\n)\r\n\r\n, least_recent_systolic_bp as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading as systolic_bp\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n from systolic_bp_observations\r\n where rn = 1\r\n\r\n)\r\n\r\n, least_recent_diastolic_bp as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , bp_reading as diastolic_bp\r\n from diastolic_bp_observations\r\n where rn = 1\r\n\r\n)\r\n\r\n, patients_with_bp_readings as (\r\n\r\n select\r\n least_recent_systolic_bp.*\r\n , least_recent_diastolic_bp.diastolic_bp\r\n from least_recent_systolic_bp\r\n inner join least_recent_diastolic_bp\r\n on least_recent_systolic_bp.patient_id = least_recent_diastolic_bp.patient_id\r\n and least_recent_systolic_bp.observation_date = least_recent_diastolic_bp.observation_date\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n *\r\n , case\r\n when systolic_bp < 140.0 and diastolic_bp < 90.0\r\n then 1\r\n else 0\r\n end as numerator_flag\r\n from patients_with_bp_readings\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(observation_date as date) as observation_date\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , observation_date\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_cqm236_denominator", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n),denominator as (\n\n select * from dev_thuxuan.quality_measures._int_cqm236_denominator\n\n)\n\n, encounters as (\n\n select * from __dbt__cte__quality_measures__stg_core__encounter\n\n)\n\n, observations as (\n\n select * from __dbt__cte__quality_measures__stg_core__observation\n where lower(normalized_description) in \n (\n 'systolic blood pressure'\n , 'diastolic blood pressure'\n )\n and normalized_code not in (\n '99473' -- Self-measured blood pressure using a device validated for clinical accuracy; patient education/training and device calibration\n , '99474' -- Separate self-measurements of two readings one minute apart, twice daily over a 30-day period (minimum of 12 readings), collection of data reported by the patient and/or caregiver to the physician or other qualified health care professional, with report of average systolic and diastolic pressures and subsequent communication of a treatment plan to the patient\n )\n\n)\n\n, observations_within_range as (\n\n select\n observations.*\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from observations\n inner join denominator\n on observations.patient_id = denominator.patient_id\n and observations.observation_date between \n denominator.performance_period_begin and denominator.performance_period_end\n\n)\n\n, observations_with_encounters as (\n\n select\n observations_within_range.*\n , case\n when lower(encounters.encounter_type) in (\n 'emergency department'\n ,'acute inpatient'\n )\n then 0\n else 1\n end as is_valid_encounter_observation\n from observations_within_range\n left join encounters\n on observations_within_range.patient_id = encounters.patient_id\n and observations_within_range.observation_date between \n encounters.encounter_start_date and encounters.encounter_end_date\n)\n\n, valid_observations as (\n\n select\n patient_id\n , observation_date\n , cast(result as FLOAT) as bp_reading\n , normalized_description\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n from observations_with_encounters\n where is_valid_encounter_observation = 1\n\n)\n\n, systolic_bp_observations as (\n\n select\n *\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\n from valid_observations\n where lower(normalized_description) = 'systolic blood pressure'\n\n)\n\n, diastolic_bp_observations as (\n\n select\n patient_id\n , observation_date\n , bp_reading\n , row_number() over(partition by patient_id order by observation_date desc, bp_reading asc) as rn\n from valid_observations\n where lower(normalized_description) = 'diastolic blood pressure'\n\n)\n\n, least_recent_systolic_bp as (\n\n select\n patient_id\n , observation_date\n , bp_reading as systolic_bp\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n from systolic_bp_observations\n where rn = 1\n\n)\n\n, least_recent_diastolic_bp as (\n\n select\n patient_id\n , observation_date\n , bp_reading as diastolic_bp\n from diastolic_bp_observations\n where rn = 1\n\n)\n\n, patients_with_bp_readings as (\n\n select\n least_recent_systolic_bp.*\n , least_recent_diastolic_bp.diastolic_bp\n from least_recent_systolic_bp\n inner join least_recent_diastolic_bp\n on least_recent_systolic_bp.patient_id = least_recent_diastolic_bp.patient_id\n and least_recent_systolic_bp.observation_date = least_recent_diastolic_bp.observation_date\n\n)\n\n, numerator as (\n\n select\n *\n , case\n when systolic_bp < 140.0 and diastolic_bp < 90.0\n then 1\n else 0\n end as numerator_flag\n from patients_with_bp_readings\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(observation_date as date) as observation_date\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , observation_date\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_cqm236__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_cqm236__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "cqm236_controlling_blood_pressure", "quality_measures__int_cqm236__performance_period"], "alias": "_int_cqm236__performance_period", "checksum": {"name": "sha256", "checksum": "68c2780987fdd7d1e3c8024e4ba00995aa5212c4f38c7472b1376ded088f664e"}, "config": {"enabled": true, "alias": "_int_cqm236__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Controlling Blood Pressure.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_cqm236__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9152482, "relation_name": "dev_thuxuan.quality_measures._int_cqm236__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'CQM236')\r\n\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\nfrom period_begin", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\cqm236_controlling_blood_pressure\\quality_measures__int_cqm236__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'CQM236') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\nfrom period_begin", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_denominator"], "alias": "_int_nqf0034_denominator", "checksum": {"name": "sha256", "checksum": "aebb6f9562d902ac8199c4fb1c6f14d8c766ae28ca1049d6c336443b704937c0"}, "config": {"enabled": true, "alias": "_int_nqf0034_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "min_age": {"name": "min_age", "description": "Patient's minumum age during encounter as of the performance_period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "max_age": {"name": "max_age", "description": "Patient's maximum age during encounter as of the performance_period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "qualifying_types": {"name": "qualifying_types", "description": "Indicative letter of patient's type of encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8713527, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR:\r\nPatients 45-75 years of age with a visit during the measurement period\r\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\r\nshould be used\r\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\r\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\r\nCQMs.\r\nDenominator Criteria (Eligible Cases):\r\nPatients 45 to 75 years of age on date of encounter\r\nAND\r\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\r\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\r\n99396*, 99397*, G0438, G0439\r\n*/\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n), visits_encounters as (\r\n select PATIENT_ID\r\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\r\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\r\n From {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\r\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\r\n where ENCOUNTER_TYPE in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n\r\n )\r\n\r\n,procedure_encounters as (\r\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n\r\n)\r\n,\r\nclaims_encounters as (\r\n select PATIENT_ID\r\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\r\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\r\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\r\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n,all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.PATIENT_ID\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8766.0) as min_age\r\n , max_date\r\n ,floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8766.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.PATIENT_ID = e.PATIENT_ID\r\n where p.BIRTH_DATE is not null\r\n\r\n)\r\n\r\nselect PATIENT_ID,\r\n min_age,\r\n max_age,\r\n qualifying_types\r\nFrom patients_with_age\r\nwhere max_age >= 45 and min_age <= 75", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR:\nPatients 45-75 years of age with a visit during the measurement period\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\nshould be used\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\nCQMs.\nDenominator Criteria (Eligible Cases):\nPatients 45 to 75 years of age on date of encounter\nAND\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\n99396*, 99397*, G0438, G0439\n*/\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n), visits_encounters as (\n select PATIENT_ID\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\n From __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\n where ENCOUNTER_TYPE in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n\n )\n\n,procedure_encounters as (\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n,\nclaims_encounters as (\n select PATIENT_ID\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period as pp on\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n,all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, patients_with_age as (\n select\n p.PATIENT_ID\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8766.0) as min_age\n , max_date\n ,floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8766.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.PATIENT_ID = e.PATIENT_ID\n where p.BIRTH_DATE is not null\n\n)\n\nselect PATIENT_ID,\n min_age,\n max_age,\n qualifying_types\nFrom patients_with_age\nwhere max_age >= 45 and min_age <= 75", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_colectomy_cancer"], "alias": "_int_nqf0034_exclude_colectomy_cancer", "checksum": {"name": "sha256", "checksum": "a94f64137485d27a201b5279dfd8d3a76f83c98e84ea316999a3f4c3f3dfc8b9"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_colectomy_cancer", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_type": {"name": "exclusion_type", "description": "Measure specific exclusion for historical record of colectomy cancer.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "desciption": "The date and timestamp of the dbt run."}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_colectomy_cancer", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8753524, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_exclude_colectomy_cancer", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR EXCLUSIONS:\r\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Malignant Neoplasm of Colon'\r\n , 'Total Colectomy'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'measure specific exclusion for historical record of colectomy cancer' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\n*/\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Malignant Neoplasm of Colon'\n , 'Total Colectomy'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'measure specific exclusion for historical record of colectomy cancer' as exclusion_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclusions"], "alias": "_int_nqf0034_exclusions", "checksum": {"name": "sha256", "checksum": "ef96b731ff607c92679f3b339841efe4f1beb12caa13e16ed9063889163b6631"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8793526, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0034__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0034__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , max_age as age\r\n from {{ref('quality_measures__int_nqf0034_denominator')}}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n and lower(exclusion_reason) in \r\n (\r\n 'palliative care encounter'\r\n , 'palliative care intervention'\r\n , 'hospice care ambulatory'\r\n , 'hospice encounter'\r\n )\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, measure_specific_colectomy_colorectal_cancer_exclusion as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_nqf0034_exclude_colectomy_cancer')}}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select *\r\n from valid_advanced_illness_exclusions\r\n \r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select *\r\n from valid_institutional_snp\r\n\r\n union all\r\n\r\n select *\r\n from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from measure_specific_colectomy_colorectal_cancer_exclusion\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from combined_exclusions\r\n where exclusion_type not in (\r\n 'measure specific exclusion for historical record of colectomy cancer'\r\n , 'hospice_palliative'\r\n ) \r\n and age >= 66\r\n\r\n union all\r\n\r\n select * from combined_exclusions --age irrelvant exclusions\r\n where exclusion_type in (\r\n 'measure specific exclusion for historical record of colectomy cancer'\r\n , 'hospice_palliative'\r\n ) \r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, denominator as (\n\n select\n patient_id\n , max_age as age\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n and lower(exclusion_reason) in \n (\n 'palliative care encounter'\n , 'palliative care intervention'\n , 'hospice care ambulatory'\n , 'hospice encounter'\n )\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0034__performance_period\n\n)\n\n)\n\n, measure_specific_colectomy_colorectal_cancer_exclusion as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_nqf0034_exclude_colectomy_cancer\n\n)\n\n, exclusions as (\n\n select *\n from valid_advanced_illness_exclusions\n \n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from valid_hospice_palliative\n\n union all\n\n select *\n from valid_institutional_snp\n\n union all\n\n select *\n from valid_dementia_exclusions\n\n union all\n\n select *\n from measure_specific_colectomy_colorectal_cancer_exclusion\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select * from combined_exclusions\n where exclusion_type not in (\n 'measure specific exclusion for historical record of colectomy cancer'\n , 'hospice_palliative'\n ) \n and age >= 66\n\n union all\n\n select * from combined_exclusions --age irrelvant exclusions\n where exclusion_type in (\n 'measure specific exclusion for historical record of colectomy cancer'\n , 'hospice_palliative'\n ) \n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_long"], "alias": "_int_nqf0034_long", "checksum": {"name": "sha256", "checksum": "a8124cc5add3eda96e9d32673c8964315bd97df070397fa016e9b12c35044dd3"}, "config": {"enabled": true, "alias": "_int_nqf0034_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0034, Colorectal Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.885864, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n{%- set measure_id -%}\r\n(\r\n select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(\r\n\r\n select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(\r\n select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n from {{ ref('quality_measures__int_nqf0034_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0034_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , {{ measure_id }} as measure_id\r\n , {{ measure_name }} as measure_name\r\n , {{ measure_version }} as measure_version\r\n from patient\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034_exclusions", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "compiled": true, "compiled_code": "/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n patient_id\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n from dev_thuxuan.quality_measures._int_nqf0034_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0034_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , pp.performance_period_begin\n , pp.performance_period_end\n , (\n select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n ) as measure_id\n , (\n\n select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_name\n , (\n select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_version\n from patient\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_numerator"], "alias": "_int_nqf0034_numerator", "checksum": {"name": "sha256", "checksum": "385aca17e9dd859c94c525cfa7ce49916944a11ae22ba5943ef3bce951edfbd6"}, "config": {"enabled": true, "alias": "_int_nqf0034_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0034, Colorectal Cancer Screening\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence": {"name": "evidence", "description": "Reason (usually the value set concept name) that includes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8888714, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n\r\n/*\r\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\r\nfollowing criteria:\r\n- Fecal occult blood test (FOBT) during the measurement period\r\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\r\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\r\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\r\nmeasurement period.\r\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\r\nmeasurement period.\r\n\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n, screening_codes as\r\n(\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Fecal Occult Blood Test (FOBT)' -- mp\r\n ,'Flexible Sigmoidoscopy' --mp+4\r\n ,'Colonoscopy' -- mp+9\r\n ,'CT Colonography' -- mp+4\r\n ,'sDNA FIT Test' -- mp+2\r\n )\r\n)\r\n, screening_periods as (\r\n select *,\r\n case concept_name\r\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\r\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\r\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\r\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\r\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\r\n else pp.performance_period_begin end as effective_performance_period_begin\r\n\r\n from screening_codes\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n )\r\n\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, labs as (\r\n select patient_id\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__lab_result')}}\r\n )\r\n\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\r\n , screening_codes.concept_name\r\n from medical_claim\r\n inner join screening_periods\r\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on medical_claim.hcpcs_code = screening_codes.code\r\n where screening_codes.code_system in ('hcpcs', 'cpt' )\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , screening_codes.concept_name\r\n from observations\r\n inner join screening_periods\r\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on observations.code = screening_codes.code\r\n and observations.code_type = screening_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , screening_codes.concept_name\r\n from procedures\r\n inner join screening_periods\r\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on procedures.code = screening_codes.code\r\n and procedures.code_type = screening_codes.code_system\r\n\r\n)\r\n\r\n,qualifying_labs as (\r\n select\r\n patient_id\r\n , coalesce(collection_date,result_date) as lab_date\r\n , screening_codes.concept_name\r\n from labs\r\n inner join screening_periods\r\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on ( labs.normalized_code = screening_codes.code\r\n and labs.normalized_code_type = screening_codes.code_system )\r\n or ( labs.source_code = screening_codes.code\r\n and labs.source_code_type = screening_codes.code_system )\r\n )\r\n\r\n,qualifying_events as (\r\n select\r\n patient_id\r\n , claim_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_claims\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , observation_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_observations\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , procedure_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_procedures\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , lab_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_labs\r\n\r\n )\r\n\r\nselect\r\n cast (qualifying_events.patient_id as {{ dbt.type_string() }}) patient_id\r\n ,cast( evidence_date as date) as evidence_date\r\n ,cast( evidence as {{ dbt.type_string() }}) as evidence\r\n\r\nfrom qualifying_events\r\ninner join denominator\r\n on qualifying_events.patient_id = denominator.patient_id", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0034_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__int_nqf0034__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "compiled": true, "compiled_code": "\n\n\n/*\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\nfollowing criteria:\n- Fecal occult blood test (FOBT) during the measurement period\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\nmeasurement period.\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\nmeasurement period.\n\n*/\n\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n),denominator as (\n\n select\n patient_id\n\n from dev_thuxuan.quality_measures._int_nqf0034_denominator\n\n)\n, screening_codes as\n(\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Fecal Occult Blood Test (FOBT)' -- mp\n ,'Flexible Sigmoidoscopy' --mp+4\n ,'Colonoscopy' -- mp+9\n ,'CT Colonography' -- mp+4\n ,'sDNA FIT Test' -- mp+2\n )\n)\n, screening_periods as (\n select *,\n case concept_name\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\n else pp.performance_period_begin end as effective_performance_period_begin\n\n from screening_codes\n inner join dev_thuxuan.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n )\n\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, labs as (\n select patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__lab_result\n )\n\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\n , screening_codes.concept_name\n from medical_claim\n inner join screening_periods\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on medical_claim.hcpcs_code = screening_codes.code\n where screening_codes.code_system in ('hcpcs', 'cpt' )\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n , screening_codes.concept_name\n from observations\n inner join screening_periods\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on observations.code = screening_codes.code\n and observations.code_type = screening_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , screening_codes.concept_name\n from procedures\n inner join screening_periods\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on procedures.code = screening_codes.code\n and procedures.code_type = screening_codes.code_system\n\n)\n\n,qualifying_labs as (\n select\n patient_id\n , coalesce(collection_date,result_date) as lab_date\n , screening_codes.concept_name\n from labs\n inner join screening_periods\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on ( labs.normalized_code = screening_codes.code\n and labs.normalized_code_type = screening_codes.code_system )\n or ( labs.source_code = screening_codes.code\n and labs.source_code_type = screening_codes.code_system )\n )\n\n,qualifying_events as (\n select\n patient_id\n , claim_date as evidence_date\n , concept_name as evidence\n from qualifying_claims\n\n union all\n\n select\n patient_id\n , observation_date as evidence_date\n , concept_name as evidence\n from qualifying_observations\n\n union all\n\n select\n patient_id\n , procedure_date as evidence_date\n , concept_name as evidence\n from qualifying_procedures\n\n union all\n\n select\n patient_id\n , lab_date as evidence_date\n , concept_name as evidence\n from qualifying_labs\n\n )\n\nselect\n cast (qualifying_events.patient_id as TEXT) patient_id\n ,cast( evidence_date as date) as evidence_date\n ,cast( evidence as TEXT) as evidence\n\nfrom qualifying_events\ninner join denominator\n on qualifying_events.patient_id = denominator.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "sql": " __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0034__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__performance_period"], "alias": "_int_nqf0034__performance_period", "checksum": {"name": "sha256", "checksum": "a49a0c6632579c310d621764621dc383b6acb81c7557c9ff38f701d58e5e8139"}, "config": {"enabled": true, "alias": "_int_nqf0034__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for NQF 0034 Colorectal Cancer screening.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.891872, "relation_name": "dev_thuxuan.quality_measures._int_nqf0034__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback periods for each type of test\r\n\r\n during the measurement period:\r\n - Fecal occult blood test (FOBT) during the measurement period\r\n\r\n during the measurement period or the two years prior:\r\n - Fecal immunochemical DNA test (FIT-DNA)\r\n\r\n during the measurement period or the four years prior:\r\n - Flexible sigmoidoscopy\r\n - Computed tomography (CT) colonography\r\n\r\n during the measurement period or the nine years prior:\r\n - Colonoscopy\r\n\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -2\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_1yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -3\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_2yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -5\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_4yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -10\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_9yp\r\n from period_begin\r\n\r\n)\r\n\r\nselect\r\n cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\r\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\r\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\r\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\r\nfrom period_lookback", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd"], "nodes": []}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "compiled": true, "compiled_code": "\n/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback periods for each type of test\n\n during the measurement period:\n - Fecal occult blood test (FOBT) during the measurement period\n\n during the measurement period or the two years prior:\n - Fecal immunochemical DNA test (FIT-DNA)\n\n during the measurement period or the four years prior:\n - Flexible sigmoidoscopy\n - Computed tomography (CT) colonography\n\n during the measurement period or the nine years prior:\n - Colonoscopy\n\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n year,\n -2,\n performance_period_end\n )\n\n as performance_period_begin_1yp\n , \n\n dateadd(\n year,\n -3,\n performance_period_end\n )\n\n as performance_period_begin_2yp\n , \n\n dateadd(\n year,\n -5,\n performance_period_end\n )\n\n as performance_period_begin_4yp\n , \n\n dateadd(\n year,\n -10,\n performance_period_end\n )\n\n as performance_period_begin_9yp\n from period_begin\n\n)\n\nselect\n cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_denominator"], "alias": "_int_nqf0053_denominator", "checksum": {"name": "sha256", "checksum": "e81a89fa14f3cb5ec74e73c174567370646130eb70b341eb629b572a55e86937"}, "config": {"enabled": true, "alias": "_int_nqf0053_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date of incident/fracture recorded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.948262, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }} as value_sets\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__stg_core__procedure')}}\r\n\r\n)\r\n\r\n, visits_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n , encounter_type\r\n from {{ref('quality_measures__stg_core__encounter')}} as encounter\r\n inner join {{ ref('quality_measures__int_nqf0053__performance_period') }} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n\r\n)\r\n\r\n, procedure_encounters as (\r\n\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0053__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n)\r\n\r\n, claims_encounters as (\r\n\r\n select \r\n patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n , place_of_service_code\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0053__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n)\r\n\r\n, all_encounters as (\r\n\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select\r\n patient_id\r\n , min_date\r\n , max_date\r\n , cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n\r\n)\r\n\r\n, encounters_by_patient as (\r\n\r\n select\r\n patient_id\r\n , min(min_date) min_date\r\n , max(max_date) max_date\r\n , concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n\r\n)\r\n\r\n, bone_fracture_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) = 'fracture diagnoses'\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, bone_fracture_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join bone_fracture_codes\r\n on conditions.source_code_type = bone_fracture_codes.code_system\r\n and conditions.source_code = bone_fracture_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n\r\n select\r\n patient.patient_id\r\n , patient.sex\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} patient\r\n inner join encounters_by_patient e\r\n on patient.patient_id = e.patient_id\r\n where patient.death_date is null\r\n\r\n)\r\n\r\n, qualifying_patients_w_fractures as (\r\n\r\n select\r\n distinct\r\n bone_fracture_conditions.patient_id\r\n , bone_fracture_conditions.recorded_date\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from bone_fracture_conditions\r\n left join patients_with_age\r\n on bone_fracture_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_nqf0053__performance_period')}} pp\r\n where max_age >= 50 and min_age <= 85\r\n and bone_fracture_conditions.recorded_date between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = \"performance_period_begin\"\r\n )\r\n }}\r\n and\r\n pp.lookback_period_june\r\n and lower(patients_with_age.sex) = 'female'\r\n\r\n)\r\n\r\n, fracture_procedures as (\r\n\r\n select\r\n procedures.*\r\n from procedures\r\n inner join visit_codes\r\n on procedures.source_code = visit_codes.code\r\n and procedures.source_code_type = visit_codes.code_system\r\n inner join {{ ref('quality_measures__int_nqf0053__performance_period') }} as pp\r\n on procedures.procedure_date \r\n between pp.performance_period_begin and pp.performance_period_end\r\n where lower(visit_codes.concept_name) = 'fracture procedures'\r\n\r\n)\r\n\r\n, qualifying_patients_w_encounter as (\r\n\r\n select\r\n qualifying_patients_w_fractures.*\r\n from qualifying_patients_w_fractures\r\n inner join visits_encounters\r\n on qualifying_patients_w_fractures.patient_id = visits_encounters.patient_id\r\n where \r\n lower(visits_encounters.encounter_type) in (\r\n 'acute inpatient'\r\n , 'annual wellness visit'\r\n , 'emergency department visit'\r\n , 'emergency department'\r\n , 'home healthcare services'\r\n , 'office visit'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'emergency department evaluation and management visit'\r\n , 'outpatient'\r\n )\r\n)\r\n\r\n, qualifying_patients_w_procedure as (\r\n\r\n select\r\n qualifying_patients_w_fractures.*\r\n from qualifying_patients_w_fractures\r\n inner join fracture_procedures\r\n on qualifying_patients_w_fractures.patient_id = fracture_procedures.patient_id\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n qualifying_patients_w_encounter.*\r\n from qualifying_patients_w_encounter\r\n left join qualifying_patients_w_procedure\r\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\r\n left join claims_encounters\r\n on qualifying_patients_w_encounter.patient_id = claims_encounters.patient_id\r\n where (cast(claims_encounters.place_of_service_code as {{ dbt.type_string() }}) not in ('21')\r\n or claims_encounters.patient_id is null)\r\n\r\n union all\r\n\r\n select\r\n distinct\r\n qualifying_patients_w_procedure.*\r\n from qualifying_patients_w_procedure\r\n left join qualifying_patients_w_encounter\r\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\r\n where qualifying_patients_w_encounter.patient_id is null\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , recorded_date \r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff", "macro.dbt.dateadd"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes as value_sets\n\n)\n\n, procedures as (\n\n select\n *\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, visits_encounters as (\n\n select \n patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n , encounter_type\n from __dbt__cte__quality_measures__stg_core__encounter as encounter\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n\n)\n\n, procedure_encounters as (\n\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n)\n\n, claims_encounters as (\n\n select \n patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n)\n\n, all_encounters as (\n\n select\n patient_id\n , min_date\n , max_date\n , 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select\n patient_id\n , min_date\n , max_date\n , cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select\n patient_id\n , min_date\n , max_date\n , cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n\n)\n\n, encounters_by_patient as (\n\n select\n patient_id\n , min(min_date) min_date\n , max(max_date) max_date\n , concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n\n)\n\n, bone_fracture_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) = 'fracture diagnoses'\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, bone_fracture_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join bone_fracture_codes\n on conditions.source_code_type = bone_fracture_codes.code_system\n and conditions.source_code = bone_fracture_codes.code\n\n)\n\n, patients_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient patient\n inner join encounters_by_patient e\n on patient.patient_id = e.patient_id\n where patient.death_date is null\n\n)\n\n, qualifying_patients_w_fractures as (\n\n select\n distinct\n bone_fracture_conditions.patient_id\n , bone_fracture_conditions.recorded_date\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from bone_fracture_conditions\n left join patients_with_age\n on bone_fracture_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_nqf0053__performance_period pp\n where max_age >= 50 and min_age <= 85\n and bone_fracture_conditions.recorded_date between\n \n\n dateadd(\n month,\n -6,\n performance_period_begin\n )\n\n\n and\n pp.lookback_period_june\n and lower(patients_with_age.sex) = 'female'\n\n)\n\n, fracture_procedures as (\n\n select\n procedures.*\n from procedures\n inner join visit_codes\n on procedures.source_code = visit_codes.code\n and procedures.source_code_type = visit_codes.code_system\n inner join dev_thuxuan.quality_measures._int_nqf0053__performance_period as pp\n on procedures.procedure_date \n between pp.performance_period_begin and pp.performance_period_end\n where lower(visit_codes.concept_name) = 'fracture procedures'\n\n)\n\n, qualifying_patients_w_encounter as (\n\n select\n qualifying_patients_w_fractures.*\n from qualifying_patients_w_fractures\n inner join visits_encounters\n on qualifying_patients_w_fractures.patient_id = visits_encounters.patient_id\n where \n lower(visits_encounters.encounter_type) in (\n 'acute inpatient'\n , 'annual wellness visit'\n , 'emergency department visit'\n , 'emergency department'\n , 'home healthcare services'\n , 'office visit'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'emergency department evaluation and management visit'\n , 'outpatient'\n )\n)\n\n, qualifying_patients_w_procedure as (\n\n select\n qualifying_patients_w_fractures.*\n from qualifying_patients_w_fractures\n inner join fracture_procedures\n on qualifying_patients_w_fractures.patient_id = fracture_procedures.patient_id\n\n)\n\n, qualifying_patients as (\n\n select\n distinct\n qualifying_patients_w_encounter.*\n from qualifying_patients_w_encounter\n left join qualifying_patients_w_procedure\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\n left join claims_encounters\n on qualifying_patients_w_encounter.patient_id = claims_encounters.patient_id\n where (cast(claims_encounters.place_of_service_code as TEXT) not in ('21')\n or claims_encounters.patient_id is null)\n\n union all\n\n select\n distinct\n qualifying_patients_w_procedure.*\n from qualifying_patients_w_procedure\n left join qualifying_patients_w_encounter\n on qualifying_patients_w_encounter.patient_id = qualifying_patients_w_procedure.patient_id\n where qualifying_patients_w_encounter.patient_id is null\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , recorded_date \n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_exclude_procedures_medications", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_exclude_procedures_medications"], "alias": "_int_nqf0053_exclude_procedures_medications", "checksum": {"name": "sha256", "checksum": "f79562d8f7cc595d84b6ba050bedc1e7d034a2e0f6574ad93c8b55b855f4910b"}, "config": {"enabled": true, "alias": "_int_nqf0053_exclude_procedures_medications", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with certain procedures and medicatons for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_type": {"name": "exclusion_type", "description": "measure specific exclusion for procedure medication.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "desciption": "The date and timestamp of the dbt run."}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_exclude_procedures_medications", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9617777, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_exclude_procedures_medications", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0053_denominator')}}\r\n\r\n)\r\n\r\n, value_sets as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets')}}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code\r\n , source_code_type\r\n from {{ ref('quality_measures__stg_core__procedure')}}\r\n\r\n)\r\n\r\n, pharmacy_claims as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , prescribing_date\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, bone_density_test_codes as (\r\n\r\n select\r\n concept_name\r\n , code\r\n , code_system\r\n from value_sets\r\n where lower(concept_name) in (\r\n 'bone mineral density test'\r\n , 'bone mineral density tests cpt'\r\n , 'bone mineral density tests hcpcs'\r\n , 'bone mineral density tests icd10pcs'\r\n , 'dexa dual energy xray absorptiometry, bone density'\r\n )\r\n\r\n)\r\n\r\n, osteoporosis_medication_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) in \r\n ( \r\n 'osteoporosis medications for urology care'\r\n , 'osteoporosis medication'\r\n , 'bisphosphonates'\r\n )\r\n\r\n)\r\n\r\n, bone_density_test_procedures as (\r\n\r\n select\r\n procedures.*\r\n , bone_density_test_codes.concept_name\r\n from procedures\r\n inner join bone_density_test_codes\r\n on procedures.source_code = bone_density_test_codes.code\r\n and procedures.source_code_type = bone_density_test_codes.code_system\r\n\r\n)\r\n\r\n, osteoporosis_pharmacy_claims as (\r\n\r\n select\r\n pharmacy_claims.patient_id\r\n , pharmacy_claims.dispensing_date\r\n , pharmacy_claims.ndc_code\r\n , osteoporosis_medication_codes.concept_name\r\n from pharmacy_claims\r\n inner join osteoporosis_medication_codes\r\n on pharmacy_claims.ndc_code = osteoporosis_medication_codes.code\r\n and lower(osteoporosis_medication_codes.code_system) = 'ndc'\r\n \r\n)\r\n\r\n, osteoporosis_medications as (\r\n\r\n select\r\n medications.patient_id\r\n , medications.encounter_id\r\n , medications.prescribing_date\r\n , medications.dispensing_date\r\n , medications.source_code\r\n , medications.source_code_type\r\n , osteoporosis_medication_codes.concept_name\r\n from medications\r\n inner join osteoporosis_medication_codes\r\n on medications.source_code = osteoporosis_medication_codes.code\r\n and medications.source_code_type = osteoporosis_medication_codes.code_system\r\n\r\n)\r\n\r\n, valid_osteoporosis_medications_procedures as (\r\n\r\n select\r\n denominator.patient_id\r\n , osteoporosis_pharmacy_claims.concept_name as exclusion_reason\r\n , osteoporosis_pharmacy_claims.dispensing_date as exclusion_date\r\n from denominator\r\n inner join osteoporosis_pharmacy_claims\r\n on denominator.patient_id = osteoporosis_pharmacy_claims.patient_id\r\n where osteoporosis_pharmacy_claims.dispensing_date\r\n between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n \r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , osteoporosis_medications.concept_name as exclusion_reason\r\n , coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date) as exclusion_date\r\n from denominator\r\n inner join osteoporosis_medications\r\n on denominator.patient_id = osteoporosis_medications.patient_id\r\n and coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date)\r\n between\r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -12\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n\r\n)\r\n\r\n, valid_tests_performed as (\r\n\r\n select\r\n denominator.patient_id\r\n , bone_density_test_procedures.concept_name as exclusion_reason\r\n , procedure_date as exclusion_date\r\n from denominator\r\n inner join bone_density_test_procedures\r\n on denominator.patient_id = bone_density_test_procedures.patient_id\r\n where bone_density_test_procedures.procedure_date\r\n between \r\n {{ dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -2\r\n , from_date_or_timestamp = \"denominator.performance_period_begin\"\r\n )}}\r\n and denominator.performance_period_begin\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select * from valid_tests_performed\r\n\r\n union all\r\n\r\n select * from valid_osteoporosis_medications_procedures\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'measure specific exclusion for procedure medication' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n valid_exclusions", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclude_procedures_medications.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n), __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, value_sets as (\n\n select\n concept_name\n , code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n\n)\n\n, procedures as (\n\n select\n patient_id\n , encounter_id\n , procedure_date\n , source_code\n , source_code_type\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, pharmacy_claims as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n, medications as (\n\n select\n patient_id\n , encounter_id\n , prescribing_date\n , dispensing_date\n , source_code\n , source_code_type\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, bone_density_test_codes as (\n\n select\n concept_name\n , code\n , code_system\n from value_sets\n where lower(concept_name) in (\n 'bone mineral density test'\n , 'bone mineral density tests cpt'\n , 'bone mineral density tests hcpcs'\n , 'bone mineral density tests icd10pcs'\n , 'dexa dual energy xray absorptiometry, bone density'\n )\n\n)\n\n, osteoporosis_medication_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) in \n ( \n 'osteoporosis medications for urology care'\n , 'osteoporosis medication'\n , 'bisphosphonates'\n )\n\n)\n\n, bone_density_test_procedures as (\n\n select\n procedures.*\n , bone_density_test_codes.concept_name\n from procedures\n inner join bone_density_test_codes\n on procedures.source_code = bone_density_test_codes.code\n and procedures.source_code_type = bone_density_test_codes.code_system\n\n)\n\n, osteoporosis_pharmacy_claims as (\n\n select\n pharmacy_claims.patient_id\n , pharmacy_claims.dispensing_date\n , pharmacy_claims.ndc_code\n , osteoporosis_medication_codes.concept_name\n from pharmacy_claims\n inner join osteoporosis_medication_codes\n on pharmacy_claims.ndc_code = osteoporosis_medication_codes.code\n and lower(osteoporosis_medication_codes.code_system) = 'ndc'\n \n)\n\n, osteoporosis_medications as (\n\n select\n medications.patient_id\n , medications.encounter_id\n , medications.prescribing_date\n , medications.dispensing_date\n , medications.source_code\n , medications.source_code_type\n , osteoporosis_medication_codes.concept_name\n from medications\n inner join osteoporosis_medication_codes\n on medications.source_code = osteoporosis_medication_codes.code\n and medications.source_code_type = osteoporosis_medication_codes.code_system\n\n)\n\n, valid_osteoporosis_medications_procedures as (\n\n select\n denominator.patient_id\n , osteoporosis_pharmacy_claims.concept_name as exclusion_reason\n , osteoporosis_pharmacy_claims.dispensing_date as exclusion_date\n from denominator\n inner join osteoporosis_pharmacy_claims\n on denominator.patient_id = osteoporosis_pharmacy_claims.patient_id\n where osteoporosis_pharmacy_claims.dispensing_date\n between\n \n\n dateadd(\n month,\n -12,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n \n union all\n\n select\n denominator.patient_id\n , osteoporosis_medications.concept_name as exclusion_reason\n , coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date) as exclusion_date\n from denominator\n inner join osteoporosis_medications\n on denominator.patient_id = osteoporosis_medications.patient_id\n and coalesce(osteoporosis_medications.prescribing_date, osteoporosis_medications.dispensing_date)\n between\n \n\n dateadd(\n month,\n -12,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n\n)\n\n, valid_tests_performed as (\n\n select\n denominator.patient_id\n , bone_density_test_procedures.concept_name as exclusion_reason\n , procedure_date as exclusion_date\n from denominator\n inner join bone_density_test_procedures\n on denominator.patient_id = bone_density_test_procedures.patient_id\n where bone_density_test_procedures.procedure_date\n between \n \n\n dateadd(\n year,\n -2,\n denominator.performance_period_begin\n )\n\n\n and denominator.performance_period_begin\n\n)\n\n, valid_exclusions as (\n\n select * from valid_tests_performed\n\n union all\n\n select * from valid_osteoporosis_medications_procedures\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'measure specific exclusion for procedure medication' as exclusion_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom\n valid_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_exclusions"], "alias": "_int_nqf0053_exclusions", "checksum": {"name": "sha256", "checksum": "ae6cb2b387cbad852c1c8c5725fc3ab386523e87281a93ebb68a4e0bd97ad84b"}, "config": {"enabled": true, "alias": "_int_nqf0053_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9577768, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set lookback_period_december -%}\r\n(\r\n select \r\n lookback_period_december\r\n from {{ ref('quality_measures__int_nqf0053__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n\r\nwith frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, frailty_within_defined_window as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = performance_period_begin\r\n ) \r\n }}\r\n and {{ lookback_period_december }}\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, exclusion_procedure_and_medication as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_nqf0053_exclude_procedures_medications')}}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between \r\n {{dbt.dateadd(\r\n datepart = \"month\"\r\n , interval = -6\r\n , from_date_or_timestamp = performance_period_begin\r\n ) \r\n }}\r\n \r\n and {{ lookback_period_december }}\r\n\r\n)\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, frailty_patients_within_defined_window as (\r\n\r\n select\r\n frailty_within_defined_window.patient_id\r\n , frailty_within_defined_window.exclusion_date\r\n , frailty_within_defined_window.exclusion_reason\r\n , 'measure specific exclusion for defined window' as exclusion_type\r\n from frailty_within_defined_window\r\n \r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n\r\n union all\r\n\r\n select * from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select * from valid_institutional_snp\r\n\r\n union all\r\n\r\n select * from valid_hospice_palliative\r\n\r\n union all\r\n\r\n select * from exclusion_procedure_and_medication\r\n\r\n union all\r\n\r\n select * from frailty_patients_within_defined_window\r\n\r\n)\r\n\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ref('quality_measures__int_nqf0053_denominator')}} as denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select \r\n * \r\n from combined_exclusions\r\n where exclusion_type = 'institutional_snp'\r\n and age >= 66\r\n\r\n union all \r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type in\r\n (\r\n 'advanced_illness'\r\n , 'dementia'\r\n ) \r\n and age between 66 and 80\r\n\r\n union all \r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type = 'measure specific exclusion for defined window'\r\n and age >= 81\r\n\r\n union all\r\n\r\n select \r\n *\r\n from combined_exclusions\r\n where exclusion_type in\r\n (\r\n 'measure specific exclusion for procedure medication'\r\n , 'hospice_palliative'\r\n )\r\n\r\n)\r\n\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_exclude_procedures_medications", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0053_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, frailty_within_defined_window as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between \n \n\n dateadd(\n month,\n -6,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n lookback_period_december\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, exclusion_procedure_and_medication as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_nqf0053_exclude_procedures_medications\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between \n \n\n dateadd(\n month,\n -6,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n \n and (\n select \n lookback_period_december\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n)\n\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0053__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, frailty_patients_within_defined_window as (\n\n select\n frailty_within_defined_window.patient_id\n , frailty_within_defined_window.exclusion_date\n , frailty_within_defined_window.exclusion_reason\n , 'measure specific exclusion for defined window' as exclusion_type\n from frailty_within_defined_window\n \n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n\n union all\n\n select * from valid_dementia_exclusions\n\n union all\n\n select * from valid_institutional_snp\n\n union all\n\n select * from valid_hospice_palliative\n\n union all\n\n select * from exclusion_procedure_and_medication\n\n union all\n\n select * from frailty_patients_within_defined_window\n\n)\n\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf0053_denominator as denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select \n * \n from combined_exclusions\n where exclusion_type = 'institutional_snp'\n and age >= 66\n\n union all \n\n select \n *\n from combined_exclusions\n where exclusion_type in\n (\n 'advanced_illness'\n , 'dementia'\n ) \n and age between 66 and 80\n\n union all \n\n select \n *\n from combined_exclusions\n where exclusion_type = 'measure specific exclusion for defined window'\n and age >= 81\n\n union all\n\n select \n *\n from combined_exclusions\n where exclusion_type in\n (\n 'measure specific exclusion for procedure medication'\n , 'hospice_palliative'\n )\n\n)\n\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_long"], "alias": "_int_nqf0053_long", "checksum": {"name": "sha256", "checksum": "d73d2adf3a09493ecca5d251b73cc07390411eb8b5d2aefe9426391a0f84de67"}, "config": {"enabled": true, "alias": "_int_nqf0053_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.969294, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_nqf0053_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from {{ ref('quality_measures__int_nqf0053_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0053_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , numerator.evidence_value\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.evidence_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0053_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n , evidence_value\n from dev_thuxuan.quality_measures._int_nqf0053_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0053_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , numerator.evidence_value\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.evidence_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053_numerator"], "alias": "_int_nqf0053_numerator", "checksum": {"name": "sha256", "checksum": "2a91742dc89b7cd7dfd6d571da88ba7ed7b1a90ce8f18be9860ce53a40343276"}, "config": {"enabled": true, "alias": "_int_nqf0053_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0053, Osteoporosis Management in women who had a fracture\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9537773, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select \r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , recorded_date\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ref('quality_measures__int_nqf0053_denominator')}}\r\n\r\n)\r\n\r\n, value_sets as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n \r\n)\r\n\r\n, osteo_procedure_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) in (\r\n 'bone mineral density test'\r\n , 'bone mineral density tests cpt'\r\n , 'bone mineral density tests icd10pcs'\r\n , 'bone mineral density tests hcpcs'\r\n , 'dexa dual energy xray absorptiometry, bone density'\r\n , 'central dual energy x-ray absorptiometry (dxa)'\r\n , 'spinal densitometry x-ray' \r\n , 'ultrasonography for densitometry' \r\n , 'ct bone density axial'\r\n , 'peripheral dual-energy x-ray absorptiometry (dxa)'\r\n , 'osteoporosis medication'\r\n )\r\n\r\n)\r\n\r\n, procedures_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n from {{ref('quality_measures__stg_core__procedure')}} as procs\r\n inner join osteo_procedure_codes\r\n on procs.source_code = osteo_procedure_codes.code\r\n and procs.source_code_type = osteo_procedure_codes.code_system\r\n\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures_osteo_related.patient_id\r\n , procedures_osteo_related.procedure_date\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.recorded_date\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n from procedures_osteo_related\r\n inner join denominator\r\n on procedures_osteo_related.patient_id = denominator.patient_id\r\n and \r\n procedures_osteo_related.procedure_date between\r\n denominator.recorded_date \r\n and\r\n {{dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator.recorded_date\"\r\n )\r\n }} \r\n\r\n)\r\n\r\n, denominator_patients_disqualified_from_procedure as (\r\n \r\n select \r\n denominator.patient_id\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , denominator.recorded_date\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end \r\n from denominator\r\n left join qualifying_procedures \r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n where qualifying_procedures.patient_id is null\r\n\r\n)\r\n\r\n-- pharmacy_claim begin\r\n\r\n, osteo_rx_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from value_sets\r\n where lower(concept_name) \r\n in \r\n ( \r\n 'osteoporosis medications for urology care'\r\n , 'osteoporosis medication'\r\n , 'bisphosphonates'\r\n )\r\n\r\n)\r\n\r\n, pharmacy_claims_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code \r\n from {{ref('quality_measures__stg_pharmacy_claim')}} as pharmacy_claims\r\n inner join osteo_rx_codes\r\n on pharmacy_claims.ndc_code = osteo_rx_codes.code\r\n and lower(osteo_rx_codes.code_system) = 'ndc'\r\n\r\n)\r\n\r\n, qualifying_pharmacy_claims as (\r\n\r\n select \r\n pharmacy_claims_osteo_related.patient_id\r\n , pharmacy_claims_osteo_related.dispensing_date\r\n , pharmacy_claims_osteo_related.ndc_code\r\n , denominator_patients_disqualified_from_procedure.measure_id\r\n , denominator_patients_disqualified_from_procedure.measure_name\r\n , denominator_patients_disqualified_from_procedure.measure_version\r\n , denominator_patients_disqualified_from_procedure.recorded_date\r\n , denominator_patients_disqualified_from_procedure.performance_period_begin\r\n , denominator_patients_disqualified_from_procedure.performance_period_end\r\n from pharmacy_claims_osteo_related\r\n inner join denominator_patients_disqualified_from_procedure\r\n on pharmacy_claims_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\r\n and pharmacy_claims_osteo_related.dispensing_date \r\n between \r\n denominator_patients_disqualified_from_procedure.recorded_date \r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator_patients_disqualified_from_procedure.recorded_date\"\r\n )\r\n }}\r\n)\r\n\r\n-- medication begin\r\n\r\n, medication_osteo_related as (\r\n\r\n select\r\n patient_id\r\n , encounter_id\r\n , prescribing_date\r\n , dispensing_date\r\n , source_code\r\n , source_code_type\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ref('quality_measures__stg_core__medication')}} as medications\r\n inner join osteo_rx_codes\r\n on medications.source_code = osteo_rx_codes.code\r\n and medications.source_code_type = osteo_rx_codes.code_system\r\n\r\n)\r\n\r\n, qualifying_medications as (\r\n\r\n select\r\n medication_osteo_related.patient_id\r\n , medication_osteo_related.encounter_id\r\n , denominator_patients_disqualified_from_procedure.measure_id\r\n , denominator_patients_disqualified_from_procedure.measure_name\r\n , denominator_patients_disqualified_from_procedure.measure_version\r\n , denominator_patients_disqualified_from_procedure.recorded_date\r\n , denominator_patients_disqualified_from_procedure.performance_period_begin\r\n , denominator_patients_disqualified_from_procedure.performance_period_end\r\n from medication_osteo_related\r\n inner join denominator_patients_disqualified_from_procedure\r\n on medication_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\r\n and coalesce(medication_osteo_related.prescribing_date, medication_osteo_related.dispensing_date) between \r\n denominator_patients_disqualified_from_procedure.recorded_date \r\n and \r\n {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = +6\r\n , from_date_or_timestamp = \"denominator_patients_disqualified_from_procedure.recorded_date\"\r\n )\r\n }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n qualifying_procedures.patient_id\r\n , qualifying_procedures.performance_period_begin\r\n , qualifying_procedures.performance_period_end\r\n , qualifying_procedures.measure_id\r\n , qualifying_procedures.measure_name\r\n , qualifying_procedures.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_procedures\r\n\r\n union all\r\n\r\n select \r\n qualifying_pharmacy_claims.patient_id\r\n , qualifying_pharmacy_claims.performance_period_begin\r\n , qualifying_pharmacy_claims.performance_period_end\r\n , qualifying_pharmacy_claims.measure_id\r\n , qualifying_pharmacy_claims.measure_name\r\n , qualifying_pharmacy_claims.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_pharmacy_claims\r\n\r\n union all\r\n\r\n select \r\n qualifying_medications.patient_id\r\n , qualifying_medications.performance_period_begin\r\n , qualifying_medications.performance_period_end\r\n , qualifying_medications.measure_id\r\n , qualifying_medications.measure_name\r\n , qualifying_medications.measure_version\r\n , recorded_date as evidence_date\r\n , 1 as numerator_flag\r\n from qualifying_medications\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0053_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n), __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n),denominator as (\n\n select \n patient_id\n , performance_period_begin\n , performance_period_end\n , recorded_date\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf0053_denominator\n\n)\n\n, value_sets as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n \n)\n\n, osteo_procedure_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) in (\n 'bone mineral density test'\n , 'bone mineral density tests cpt'\n , 'bone mineral density tests icd10pcs'\n , 'bone mineral density tests hcpcs'\n , 'dexa dual energy xray absorptiometry, bone density'\n , 'central dual energy x-ray absorptiometry (dxa)'\n , 'spinal densitometry x-ray' \n , 'ultrasonography for densitometry' \n , 'ct bone density axial'\n , 'peripheral dual-energy x-ray absorptiometry (dxa)'\n , 'osteoporosis medication'\n )\n\n)\n\n, procedures_osteo_related as (\n\n select\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n from __dbt__cte__quality_measures__stg_core__procedure as procs\n inner join osteo_procedure_codes\n on procs.source_code = osteo_procedure_codes.code\n and procs.source_code_type = osteo_procedure_codes.code_system\n\n)\n\n, qualifying_procedures as (\n\n select\n procedures_osteo_related.patient_id\n , procedures_osteo_related.procedure_date\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.recorded_date\n , denominator.performance_period_begin\n , denominator.performance_period_end\n from procedures_osteo_related\n inner join denominator\n on procedures_osteo_related.patient_id = denominator.patient_id\n and \n procedures_osteo_related.procedure_date between\n denominator.recorded_date \n and\n \n\n dateadd(\n month,\n 6,\n denominator.recorded_date\n )\n\n \n\n)\n\n, denominator_patients_disqualified_from_procedure as (\n \n select \n denominator.patient_id\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , denominator.recorded_date\n , denominator.performance_period_begin\n , denominator.performance_period_end \n from denominator\n left join qualifying_procedures \n on denominator.patient_id = qualifying_procedures.patient_id\n where qualifying_procedures.patient_id is null\n\n)\n\n-- pharmacy_claim begin\n\n, osteo_rx_codes as (\n\n select\n code\n , code_system\n , concept_name\n from value_sets\n where lower(concept_name) \n in \n ( \n 'osteoporosis medications for urology care'\n , 'osteoporosis medication'\n , 'bisphosphonates'\n )\n\n)\n\n, pharmacy_claims_osteo_related as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code \n from __dbt__cte__quality_measures__stg_pharmacy_claim as pharmacy_claims\n inner join osteo_rx_codes\n on pharmacy_claims.ndc_code = osteo_rx_codes.code\n and lower(osteo_rx_codes.code_system) = 'ndc'\n\n)\n\n, qualifying_pharmacy_claims as (\n\n select \n pharmacy_claims_osteo_related.patient_id\n , pharmacy_claims_osteo_related.dispensing_date\n , pharmacy_claims_osteo_related.ndc_code\n , denominator_patients_disqualified_from_procedure.measure_id\n , denominator_patients_disqualified_from_procedure.measure_name\n , denominator_patients_disqualified_from_procedure.measure_version\n , denominator_patients_disqualified_from_procedure.recorded_date\n , denominator_patients_disqualified_from_procedure.performance_period_begin\n , denominator_patients_disqualified_from_procedure.performance_period_end\n from pharmacy_claims_osteo_related\n inner join denominator_patients_disqualified_from_procedure\n on pharmacy_claims_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\n and pharmacy_claims_osteo_related.dispensing_date \n between \n denominator_patients_disqualified_from_procedure.recorded_date \n and \n \n\n dateadd(\n month,\n 6,\n denominator_patients_disqualified_from_procedure.recorded_date\n )\n\n\n)\n\n-- medication begin\n\n, medication_osteo_related as (\n\n select\n patient_id\n , encounter_id\n , prescribing_date\n , dispensing_date\n , source_code\n , source_code_type\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication as medications\n inner join osteo_rx_codes\n on medications.source_code = osteo_rx_codes.code\n and medications.source_code_type = osteo_rx_codes.code_system\n\n)\n\n, qualifying_medications as (\n\n select\n medication_osteo_related.patient_id\n , medication_osteo_related.encounter_id\n , denominator_patients_disqualified_from_procedure.measure_id\n , denominator_patients_disqualified_from_procedure.measure_name\n , denominator_patients_disqualified_from_procedure.measure_version\n , denominator_patients_disqualified_from_procedure.recorded_date\n , denominator_patients_disqualified_from_procedure.performance_period_begin\n , denominator_patients_disqualified_from_procedure.performance_period_end\n from medication_osteo_related\n inner join denominator_patients_disqualified_from_procedure\n on medication_osteo_related.patient_id = denominator_patients_disqualified_from_procedure.patient_id\n and coalesce(medication_osteo_related.prescribing_date, medication_osteo_related.dispensing_date) between \n denominator_patients_disqualified_from_procedure.recorded_date \n and \n \n\n dateadd(\n month,\n 6,\n denominator_patients_disqualified_from_procedure.recorded_date\n )\n\n\n\n)\n\n, numerator as (\n\n select\n qualifying_procedures.patient_id\n , qualifying_procedures.performance_period_begin\n , qualifying_procedures.performance_period_end\n , qualifying_procedures.measure_id\n , qualifying_procedures.measure_name\n , qualifying_procedures.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_procedures\n\n union all\n\n select \n qualifying_pharmacy_claims.patient_id\n , qualifying_pharmacy_claims.performance_period_begin\n , qualifying_pharmacy_claims.performance_period_end\n , qualifying_pharmacy_claims.measure_id\n , qualifying_pharmacy_claims.measure_name\n , qualifying_pharmacy_claims.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_pharmacy_claims\n\n union all\n\n select \n qualifying_medications.patient_id\n , qualifying_medications.performance_period_begin\n , qualifying_medications.performance_period_end\n , qualifying_medications.measure_id\n , qualifying_medications.measure_name\n , qualifying_medications.measure_version\n , recorded_date as evidence_date\n , 1 as numerator_flag\n from qualifying_medications\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(null as TEXT) as evidence_value\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0053__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0053_osteoporosis_management_in_women_who_had_a_fracture", "quality_measures__int_nqf0053__performance_period"], "alias": "_int_nqf0053__performance_period", "checksum": {"name": "sha256", "checksum": "226bc6043c33ce7ef5a214d868efbf57f67b6e9f5111389563bd6291d2b7ef25"}, "config": {"enabled": true, "alias": "_int_nqf0053__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Osteoporosis Management in women who had a fracture\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0053__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9422624, "relation_name": "dev_thuxuan.quality_measures._int_nqf0053__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0053')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n-- lookback_period for last june 30 and december 31\r\n, lookback_period as (\r\n\r\n select\r\n *\r\n , case\r\n when performance_period_end >= cast(extract(year from performance_period_end) || '-06-30' as date)\r\n then extract(year from performance_period_end) || '-06-30'\r\n else extract(year from performance_period_begin) || '-06-30'\r\n end as lookback_period_june\r\n , case\r\n when performance_period_end >= cast(extract(year from performance_period_end) || '-12-31' as date)\r\n then extract(year from performance_period_end) || '-12-31'\r\n else extract(year from performance_period_begin) || '-12-31'\r\n end as lookback_period_december\r\n from period_begin\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(lookback_period_june as date) as lookback_period_june\r\n , cast(lookback_period_december as date) as lookback_period_december\r\nfrom lookback_period", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0053_osteoporosis_management_in_women_who_had_a_fracture\\quality_measures__int_nqf0053__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n-- lookback_period for last june 30 and december 31\n, lookback_period as (\n\n select\n *\n , case\n when performance_period_end >= cast(extract(year from performance_period_end) || '-06-30' as date)\n then extract(year from performance_period_end) || '-06-30'\n else extract(year from performance_period_begin) || '-06-30'\n end as lookback_period_june\n , case\n when performance_period_end >= cast(extract(year from performance_period_end) || '-12-31' as date)\n then extract(year from performance_period_end) || '-12-31'\n else extract(year from performance_period_begin) || '-12-31'\n end as lookback_period_december\n from period_begin\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0053') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(lookback_period_june as date) as lookback_period_june\n , cast(lookback_period_december as date) as lookback_period_december\nfrom lookback_period", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_denominator"], "alias": "_int_nqf0059_denominator", "checksum": {"name": "sha256", "checksum": "b5a8f0b765120b741709f2e154e009d93e9b3e8340689ac8bea8c2c3e084bab0"}, "config": {"enabled": true, "alias": "_int_nqf0059_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8988721, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'office visit'\r\n , 'home healthcare services'\r\n , 'preventive care services established office visit, 18 and up'\r\n , 'preventive care services initial office visit, 18 and up'\r\n , 'annual wellness visit'\r\n , 'telephone visits'\r\n , 'nutrition services'\r\n )\r\n\r\n), visits_encounters as (\r\n select patient_id\r\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\r\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\r\n from {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp\r\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\r\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n)\r\n\r\n, procedure_encounters as (\r\n select \r\n patient_id\r\n , procedure_date as min_date\r\n , procedure_date as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp\r\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n\r\n)\r\n, claims_encounters as (\r\n select patient_id\r\n , coalesce(claim_start_date,claim_end_date) as min_date\r\n , coalesce(claim_end_date,claim_start_date) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0059__performance_period')}} as pp on\r\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\r\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n, all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n)\r\n\r\n, diabetics_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'diabetes'\r\n , 'hba1c laboratory test'\r\n )\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code\r\n , source_code_type\r\n , normalized_code\r\n , normalized_code_type\r\n from {{ ref('quality_measures__stg_core__condition')}}\r\n\r\n)\r\n\r\n, diabetic_conditions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.encounter_id\r\n , conditions.recorded_date\r\n , conditions.source_code\r\n , conditions.source_code_type\r\n from conditions\r\n inner join diabetics_codes\r\n on conditions.source_code_type = diabetics_codes.code_system\r\n and conditions.source_code = diabetics_codes.code\r\n\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.patient_id\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8760.0) as min_age\r\n , max_date\r\n , floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8760.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.patient_id = e.patient_id\r\n where p.death_date is null\r\n\r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n distinct\r\n diabetic_conditions.patient_id\r\n , patients_with_age.max_age as age\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , pp.measure_id\r\n , pp.measure_name\r\n , pp.measure_version\r\n , 1 as denominator_flag\r\n from diabetic_conditions\r\n left join patients_with_age\r\n on diabetic_conditions.patient_id = patients_with_age.patient_id\r\n cross join {{ref('quality_measures__int_nqf0059__performance_period')}} pp\r\n where max_age >= 18 and min_age <= 75\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from qualifying_patients\r\n\r\n)\r\n\r\nselect \r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'office visit'\n , 'home healthcare services'\n , 'preventive care services established office visit, 18 and up'\n , 'preventive care services initial office visit, 18 and up'\n , 'annual wellness visit'\n , 'telephone visits'\n , 'nutrition services'\n )\n\n), visits_encounters as (\n select patient_id\n , coalesce(encounter.encounter_start_date,encounter.encounter_end_date) as min_date\n , coalesce(encounter.encounter_end_date,encounter.encounter_start_date) as max_date\n from __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp\n on coalesce(encounter.encounter_end_date,encounter.encounter_start_date) >= pp.performance_period_begin\n and coalesce(encounter.encounter_start_date,encounter.encounter_end_date) <= pp.performance_period_end\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n)\n\n, procedure_encounters as (\n select \n patient_id\n , procedure_date as min_date\n , procedure_date as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp\n on procedure_date between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n, claims_encounters as (\n select patient_id\n , coalesce(claim_start_date,claim_end_date) as min_date\n , coalesce(claim_end_date,claim_start_date) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join dev_thuxuan.quality_measures._int_nqf0059__performance_period as pp on\n coalesce(claim_end_date,claim_start_date) >= pp.performance_period_begin\n and coalesce(claim_start_date,claim_end_date) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n, all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, diabetics_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'diabetes'\n , 'hba1c laboratory test'\n )\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code\n , source_code_type\n , normalized_code\n , normalized_code_type\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, diabetic_conditions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.encounter_id\n , conditions.recorded_date\n , conditions.source_code\n , conditions.source_code_type\n from conditions\n inner join diabetics_codes\n on conditions.source_code_type = diabetics_codes.code_system\n and conditions.source_code = diabetics_codes.code\n\n)\n\n, patients_with_age as (\n select\n p.patient_id\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8760.0) as min_age\n , max_date\n , floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8760.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.patient_id = e.patient_id\n where p.death_date is null\n\n\n)\n\n, qualifying_patients as (\n\n select\n distinct\n diabetic_conditions.patient_id\n , patients_with_age.max_age as age\n , pp.performance_period_begin\n , pp.performance_period_end\n , pp.measure_id\n , pp.measure_name\n , pp.measure_version\n , 1 as denominator_flag\n from diabetic_conditions\n left join patients_with_age\n on diabetic_conditions.patient_id = patients_with_age.patient_id\n cross join dev_thuxuan.quality_measures._int_nqf0059__performance_period pp\n where max_age >= 18 and min_age <= 75\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from qualifying_patients\n\n)\n\nselect \n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_exclusions"], "alias": "_int_nqf0059_exclusions", "checksum": {"name": "sha256", "checksum": "ea896de807aed1b1ef46709b24cf36e6affcbcfcda625f4649e713919ce46b59"}, "config": {"enabled": true, "alias": "_int_nqf0059_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9032495, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf0059__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf0059__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n union all\r\n select * from valid_dementia_exclusions\r\n union all\r\n select * from valid_hospice_palliative\r\n union all\r\n select * from valid_institutional_snp\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ref('quality_measures__int_nqf0059_denominator')}} as denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type != 'hospice_palliative'\r\n and age >= 66\r\n\r\n union all\r\n\r\n select\r\n *\r\n from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0059_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n\n)\n-- advanced illness end\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n )\n\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf0059__performance_period\n\n)\n\n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n union all\n select * from valid_dementia_exclusions\n union all\n select * from valid_hospice_palliative\n union all\n select * from valid_institutional_snp\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf0059_denominator as denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select\n *\n from combined_exclusions\n where exclusion_type != 'hospice_palliative'\n and age >= 66\n\n union all\n\n select\n *\n from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_long"], "alias": "_int_nqf0059_long", "checksum": {"name": "sha256", "checksum": "25867f22966d541962e4704268fe7d215780b6bf1d97feb83572c0e08531f49d"}, "config": {"enabled": true, "alias": "_int_nqf0059_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0059,Diabetes Hemoglobin a1c before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9082484, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_nqf0059_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from {{ ref('quality_measures__int_nqf0059_numerator') }}\r\n where numerator_flag = 1\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0059_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null and denominator.patient_id is not null\r\n then 1\r\n when denominator.patient_id is not null\r\n then 0\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , numerator.evidence_value\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , (row_number() over(\r\n partition by\r\n patient.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n order by\r\n numerator.evidence_date desc nulls last\r\n , exclusions.exclusion_date desc nulls last\r\n )) as rn\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from measure_flags\r\n where rn = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf0059_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_nqf0059_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n , evidence_value\n from dev_thuxuan.quality_measures._int_nqf0059_numerator\n where numerator_flag = 1\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf0059_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null and denominator.patient_id is not null\n then 1\n when denominator.patient_id is not null\n then 0\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , numerator.evidence_value\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , (row_number() over(\n partition by\n patient.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n order by\n numerator.evidence_date desc nulls last\n , exclusions.exclusion_date desc nulls last\n )) as rn\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from measure_flags\n where rn = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059_numerator"], "alias": "_int_nqf0059_numerator", "checksum": {"name": "sha256", "checksum": "186bed0fb07ed03dd664664310073a784d25b81b7712cbc5226c62eb0ed9f326"}, "config": {"enabled": true, "alias": "_int_nqf0059_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0059, Diabetes Hemoglobin a1c.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.9132483, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf0059_denominator') }}\r\n\r\n)\r\n\r\n, hba1c_test_code as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'hba1c laboratory test'\r\n )\r\n)\r\n\r\n, labs as (\r\n select\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__lab_result')}}\r\n\r\n)\r\n\r\n, qualifying_labs as (\r\n select\r\n labs.patient_id\r\n , labs.result as evidence_value\r\n , coalesce(collection_date,result_date) as evidence_date\r\n , hba1c_test_code.concept_name\r\n , row_number() over(partition by labs.patient_id order by coalesce(collection_date,result_date) desc) as rn\r\n from labs\r\n inner join hba1c_test_code\r\n on ( labs.normalized_code = hba1c_test_code.code\r\n and labs.normalized_code_type = hba1c_test_code.code_system )\r\n or ( labs.source_code = hba1c_test_code.code\r\n and labs.source_code_type = hba1c_test_code.code_system )\r\n left join denominator\r\n on labs.patient_id = denominator.patient_id\r\n where coalesce(collection_date,result_date) <= denominator.performance_period_end\r\n and {{ apply_regex('labs.result', '[+-]?([0-9]*[.])?[0-9]+') }}\r\n\r\n)\r\n\r\n, recent_readings as (\r\n select\r\n patient_id\r\n , evidence_date\r\n , evidence_value\r\n from qualifying_labs\r\n where rn = 1 \r\n\r\n)\r\n\r\n, qualifying_patients as (\r\n\r\n select\r\n denominator.*\r\n , recent_readings.evidence_date\r\n , recent_readings.evidence_value\r\n from denominator\r\n left join recent_readings\r\n on denominator.patient_id = recent_readings.patient_id\r\n\r\n)\r\n\r\n, test_not_performed as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , 1 as numerator_flag\r\n from qualifying_patients\r\n where \r\n (evidence_date not between performance_period_begin and performance_period_end)\r\n or evidence_date is null\r\n\r\n)\r\n\r\n, valid_patients as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , case\r\n when cast(evidence_value as {{ dbt.type_numeric() }}) > 9.0 then 1\r\n else 0\r\n end as numerator_flag\r\n from qualifying_patients\r\n where evidence_date between performance_period_begin and performance_period_end\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select * from valid_patients\r\n\r\n union all\r\n \r\n select * from test_not_performed\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(evidence_value as {{ dbt.type_string() }}) as evidence_value\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from numerator\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , evidence_value\r\n , numerator_flag\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf0059_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.apply_regex", "macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059_numerator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf0059_denominator\n\n)\n\n, hba1c_test_code as (\n\n select\n code\n , code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'hba1c laboratory test'\n )\n)\n\n, labs as (\n select\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__lab_result\n\n)\n\n, qualifying_labs as (\n select\n labs.patient_id\n , labs.result as evidence_value\n , coalesce(collection_date,result_date) as evidence_date\n , hba1c_test_code.concept_name\n , row_number() over(partition by labs.patient_id order by coalesce(collection_date,result_date) desc) as rn\n from labs\n inner join hba1c_test_code\n on ( labs.normalized_code = hba1c_test_code.code\n and labs.normalized_code_type = hba1c_test_code.code_system )\n or ( labs.source_code = hba1c_test_code.code\n and labs.source_code_type = hba1c_test_code.code_system )\n left join denominator\n on labs.patient_id = denominator.patient_id\n where coalesce(collection_date,result_date) <= denominator.performance_period_end\n and regexp_like(labs.result, '[+-]?([0-9]*[.])?[0-9]+')\n\n)\n\n, recent_readings as (\n select\n patient_id\n , evidence_date\n , evidence_value\n from qualifying_labs\n where rn = 1 \n\n)\n\n, qualifying_patients as (\n\n select\n denominator.*\n , recent_readings.evidence_date\n , recent_readings.evidence_value\n from denominator\n left join recent_readings\n on denominator.patient_id = recent_readings.patient_id\n\n)\n\n, test_not_performed as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , 1 as numerator_flag\n from qualifying_patients\n where \n (evidence_date not between performance_period_begin and performance_period_end)\n or evidence_date is null\n\n)\n\n, valid_patients as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , case\n when cast(evidence_value as numeric(28,6)) > 9.0 then 1\n else 0\n end as numerator_flag\n from qualifying_patients\n where evidence_date between performance_period_begin and performance_period_end\n\n)\n\n, numerator as (\n\n select * from valid_patients\n\n union all\n \n select * from test_not_performed\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(evidence_value as TEXT) as evidence_value\n , cast(numerator_flag as integer) as numerator_flag\n from numerator\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , evidence_value\n , numerator_flag\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "sql": " __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf0059__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0059_diabetes_hemoglobin_a1c", "quality_measures__int_nqf0059__performance_period"], "alias": "_int_nqf0059__performance_period", "checksum": {"name": "sha256", "checksum": "f13d1c4bf53ca57e3a1841574bb22dcef8a630be9a41d57290d3f6981797c0a0"}, "config": {"enabled": true, "alias": "_int_nqf0059__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Diabetes Hemoglobin a1c.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0059__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8938715, "relation_name": "dev_thuxuan.quality_measures._int_nqf0059__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r | as_bool\n )\r\n}}\r\n\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0059')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\nfrom period_begin", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0059_diabetes_hemoglobin_a1c\\quality_measures__int_nqf0059__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF0059') as TEXT) as measure_version\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\nfrom period_begin", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_denominator"], "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "d1a48f8615fd3b0caaedf65765014ea72f327aabb4223538f229693b664cb6fc"}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_lookback": {"name": "performance_period_lookback", "description": "Lookback period of NQF2372.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8483224, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\nwith performance_period as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_end\r\n , performance_period_begin\r\n , performance_period_lookback\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n\r\n, patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n from {{ ref('quality_measures__stg_core__encounter') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n)\r\n\r\n, patient_with_age as (\r\n\r\n select\r\n patient.patient_id\r\n , patient.sex\r\n , patient.birth_date\r\n , patient.death_date\r\n , performance_period.measure_id\r\n , performance_period.measure_name\r\n , performance_period.measure_version\r\n , performance_period.performance_period_begin\r\n , performance_period.performance_period_end\r\n , performance_period.performance_period_lookback\r\n , floor({{ datediff('patient.birth_date', 'performance_period.performance_period_end', 'hour') }} / 8766.0) as age\r\n from patient\r\n cross join performance_period\r\n\r\n)\r\n\r\n/*\r\n Filter patient to living women 51 - 74 years of age\r\n at the beginning of the measurement period\r\n*/\r\n, patient_filtered as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , 1 as denominator_flag\r\n from patient_with_age\r\n where lower(sex) = 'female'\r\n and age between 51 and 74\r\n and death_date is null\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by claim procedures\r\n*/\r\n, visit_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n from medical_claim\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code = visit_codes.code\r\n where visit_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n/*\r\n Filter encounters to qualifying visit type\r\n*/\r\n, visit_encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_start_date\r\n from encounters\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by procedure\r\n*/\r\n, visit_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join visit_codes\r\n on procedures.code = visit_codes.code\r\n and procedures.code_type = visit_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Filter to final eligible population/denominator before exclusions\r\n with a qualifying visit during the measurement period\r\n*/\r\n, eligible_population as (\r\n\r\n select\r\n patient_filtered.patient_id\r\n , patient_filtered.age\r\n , patient_filtered.measure_id\r\n , patient_filtered.measure_name\r\n , patient_filtered.measure_version\r\n , patient_filtered.performance_period_begin\r\n , patient_filtered.performance_period_end\r\n , performance_period_lookback\r\n , patient_filtered.denominator_flag\r\n from patient_filtered\r\n left join visit_claims\r\n on patient_filtered.patient_id = visit_claims.patient_id\r\n left join visit_procedures\r\n on patient_filtered.patient_id = visit_procedures.patient_id\r\n left join visit_encounters\r\n on patient_filtered.patient_id = visit_encounters.patient_id\r\n where (\r\n visit_claims.claim_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_claims.claim_end_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_procedures.procedure_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_encounters.encounter_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n )\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from eligible_population\r\n\r\n)\r\n\r\n select distinct\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_core__encounter", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),performance_period as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_end\n , performance_period_begin\n , performance_period_lookback\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n, patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , death_date\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, encounters as (\n\n select\n patient_id\n , encounter_type\n , encounter_start_date\n from __dbt__cte__quality_measures__stg_core__encounter\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, visit_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n)\n\n, patient_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , patient.birth_date\n , patient.death_date\n , performance_period.measure_id\n , performance_period.measure_name\n , performance_period.measure_version\n , performance_period.performance_period_begin\n , performance_period.performance_period_end\n , performance_period.performance_period_lookback\n , floor(datediff(\n hour,\n patient.birth_date,\n performance_period.performance_period_end\n ) / 8766.0) as age\n from patient\n cross join performance_period\n\n)\n\n/*\n Filter patient to living women 51 - 74 years of age\n at the beginning of the measurement period\n*/\n, patient_filtered as (\n\n select\n patient_id\n , age\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , 1 as denominator_flag\n from patient_with_age\n where lower(sex) = 'female'\n and age between 51 and 74\n and death_date is null\n\n)\n\n/*\n Filter to qualifying visit types by claim procedures\n*/\n, visit_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n from medical_claim\n inner join visit_codes\n on medical_claim.hcpcs_code = visit_codes.code\n where visit_codes.code_system = 'hcpcs'\n\n)\n\n/*\n Filter encounters to qualifying visit type\n*/\n, visit_encounters as (\n\n select\n patient_id\n , encounter_start_date\n from encounters\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n)\n\n/*\n Filter to qualifying visit types by procedure\n*/\n, visit_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join visit_codes\n on procedures.code = visit_codes.code\n and procedures.code_type = visit_codes.code_system\n\n)\n\n/*\n Filter to final eligible population/denominator before exclusions\n with a qualifying visit during the measurement period\n*/\n, eligible_population as (\n\n select\n patient_filtered.patient_id\n , patient_filtered.age\n , patient_filtered.measure_id\n , patient_filtered.measure_name\n , patient_filtered.measure_version\n , patient_filtered.performance_period_begin\n , patient_filtered.performance_period_end\n , performance_period_lookback\n , patient_filtered.denominator_flag\n from patient_filtered\n left join visit_claims\n on patient_filtered.patient_id = visit_claims.patient_id\n left join visit_procedures\n on patient_filtered.patient_id = visit_procedures.patient_id\n left join visit_encounters\n on patient_filtered.patient_id = visit_encounters.patient_id\n where (\n visit_claims.claim_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_claims.claim_end_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_procedures.procedure_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_encounters.encounter_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n )\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_lookback as date) as performance_period_lookback\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from eligible_population\n\n)\n\n select distinct\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_mastectomy", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_mastectomy"], "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "cbeec7a759b67ead397c2973b62195cf910802220a0cf4dd967e1591d4853459"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_mastectomy", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.851833, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_exclude_mastectomy", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy or for whom there is evidence of a right and a left\r\n unilateral mastectomy\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n , 'Status Post Left Mastectomy'\r\n , 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n , 'Unilateral Mastectomy Right'\r\n , 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, all_mastectomy as (\r\n\r\n select\r\n denominator.patient_id\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy\r\n*/\r\n, bilateral_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n )\r\n\r\n)\r\n\r\n, right_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Right'\r\n )\r\n\r\n)\r\n\r\n, left_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Left Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n )\r\n\r\n)\r\n\r\n, unspecified_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Women for whom there is evidence of a right AND a left unilateral mastectomy\r\n or unspecific mastectomies on different dates\r\n*/\r\n, unilateral_mastectomy as (\r\n\r\n select\r\n right_mastectomy.patient_id\r\n , right_mastectomy.exclusion_date\r\n , right_mastectomy.exclusion_reason\r\n from right_mastectomy\r\n inner join left_mastectomy\r\n on right_mastectomy.patient_id = left_mastectomy.patient_id\r\n\r\n union all\r\n\r\n select\r\n unspecified_mastectomy.patient_id\r\n , unspecified_mastectomy.exclusion_date\r\n , unspecified_mastectomy.exclusion_reason\r\n from unspecified_mastectomy\r\n inner join unspecified_mastectomy as self_join\r\n on unspecified_mastectomy.patient_id = self_join.patient_id\r\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from bilateral_mastectomy\r\n union all\r\n select * from unilateral_mastectomy\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom unioned", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "compiled": true, "compiled_code": "\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy or for whom there is evidence of a right and a left\n unilateral mastectomy\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n , 'Status Post Left Mastectomy'\n , 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Left'\n , 'Unilateral Mastectomy Right'\n , 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, all_mastectomy as (\n\n select\n denominator.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n\n)\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy\n*/\n, bilateral_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n )\n\n)\n\n, right_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Right'\n )\n\n)\n\n, left_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Left Mastectomy'\n , 'Unilateral Mastectomy Left'\n )\n\n)\n\n, unspecified_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n/*\n Women for whom there is evidence of a right AND a left unilateral mastectomy\n or unspecific mastectomies on different dates\n*/\n, unilateral_mastectomy as (\n\n select\n right_mastectomy.patient_id\n , right_mastectomy.exclusion_date\n , right_mastectomy.exclusion_reason\n from right_mastectomy\n inner join left_mastectomy\n on right_mastectomy.patient_id = left_mastectomy.patient_id\n\n union all\n\n select\n unspecified_mastectomy.patient_id\n , unspecified_mastectomy.exclusion_date\n , unspecified_mastectomy.exclusion_reason\n from unspecified_mastectomy\n inner join unspecified_mastectomy as self_join\n on unspecified_mastectomy.patient_id = self_join.patient_id\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\n\n)\n\n, unioned as (\n\n select * from bilateral_mastectomy\n union all\n select * from unilateral_mastectomy\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclusions"], "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "0599c399c1615fecc7c447c26c22bcda6f8241d74c87256e7640c34ee10e0a03"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.855838, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{%- set performance_period_begin -%}\r\n(\r\n select \r\n performance_period_begin\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\n{%- set performance_period_end -%}\r\n(\r\n select \r\n performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n{%- endset -%}\r\n\r\nwith frailty as (\r\n\r\n select\r\n *\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_mastectomy_patients as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_mastectomy') }}\r\n)\r\n\r\n, valid_hospice_palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_hospice_palliative')}}\r\n where lower(exclusion_reason) in \r\n (\r\n 'palliative care encounter'\r\n , 'palliative care intervention'\r\n , 'hospice care ambulatory'\r\n , 'hospice encounter'\r\n )\r\n and\r\n exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_institutional_snp as (\r\n\r\n select \r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_institutional_snp')}}\r\n where exclusion_date between {{ performance_period_begin }} and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, valid_dementia_exclusions as (\r\n\r\n select\r\n source.patient_id\r\n , source.exclusion_date\r\n , source.exclusion_reason\r\n , source.exclusion_type\r\n from {{ref('quality_measures__int_shared_exclusions_dementia')}} source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where (\r\n source.dispensing_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n or source.paid_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp= performance_period_begin ) }}\r\n and {{ performance_period_end }}\r\n )\r\n\r\n)\r\n\r\n-- advanced illness start\r\n, advanced_illness_exclusion as (\r\n\r\n select\r\n source.*\r\n from {{ ref('quality_measures__int_shared_exclusions_advanced_illness') }} as source\r\n inner join frailty\r\n on source.patient_id = frailty.patient_id\r\n where source.exclusion_date\r\n between\r\n {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=performance_period_begin) }}\r\n and {{ performance_period_end }}\r\n\r\n)\r\n\r\n, acute_inpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'acute_inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient_advanced_illness as (\r\n\r\n select\r\n *\r\n from advanced_illness_exclusion\r\n where patient_type = 'nonacute_outpatient'\r\n\r\n)\r\n\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from acute_inpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , exclusion_type\r\n , count(distinct exclusion_date) as encounter_count\r\n from nonacute_outpatient_advanced_illness\r\n group by patient_id, exclusion_type\r\n\r\n)\r\n\r\n, valid_advanced_illness_exclusions as (\r\n\r\n select\r\n acute_inpatient_advanced_illness.patient_id\r\n , acute_inpatient_advanced_illness.exclusion_date\r\n , acute_inpatient_advanced_illness.exclusion_reason\r\n , acute_inpatient_advanced_illness.exclusion_type\r\n from acute_inpatient_advanced_illness\r\n left join acute_inpatient_counts\r\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient_advanced_illness.patient_id\r\n , nonacute_outpatient_advanced_illness.exclusion_date\r\n , nonacute_outpatient_advanced_illness.exclusion_reason\r\n , nonacute_outpatient_advanced_illness.exclusion_type\r\n from nonacute_outpatient_advanced_illness\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n)\r\n-- advanced illness end\r\n\r\n, valid_mastectomy_patients_with_exclusion_type as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'mastectomy_performed' as exclusion_type\r\n from valid_mastectomy_patients\r\n)\r\n\r\n, exclusions as (\r\n\r\n select * from valid_advanced_illness_exclusions\r\n\r\n union all\r\n\r\n select * from valid_dementia_exclusions\r\n\r\n union all\r\n\r\n select * from valid_institutional_snp\r\n\r\n union all\r\n\r\n select * from valid_hospice_palliative\r\n\r\n)\r\n\r\n, combined_exclusions as (\r\n\r\n select \r\n exclusions.*\r\n , denominator.age\r\n from exclusions\r\n inner join {{ ref('quality_measures__int_nqf2372_denominator') }} denominator\r\n on exclusions.patient_id = denominator.patient_id\r\n\r\n)\r\n\r\n, valid_exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from combined_exclusions\r\n where exclusion_type != 'hospice_palliative' \r\n and age >= 66\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_type\r\n from combined_exclusions\r\n where exclusion_type = 'hospice_palliative'\r\n\r\n)\r\n\r\n, valid_exclusions_with_mastectomy as (\r\n\r\n select *\r\n from valid_exclusions\r\n\r\n union all\r\n\r\n select *\r\n from valid_mastectomy_patients_with_exclusion_type\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , 1 as exclusion_flag\r\n from valid_exclusions_with_mastectomy\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372__performance_period", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclude_mastectomy", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_hospice_palliative", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_institutional_snp", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_dementia", "package": null, "version": null}, {"name": "quality_measures__int_shared_exclusions_advanced_illness", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "compiled": true, "compiled_code": "with frailty as (\n\n select\n *\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_mastectomy_patients as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_nqf2372_exclude_mastectomy\n)\n\n, valid_hospice_palliative as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative\n where lower(exclusion_reason) in \n (\n 'palliative care encounter'\n , 'palliative care intervention'\n , 'hospice care ambulatory'\n , 'hospice encounter'\n )\n and\n exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_institutional_snp as (\n\n select \n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp\n where exclusion_date between (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n) and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, valid_dementia_exclusions as (\n\n select\n source.patient_id\n , source.exclusion_date\n , source.exclusion_reason\n , source.exclusion_type\n from dev_thuxuan.quality_measures._int_shared_exclusions_dementia source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where (\n source.dispensing_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n or source.paid_date\n between \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n)\n\n-- advanced illness start\n, advanced_illness_exclusion as (\n\n select\n source.*\n from dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness as source\n inner join frailty\n on source.patient_id = frailty.patient_id\n where source.exclusion_date\n between\n \n\n dateadd(\n year,\n -1,\n (\n select \n performance_period_begin\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n )\n\n\n and (\n select \n performance_period_end\n from dev_thuxuan.quality_measures._int_nqf2372__performance_period\n\n)\n\n)\n\n, acute_inpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'acute_inpatient'\n\n)\n\n, nonacute_outpatient_advanced_illness as (\n\n select\n *\n from advanced_illness_exclusion\n where patient_type = 'nonacute_outpatient'\n\n)\n\n, acute_inpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from acute_inpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, nonacute_outpatient_counts as (\n\n select\n patient_id\n , exclusion_type\n , count(distinct exclusion_date) as encounter_count\n from nonacute_outpatient_advanced_illness\n group by patient_id, exclusion_type\n\n)\n\n, valid_advanced_illness_exclusions as (\n\n select\n acute_inpatient_advanced_illness.patient_id\n , acute_inpatient_advanced_illness.exclusion_date\n , acute_inpatient_advanced_illness.exclusion_reason\n , acute_inpatient_advanced_illness.exclusion_type\n from acute_inpatient_advanced_illness\n left join acute_inpatient_counts\n on acute_inpatient_advanced_illness.patient_id = acute_inpatient_counts.patient_id\n where acute_inpatient_counts.encounter_count >= 1\n\n union all\n\n select\n nonacute_outpatient_advanced_illness.patient_id\n , nonacute_outpatient_advanced_illness.exclusion_date\n , nonacute_outpatient_advanced_illness.exclusion_reason\n , nonacute_outpatient_advanced_illness.exclusion_type\n from nonacute_outpatient_advanced_illness\n left join nonacute_outpatient_counts\n on nonacute_outpatient_advanced_illness.patient_id = nonacute_outpatient_counts.patient_id\n where nonacute_outpatient_counts.encounter_count >= 2\n\n)\n-- advanced illness end\n\n, valid_mastectomy_patients_with_exclusion_type as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'mastectomy_performed' as exclusion_type\n from valid_mastectomy_patients\n)\n\n, exclusions as (\n\n select * from valid_advanced_illness_exclusions\n\n union all\n\n select * from valid_dementia_exclusions\n\n union all\n\n select * from valid_institutional_snp\n\n union all\n\n select * from valid_hospice_palliative\n\n)\n\n, combined_exclusions as (\n\n select \n exclusions.*\n , denominator.age\n from exclusions\n inner join dev_thuxuan.quality_measures._int_nqf2372_denominator denominator\n on exclusions.patient_id = denominator.patient_id\n\n)\n\n, valid_exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from combined_exclusions\n where exclusion_type != 'hospice_palliative' \n and age >= 66\n\n union all\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_type\n from combined_exclusions\n where exclusion_type = 'hospice_palliative'\n\n)\n\n, valid_exclusions_with_mastectomy as (\n\n select *\n from valid_exclusions\n\n union all\n\n select *\n from valid_mastectomy_patients_with_exclusion_type\n\n)\n\n, add_data_types as (\n\n select\n distinct\n cast(patient_id as TEXT) as patient_id\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , 1 as exclusion_flag\n from valid_exclusions_with_mastectomy\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_long"], "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "46ce297037405779c778234131cf080c6f0e5f48135a4645e9e6b2398b8daee5"}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_value": {"name": "evidence_value", "description": "Observed evidence value for the patients in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8618376, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n from {{ ref('quality_measures__int_nqf2372_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n from {{ ref('quality_measures__int_nqf2372_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then denominator.denominator_flag\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null\r\n then numerator.numerator_flag\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null\r\n then exclusions.exclusion_flag\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , cast(null as {{ dbt.type_string() }}) as evidence_value\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_numerator", "package": null, "version": null}, {"name": "quality_measures__int_nqf2372_exclusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , numerator_flag\n from dev_thuxuan.quality_measures._int_nqf2372_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n , exclusion_flag\n from dev_thuxuan.quality_measures._int_nqf2372_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then denominator.denominator_flag\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null\n then numerator.numerator_flag\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null\n then exclusions.exclusion_flag\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n from patient\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , cast(null as TEXT) as evidence_value\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_numerator"], "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "a0903f344296f48c8dbbad2d57dab19ecc6d8fe96cabac29cc707acd8ffbd257"}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8673422, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n Eligible population from the denominator model before exclusions\r\n*/\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, mammography_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name = 'Mammography'\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n from medical_claim\r\n inner join mammography_codes\r\n on medical_claim.hcpcs_code = mammography_codes.code\r\n where mammography_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n from observations\r\n inner join mammography_codes\r\n on observations.code = mammography_codes.code\r\n and observations.code_type = mammography_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join mammography_codes\r\n on procedures.code = mammography_codes.code\r\n and procedures.code_type = mammography_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Check if patients in the eligible population have had a screening,\r\n diagnostic, film, digital or digital breast tomosynthesis (3D)\r\n mammography results documented and reviewed.\r\n*/\r\n\r\n, patients_with_mammograms as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.performance_period_lookback\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_start_date\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_end_date\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_observations.observation_date\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_procedures.procedure_date\r\n else null\r\n end as evidence_date\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n else 0\r\n end as numerator_flag\r\n from denominator\r\n left join qualifying_claims\r\n on denominator.patient_id = qualifying_claims.patient_id\r\n left join qualifying_observations\r\n on denominator.patient_id = qualifying_observations.patient_id\r\n left join qualifying_procedures\r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from patients_with_mammograms\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [{"name": "quality_measures__int_nqf2372_denominator", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "compiled": true, "compiled_code": "\n\n/*\n Eligible population from the denominator model before exclusions\n*/\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n from dev_thuxuan.quality_measures._int_nqf2372_denominator\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from dev_thuxuan.quality_measures._value_set_codes\n where concept_name = 'Mammography'\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n from medical_claim\n inner join mammography_codes\n on medical_claim.hcpcs_code = mammography_codes.code\n where mammography_codes.code_system = 'hcpcs'\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n from observations\n inner join mammography_codes\n on observations.code = mammography_codes.code\n and observations.code_type = mammography_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join mammography_codes\n on procedures.code = mammography_codes.code\n and procedures.code_type = mammography_codes.code_system\n\n)\n\n/*\n Check if patients in the eligible population have had a screening,\n diagnostic, film, digital or digital breast tomosynthesis (3D)\n mammography results documented and reviewed.\n*/\n\n, patients_with_mammograms as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.performance_period_lookback\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_start_date\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_end_date\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_observations.observation_date\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_procedures.procedure_date\n else null\n end as evidence_date\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n else 0\n end as numerator_flag\n from denominator\n left join qualifying_claims\n on denominator.patient_id = qualifying_claims.patient_id\n left join qualifying_observations\n on denominator.patient_id = qualifying_observations.patient_id\n left join qualifying_procedures\n on denominator.patient_id = qualifying_procedures.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(numerator_flag as integer) as numerator_flag\n from patients_with_mammograms\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , numerator_flag\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_nqf2372__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__performance_period"], "alias": "_int_nqf2372__performance_period", "checksum": {"name": "sha256", "checksum": "4bb3e6347eee038dcf4dcf1814b1b9b45f40ca74e2b6f194d9a7d2955ae50b29"}, "config": {"enabled": true, "alias": "_int_nqf2372__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Breast Cancer screening.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8433223, "relation_name": "dev_thuxuan.quality_measures._int_nqf2372__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback period to 27 months prior to the end of the\r\n performance period\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -27\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_lookback\r\n from period_begin\r\n\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\nfrom period_lookback", "language": "sql", "refs": [{"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}, {"name": "quality_measures__measures", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback period to 27 months prior to the end of the\n performance period\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n month,\n -27,\n performance_period_end\n )\n\n as performance_period_lookback\n from period_begin\n\n\n)\n\nselect\n cast((select id\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_id\n , cast((select name\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_name\n , cast((select version\nfrom dev_thuxuan.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_version\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_lookback as date) as performance_period_lookback\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_advanced_illness"], "alias": "_int_shared_exclusions_advanced_illness", "checksum": {"name": "sha256", "checksum": "17e0f227c6b6ce36f0cbdf3bde53649b9c5658647ad1ee5a1e5905975f8f07e8"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8318064, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_advanced_illness", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false)))) | as_bool\r\n )\r\n}}\r\n\r\nwith patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'advanced illness'\r\n , 'acute inpatient'\r\n , 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n where lower(exclusion_codes.concept_name) = 'advanced illness'\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, acute_inpatient as (\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n , cast(null as date) as procedure_date\r\n from patients_with_frailty\r\n inner join med_claim_exclusions\r\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\r\n inner join condition_exclusions\r\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\r\n where lower(med_claim_exclusions.concept_name) = 'acute inpatient'\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , cast(null as date) as claim_start_date\r\n , cast(null as date) as claim_end_date\r\n , procedure_exclusions.procedure_date\r\n from patients_with_frailty\r\n inner join procedure_exclusions\r\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\r\n inner join condition_exclusions\r\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\r\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\r\n where lower(procedure_exclusions.concept_name) = 'acute inpatient'\r\n\r\n)\r\n\r\n, nonacute_outpatient as (\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n , cast(null as date) as procedure_date\r\n from patients_with_frailty\r\n inner join med_claim_exclusions\r\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\r\n inner join condition_exclusions\r\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\r\n where lower(med_claim_exclusions.concept_name) in (\r\n 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n union all\r\n\r\n select distinct\r\n patients_with_frailty.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n , cast(null as date) as claim_start_date\r\n , cast(null as date) as claim_end_date\r\n , procedure_exclusions.procedure_date\r\n from patients_with_frailty\r\n inner join procedure_exclusions\r\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\r\n inner join condition_exclusions\r\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\r\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\r\n where lower(procedure_exclusions.concept_name) in (\r\n 'encounter inpatient'\r\n , 'outpatient'\r\n , 'observation'\r\n , 'emergency department visit'\r\n , 'nonacute inpatient'\r\n )\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n acute_inpatient.patient_id\r\n , acute_inpatient.exclusion_date\r\n , acute_inpatient.exclusion_reason\r\n , acute_inpatient.claim_start_date\r\n , acute_inpatient.claim_end_date\r\n , acute_inpatient.procedure_date\r\n , 'acute_inpatient' as patient_type\r\n from acute_inpatient\r\n\r\n union all\r\n\r\n select\r\n nonacute_outpatient.patient_id\r\n , nonacute_outpatient.exclusion_date\r\n , nonacute_outpatient.exclusion_reason\r\n , nonacute_outpatient.claim_start_date\r\n , nonacute_outpatient.claim_end_date\r\n , nonacute_outpatient.procedure_date\r\n , 'nonacute_outpatient' as patient_type\r\n from nonacute_outpatient\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'advanced_illness' as exclusion_type\r\n , claim_start_date\r\n , claim_end_date\r\n , procedure_date\r\n , patient_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions_unioned", "language": "sql", "refs": [{"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_advanced_illness.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'advanced illness'\n , 'acute inpatient'\n , 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n where lower(exclusion_codes.concept_name) = 'advanced illness'\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, acute_inpatient as (\n\n select distinct\n patients_with_frailty.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n , cast(null as date) as procedure_date\n from patients_with_frailty\n inner join med_claim_exclusions\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\n inner join condition_exclusions\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\n where lower(med_claim_exclusions.concept_name) = 'acute inpatient'\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , cast(null as date) as claim_start_date\n , cast(null as date) as claim_end_date\n , procedure_exclusions.procedure_date\n from patients_with_frailty\n inner join procedure_exclusions\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\n inner join condition_exclusions\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\n where lower(procedure_exclusions.concept_name) = 'acute inpatient'\n\n)\n\n, nonacute_outpatient as (\n\n select distinct\n patients_with_frailty.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n , cast(null as date) as procedure_date\n from patients_with_frailty\n inner join med_claim_exclusions\n on patients_with_frailty.patient_id = med_claim_exclusions.patient_id\n inner join condition_exclusions\n on med_claim_exclusions.claim_id = condition_exclusions.claim_id\n where lower(med_claim_exclusions.concept_name) in (\n 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n union all\n\n select distinct\n patients_with_frailty.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n , cast(null as date) as claim_start_date\n , cast(null as date) as claim_end_date\n , procedure_exclusions.procedure_date\n from patients_with_frailty\n inner join procedure_exclusions\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\n inner join condition_exclusions\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\n where lower(procedure_exclusions.concept_name) in (\n 'encounter inpatient'\n , 'outpatient'\n , 'observation'\n , 'emergency department visit'\n , 'nonacute inpatient'\n )\n\n)\n\n, exclusions_unioned as (\n\n select\n acute_inpatient.patient_id\n , acute_inpatient.exclusion_date\n , acute_inpatient.exclusion_reason\n , acute_inpatient.claim_start_date\n , acute_inpatient.claim_end_date\n , acute_inpatient.procedure_date\n , 'acute_inpatient' as patient_type\n from acute_inpatient\n\n union all\n\n select\n nonacute_outpatient.patient_id\n , nonacute_outpatient.exclusion_date\n , nonacute_outpatient.exclusion_reason\n , nonacute_outpatient.claim_start_date\n , nonacute_outpatient.claim_end_date\n , nonacute_outpatient.procedure_date\n , 'nonacute_outpatient' as patient_type\n from nonacute_outpatient\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'advanced_illness' as exclusion_type\n , claim_start_date\n , claim_end_date\n , procedure_date\n , patient_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom exclusions_unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_dementia"], "alias": "_int_shared_exclusions_dementia", "checksum": {"name": "sha256", "checksum": "2940b3292df3f2c9c540d84621c1fffb9b4c331d9b0286a1eb527a5fd8a5628a"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and taking dementia medications for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8353171, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_dementia", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_shared_exclusions_frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'dementia medications'\r\n )\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claim as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, medication_exclusions as (\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.rxnorm_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'rxnorm'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.source_code = exclusion_codes.code\r\n and medications.source_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, pharmacy_claim_exclusions as (\r\n\r\n select\r\n pharmacy_claim.patient_id\r\n , pharmacy_claim.dispensing_date\r\n , pharmacy_claim.ndc_code\r\n , pharmacy_claim.paid_date\r\n , exclusion_codes.concept_name\r\n from pharmacy_claim\r\n inner join exclusion_codes\r\n on pharmacy_claim.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n)\r\n\r\n, frailty_with_dementia as (\r\n\r\n select\r\n patients_with_frailty.patient_id\r\n , patients_with_frailty.exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || pharmacy_claim_exclusions.concept_name\r\n as exclusion_reason\r\n , pharmacy_claim_exclusions.dispensing_date\r\n , pharmacy_claim_exclusions.paid_date\r\n from patients_with_frailty\r\n inner join pharmacy_claim_exclusions\r\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients_with_frailty.patient_id\r\n , medication_exclusions.dispensing_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || medication_exclusions.concept_name\r\n as exclusion_reason\r\n , medication_exclusions.dispensing_date\r\n , null as paid_date\r\n from patients_with_frailty\r\n inner join medication_exclusions\r\n on patients_with_frailty.patient_id = medication_exclusions.patient_id\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'dementia' as exclusion_type\r\n , dispensing_date\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom frailty_with_dementia", "language": "sql", "refs": [{"name": "quality_measures__int_shared_exclusions_frailty", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__medication", "package": null, "version": null}, {"name": "quality_measures__stg_pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_dementia.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n),patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from dev_thuxuan.quality_measures._int_shared_exclusions_frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'dementia medications'\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n, medication_exclusions as (\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.rxnorm_code = exclusion_codes.code\n where exclusion_codes.code_system = 'rxnorm'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join exclusion_codes\n on pharmacy_claim.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n)\n\n, frailty_with_dementia as (\n\n select\n patients_with_frailty.patient_id\n , patients_with_frailty.exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n , pharmacy_claim_exclusions.dispensing_date\n , pharmacy_claim_exclusions.paid_date\n from patients_with_frailty\n inner join pharmacy_claim_exclusions\n on patients_with_frailty.patient_id = pharmacy_claim_exclusions.patient_id\n\n union all\n\n select\n patients_with_frailty.patient_id\n , medication_exclusions.dispensing_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || medication_exclusions.concept_name\n as exclusion_reason\n , medication_exclusions.dispensing_date\n , null as paid_date\n from patients_with_frailty\n inner join medication_exclusions\n on patients_with_frailty.patient_id = medication_exclusions.patient_id\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'dementia' as exclusion_type\n , dispensing_date\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom frailty_with_dementia", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_frailty", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_frailty"], "alias": "_int_shared_exclusions_frailty", "checksum": {"name": "sha256", "checksum": "41e832cc78098a822ad3583681601d409417ce80cbd2dde8b8c9936f640cd788"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty used by other exclusion models.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_frailty", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8298066, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_frailty", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n | as_bool\r\n )\r\n}}\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where lower(concept_name) in (\r\n 'frailty device'\r\n , 'frailty diagnosis'\r\n , 'frailty encounter'\r\n , 'frailty symptom'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_frailty as (\r\n\r\n select\r\n patients.patient_id\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join condition_exclusions\r\n on patients.patient_id = condition_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , coalesce(\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , med_claim_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join med_claim_exclusions\r\n on patients.patient_id = med_claim_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join observation_exclusions\r\n on patients.patient_id = observation_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n patients.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from patients\r\n inner join procedure_exclusions\r\n on patients.patient_id = procedure_exclusions.patient_id\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_frailty", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_frailty.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),patients as (\n\n select\n patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'frailty device'\n , 'frailty diagnosis'\n , 'frailty encounter'\n , 'frailty symptom'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_frailty as (\n\n select\n patients.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from patients\n inner join condition_exclusions\n on patients.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , med_claim_exclusions.concept_name as exclusion_reason\n from patients\n inner join med_claim_exclusions\n on patients.patient_id = med_claim_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from patients\n inner join observation_exclusions\n on patients.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n patients.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from patients\n inner join procedure_exclusions\n on patients.patient_id = procedure_exclusions.patient_id\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom patients_with_frailty", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_hospice_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_hospice_palliative"], "alias": "_int_shared_exclusions_hospice_palliative", "checksum": {"name": "sha256", "checksum": "f1bfe290ff54fbfdaea6c4272887d140cc960e09b7e336caf7a7ffb53e7d2e14"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_hospice_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using hospice or palliative services for the reporting for entire patient population.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_hospice_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8373225, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_hospice_palliative", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR EXCLUSIONS:\r\nPatient was provided hospice services any time during the measurement period: G9687\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where lower(concept_name) in (\r\n 'hospice encounter'\r\n , 'hospice care ambulatory'\r\n , 'hospice diagnosis'\r\n , 'palliative care encounter'\r\n , 'palliative care diagnosis'\r\n , 'palliative care intervention'\r\n )\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }} \r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n \r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'hospice_palliative' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [{"name": "quality_measures__value_sets", "package": null, "version": null}, {"name": "quality_measures__stg_core__condition", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}, {"name": "quality_measures__stg_core__observation", "package": null, "version": null}, {"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_hospice_palliative.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatient was provided hospice services any time during the measurement period: G9687\n*/\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n), __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n),exclusion_codes as (\n\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From dev_thuxuan.quality_measures._value_set_codes\n where lower(concept_name) in (\n 'hospice encounter'\n , 'hospice care ambulatory'\n , 'hospice diagnosis'\n , 'palliative care encounter'\n , 'palliative care diagnosis'\n , 'palliative care intervention'\n )\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition \n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n \n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'hospice_palliative' as exclusion_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__int_shared_exclusions_institutional_snp", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "original_file_path": "models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "shared_exclusions", "quality_measures__int_shared_exclusions_institutional_snp"], "alias": "_int_shared_exclusions_institutional_snp", "checksum": {"name": "sha256", "checksum": "03caa2b62da546757a1b900c660c7f8a0f23287be4b454f03667d0617b28c01f"}, "config": {"enabled": true, "alias": "_int_shared_exclusions_institutional_snp", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients staying in an institution for the reporting for entire patient population. \n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_shared_exclusions_institutional_snp", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8403225, "relation_name": "dev_thuxuan.quality_measures._int_shared_exclusions_institutional_snp", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',false)))) | as_bool\r\n )\r\n}}\r\n\r\n/*\r\n patients in institutional special needs plans (snp)\r\n or residing in long term care\r\n\r\n while referencing this model, patients greater or equal than 66 years of age should be taken\r\n\r\n filtering out age from this model has been stripped out as different measures calculate age varingly\r\n\r\n future enhancement: group claims into encounters\r\n*/\r\n\r\nwith patients as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patients.patient_id\r\n , coalesce(\r\n medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n ) as exclusion_date\r\n , 'institutional or long term care' as exclusion_reason\r\n from patients\r\n inner join medical_claim\r\n on patients.patient_id = medical_claim.patient_id\r\n where place_of_service_code in ('32', '33', '34', '54', '56')\r\n and {{ datediff('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , 'institutional_snp' as exclusion_type\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}, {"name": "quality_measures__stg_medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\shared_exclusions\\quality_measures__int_shared_exclusions_institutional_snp.sql", "compiled": true, "compiled_code": "\n\n/*\n patients in institutional special needs plans (snp)\n or residing in long term care\n\n while referencing this model, patients greater or equal than 66 years of age should be taken\n\n filtering out age from this model has been stripped out as different measures calculate age varingly\n\n future enhancement: group claims into encounters\n*/\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n),patients as (\n\n select\n patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, exclusions as (\n\n select\n patients.patient_id\n , coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) as exclusion_date\n , 'institutional or long term care' as exclusion_reason\n from patients\n inner join medical_claim\n on patients.patient_id = medical_claim.patient_id\n where place_of_service_code in ('32', '33', '34', '54', '56')\n and datediff(\n day,\n medical_claim.claim_start_date,\n medical_claim.claim_end_date\n ) >= 90\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , 'institutional_snp' as exclusion_type\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__condition": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__condition.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__condition", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "83b38f12430d4d586bce68f972fd1c2ba390d1ea178782670bfd513f5f8610e9"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_condition", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0008163, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , claim_id\r\n , encounter_id\r\n , recorded_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__encounter", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__encounter"], "alias": "_stg_encounter", "checksum": {"name": "sha256", "checksum": "a3443484db1043881df846fd9f70a819d815afd999ea5c56eb82a9f3e360072b"}, "config": {"enabled": true, "alias": "_stg_encounter", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_encounter", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0059066, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__lab_result": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__lab_result"], "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "ad96153c6aca551e49b0e78f873a704e2b6fd76c2181a3dfb5cf34238b80221f"}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging lab results from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_lab_result", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.042441, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , result\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , result\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.lab_result\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__medication": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__medication.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__medication", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__medication"], "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "4495dfb2b1f1f38347ad84085b8c196f1bd82f6cd23dca409d63aea68ba04032"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medication", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0109034, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , prescribing_date \r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , prescribing_date \r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as prescribing_date \r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__observation.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__observation", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__observation"], "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "510b931bca7c0ce78fbe5ae342ea19fac117305e04aacbaff85a2994aaf674f6"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_observation", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.015903, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , observation_date\r\n , result\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_id\r\n , observation_date\r\n , result\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , normalized_description\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__patient.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__patient", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "34acce40b2eeb227e56056c3e339265f96561013b169cabc3c9e5657936d4d43"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_patient", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0224133, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [{"name": "core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__procedure", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__procedure"], "alias": "_stg_procedure", "checksum": {"name": "sha256", "checksum": "62de434fe15e7aef39abb3b5fb5941f5140f730cd5b2f62293918121f99c2701"}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_procedure", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.027413, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , encounter_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_medical_claim", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "0924c34bacda1b808985a33ec5c31a7363f8604e7e5344756691ee3207beb122"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medical_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0319233, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , place_of_service_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , place_of_service_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_end_date\r\n , cast(null as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(null as {{ dbt.type_string() }} ) as hcpcs_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_pharmacy_claim"], "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "813cb6e8aa1b64da07582544c522b3b7aa14efc7860754e6ff74d0d929115ec3"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_pharmacy_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0374532, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [{"name": "core__pharmacy_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_augmented", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\final\\readmissions__encounter_augmented.sql", "original_file_path": "models\\readmissions\\final\\readmissions__encounter_augmented.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_augmented", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__encounter_augmented"], "alias": "encounter_augmented", "checksum": {"name": "sha256", "checksum": "a74fad427b28b6a97be138cfa36320c4ee92d97a9fb353c60db1049cbfa92a49"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "encounter_augmented", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.077498, "relation_name": "dev_thuxuan.readmissions.encounter_augmented", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all encounters from the stg_encounter model\r\n-- and we augment them with extra fields\r\n-- that are relevant for readmission measures\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n {{ dbt.datediff(\"aa.admit_date\", \"aa.discharge_date\",\"day\") }} as length_of_stay,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as index_admission_flag,\r\n case\r\n when cc.encounter_id is not null then 1\r\n\t else 0\r\n end as planned_flag,\r\n dd.specialty_cohort,\r\n case\r\n when aa.discharge_disposition_code = '20' then 1\r\n\t else 0\r\n end as died_flag,\r\n ee.diagnosis_ccs,\r\n ee.disqualified_encounter_flag,\r\n ee.missing_admit_date_flag,\r\n ee.missing_discharge_date_flag,\r\n ee.admit_after_discharge_flag,\r\n ee.missing_discharge_disposition_code_flag,\r\n ee.invalid_discharge_disposition_code_flag,\r\n ee.missing_primary_diagnosis_flag,\r\n ee.invalid_primary_diagnosis_code_flag,\r\n ee.no_diagnosis_ccs_flag,\r\n ee.overlaps_with_another_encounter_flag,\r\n ee.missing_ms_drg_flag,\r\n ee.invalid_ms_drg_flag,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('readmissions__index_admission') }} bb\r\n on aa.encounter_id = bb.encounter_id\r\n left join {{ ref('readmissions__planned_encounter') }} cc\r\n on aa.encounter_id = cc.encounter_id \r\n left join {{ ref('readmissions__encounter_specialty_cohort') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n left join {{ ref('readmissions__encounter_data_quality') }} ee\r\n on aa.encounter_id = ee.encounter_id", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_admission", "package": null, "version": null}, {"name": "readmissions__planned_encounter", "package": null, "version": null}, {"name": "readmissions__encounter_specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_data_quality", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_data_quality"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n datediff(\n day,\n aa.admit_date,\n aa.discharge_date\n ) as length_of_stay,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as index_admission_flag,\n case\n when cc.encounter_id is not null then 1\n\t else 0\n end as planned_flag,\n dd.specialty_cohort,\n case\n when aa.discharge_disposition_code = '20' then 1\n\t else 0\n end as died_flag,\n ee.diagnosis_ccs,\n ee.disqualified_encounter_flag,\n ee.missing_admit_date_flag,\n ee.missing_discharge_date_flag,\n ee.admit_after_discharge_flag,\n ee.missing_discharge_disposition_code_flag,\n ee.invalid_discharge_disposition_code_flag,\n ee.missing_primary_diagnosis_flag,\n ee.invalid_primary_diagnosis_code_flag,\n ee.no_diagnosis_ccs_flag,\n ee.overlaps_with_another_encounter_flag,\n ee.missing_ms_drg_flag,\n ee.invalid_ms_drg_flag,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom\n dev_thuxuan.readmissions._int_encounter aa\n left join dev_thuxuan.readmissions._int_index_admission bb\n on aa.encounter_id = bb.encounter_id\n left join dev_thuxuan.readmissions._int_planned_encounter cc\n on aa.encounter_id = cc.encounter_id \n left join dev_thuxuan.readmissions._int_encounter_specialty_cohort dd\n on aa.encounter_id = dd.encounter_id\n left join dev_thuxuan.readmissions._int_encounter_data_quality ee\n on aa.encounter_id = ee.encounter_id", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__readmission_summary": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__readmission_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\final\\readmissions__readmission_summary.sql", "original_file_path": "models\\readmissions\\final\\readmissions__readmission_summary.sql", "unique_id": "model.the_tuva_project.readmissions__readmission_summary", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__readmission_summary"], "alias": "readmission_summary", "checksum": {"name": "sha256", "checksum": "e6637fd7ecf32a70431475e54250a0e77de311d0acfa8ce58062888772be52f6"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "readmission_summary", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0940332, "relation_name": "dev_thuxuan.readmissions.readmission_summary", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here calculate days to readmission for encounters\r\n-- that had a readmission and create readmission flags\r\n\r\n\r\n-- We create the encounter_sequence integer count\r\n-- which keeps track of what number of encounter each\r\n-- encounter is for a given patient\r\nwith encounter_sequence as (\r\nselect\r\n *,\r\n row_number() over(\r\n partition by patient_id order by admit_date, discharge_date\r\n ) as encounter_seq\r\nfrom {{ ref('readmissions__encounter_augmented') }}\r\nwhere disqualified_encounter_flag = 0\r\n),\r\n\r\n\r\nreadmission_calc as (\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n aa.length_of_stay,\r\n aa.index_admission_flag,\r\n aa.planned_flag,\r\n aa.specialty_cohort,\r\n aa.died_flag,\r\n aa.diagnosis_ccs,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as had_readmission_flag,\r\n {{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }} as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }}) <= 30 then 1\r\n\t else 0\r\n end as readmit_30_flag,\r\n case\r\n when\r\n\t (({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\", \"day\") }}) <= 30) and (bb.planned_flag = 0) then 1\r\n\t else 0\r\n end as unplanned_readmit_30_flag,\r\n bb.encounter_id as readmission_encounter_id,\r\n bb.admit_date as readmission_admit_date,\r\n bb.discharge_date as readmission_discharge_date,\r\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\r\n bb.facility_npi as readmission_facility,\r\n bb.ms_drg_code as readmission_ms_drg,\r\n bb.length_of_stay as readmission_length_of_stay,\r\n bb.index_admission_flag as readmission_index_admission_flag,\r\n bb.planned_flag as readmission_planned_flag,\r\n bb.specialty_cohort as readmission_specialty_cohort,\r\n bb.died_flag as readmission_died_flag,\r\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n encounter_sequence aa\r\n left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\nselect *\r\nfrom readmission_calc", "language": "sql", "refs": [{"name": "readmissions__encounter_augmented", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "compiled": true, "compiled_code": "\n\n-- Here calculate days to readmission for encounters\n-- that had a readmission and create readmission flags\n\n\n-- We create the encounter_sequence integer count\n-- which keeps track of what number of encounter each\n-- encounter is for a given patient\nwith encounter_sequence as (\nselect\n *,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom dev_thuxuan.readmissions.encounter_augmented\nwhere disqualified_encounter_flag = 0\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.length_of_stay,\n aa.index_admission_flag,\n aa.planned_flag,\n aa.specialty_cohort,\n aa.died_flag,\n aa.diagnosis_ccs,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as had_readmission_flag,\n datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n ) as days_to_readmit,\n case\n when (datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30 then 1\n\t else 0\n end as readmit_30_flag,\n case\n when\n\t ((datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30) and (bb.planned_flag = 0) then 1\n\t else 0\n end as unplanned_readmit_30_flag,\n bb.encounter_id as readmission_encounter_id,\n bb.admit_date as readmission_admit_date,\n bb.discharge_date as readmission_discharge_date,\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\n bb.facility_npi as readmission_facility,\n bb.ms_drg_code as readmission_ms_drg,\n bb.length_of_stay as readmission_length_of_stay,\n bb.index_admission_flag as readmission_index_admission_flag,\n bb.planned_flag as readmission_planned_flag,\n bb.specialty_cohort as readmission_specialty_cohort,\n bb.died_flag as readmission_died_flag,\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom\n encounter_sequence aa\n left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\nselect *\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__encounter", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter"], "alias": "_int_encounter", "checksum": {"name": "sha256", "checksum": "2987ab00297e4cfd0b5b334082bee5fb074ef3d8057837b0c53d7bae3f4641d0"}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1427803, "relation_name": "dev_thuxuan.readmissions._int_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Staging model for the input layer:\r\n-- stg_encounter input layer model.\r\n-- This contains one row for every unique encounter in the dataset.\r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }}) as encounter_id,\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id,\r\n cast(encounter_start_date as date) as admit_date,\r\n cast(encounter_end_date as date) as discharge_date,\r\n cast(discharge_disposition_code as {{ dbt.type_string() }}) as discharge_disposition_code,\r\n cast(facility_npi as {{ dbt.type_string() }}) as facility_npi,\r\n cast(ms_drg_code as {{ dbt.type_string() }}) as ms_drg_code,\r\n cast(paid_amount as numeric) as paid_amount,\r\n cast(primary_diagnosis_code as {{ dbt.type_string() }}) as primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "refs": [{"name": "readmissions__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'\n)-- Staging model for the input layer:\n-- stg_encounter input layer model.\n-- This contains one row for every unique encounter in the dataset.\n\nselect\n cast(encounter_id as TEXT) as encounter_id,\n cast(patient_id as TEXT) as patient_id,\n cast(encounter_start_date as date) as admit_date,\n cast(encounter_end_date as date) as discharge_date,\n cast(discharge_disposition_code as TEXT) as discharge_disposition_code,\n cast(facility_npi as TEXT) as facility_npi,\n cast(ms_drg_code as TEXT) as ms_drg_code,\n cast(paid_amount as numeric) as paid_amount,\n cast(primary_diagnosis_code as TEXT) as primary_diagnosis_code,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom __dbt__cte__readmissions__stg_core__encounter", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__encounter", "sql": " __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_data_quality", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_data_quality"], "alias": "_int_encounter_data_quality", "checksum": {"name": "sha256", "checksum": "85bf70dcffff48c401c303e894eff2d2e1da14d93417696f3e14fd59a3dfe9f0"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_data_quality", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.0990498, "relation_name": "dev_thuxuan.readmissions._int_encounter_data_quality", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all encounters from the stg_encounter table\r\n-- with data quality flags that may disqualify them from\r\n-- being used for readmission measures \r\n\r\n\r\n-- Flag several potential data quality issues\r\n-- with all encounters.\r\n-- Every encounter_id from the stg_encounter model\r\n-- will be here. This CTE should have the same\r\n-- number of rows as the stg_encounter model, i.e.,\r\n-- there is a one to one correspondence between the\r\n-- rows in stg_encounter and this CTE.\r\nwith encounter_data_quality_issues as (\r\nselect\r\n aa.encounter_id,\r\n case\r\n when aa.admit_date is null then 1\r\n\telse 0\r\n end as missing_admit_date_flag,\r\n case\r\n when aa.discharge_date is null then 1\r\n\telse 0\r\n end as missing_discharge_date_flag,\r\n case\r\n when aa.admit_date > aa.discharge_date then 1\r\n\telse 0\r\n end as admit_after_discharge_flag,\r\n case\r\n when aa.discharge_disposition_code is null then 1\r\n\telse 0\r\n end as missing_discharge_disposition_code_flag,\r\n case\r\n when\r\n\t (aa.discharge_disposition_code is not null)\r\n\t and\r\n\t (bb.discharge_disposition_code is null) then 1\r\n\telse 0\r\n end as invalid_discharge_disposition_code_flag,\r\n case\r\n when aa.primary_diagnosis_code is null then 1\r\n else 0\r\n end as missing_primary_diagnosis_flag,\r\n case\r\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\r\n\telse 0\r\n end as invalid_primary_diagnosis_code_flag,\r\n case\r\n when aa.ccs_diagnosis_category is null then 1\r\n\telse 0\r\n end as no_diagnosis_ccs_flag,\r\n aa.ccs_diagnosis_category as diagnosis_ccs,\r\n case\r\n when aa.encounter_id in (select distinct encounter_id_A\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\t or\r\n\t aa.encounter_id in (select distinct encounter_id_B\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\tthen 1\r\n\telse 0\r\n end as overlaps_with_another_encounter_flag,\r\n case\r\n when aa.ms_drg_code is null then 1\r\n\telse 0\r\n end as missing_ms_drg_flag,\r\n case\r\n when cc.ms_drg_code is null then 1\r\n\telse 0\r\n end as invalid_ms_drg_flag\r\n\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} aa\r\n left join {{ ref('terminology__discharge_disposition') }} bb\r\n on aa.discharge_disposition_code = bb.discharge_disposition_code\r\n left join {{ ref('terminology__ms_drg') }} cc\r\n on aa.ms_drg_code = cc.ms_drg_code\r\n),\r\n\r\n\r\n-- Here we add a disqualified_encounter_flag.\r\n-- This disqualified_encounter_flag = 1\r\n-- when any of the critical data quality flags\r\n-- from the above CTE are equal to 1.\r\nall_data_quality_flags as (\r\nselect\r\n encounter_id,\r\n diagnosis_ccs,\r\n case\r\n when\r\n\t (missing_admit_date_flag = 1)\r\n\t or\r\n\t (missing_discharge_date_flag = 1)\r\n\t or\r\n\t (admit_after_discharge_flag = 1)\r\n\t or\r\n\t (missing_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (invalid_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (missing_primary_diagnosis_flag = 1)\r\n\t or\r\n\t (invalid_primary_diagnosis_code_flag = 1)\r\n\t or\r\n\t (no_diagnosis_ccs_flag = 1)\r\n\t or\r\n\t (overlaps_with_another_encounter_flag = 1)\r\n\t or\r\n\t (missing_ms_drg_flag = 1)\r\n\t or\r\n\t (invalid_ms_drg_flag = 1)\r\n\t then 1\r\n\telse 0\r\n end as disqualified_encounter_flag,\r\n missing_admit_date_flag,\r\n missing_discharge_date_flag,\r\n admit_after_discharge_flag,\r\n missing_discharge_disposition_code_flag,\r\n invalid_discharge_disposition_code_flag,\r\n missing_primary_diagnosis_flag,\r\n invalid_primary_diagnosis_code_flag,\r\n no_diagnosis_ccs_flag,\r\n overlaps_with_another_encounter_flag,\r\n missing_ms_drg_flag,\r\n invalid_ms_drg_flag\r\nfrom encounter_data_quality_issues\r\n) \r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_data_quality_flags", "language": "sql", "refs": [{"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "terminology__discharge_disposition", "package": null, "version": null}, {"name": "terminology__ms_drg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter table\n-- with data quality flags that may disqualify them from\n-- being used for readmission measures \n\n\n-- Flag several potential data quality issues\n-- with all encounters.\n-- Every encounter_id from the stg_encounter model\n-- will be here. This CTE should have the same\n-- number of rows as the stg_encounter model, i.e.,\n-- there is a one to one correspondence between the\n-- rows in stg_encounter and this CTE.\nwith encounter_data_quality_issues as (\nselect\n aa.encounter_id,\n case\n when aa.admit_date is null then 1\n\telse 0\n end as missing_admit_date_flag,\n case\n when aa.discharge_date is null then 1\n\telse 0\n end as missing_discharge_date_flag,\n case\n when aa.admit_date > aa.discharge_date then 1\n\telse 0\n end as admit_after_discharge_flag,\n case\n when aa.discharge_disposition_code is null then 1\n\telse 0\n end as missing_discharge_disposition_code_flag,\n case\n when\n\t (aa.discharge_disposition_code is not null)\n\t and\n\t (bb.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when aa.primary_diagnosis_code is null then 1\n else 0\n end as missing_primary_diagnosis_flag,\n case\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when aa.ccs_diagnosis_category is null then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n aa.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from dev_thuxuan.readmissions._int_encounter_overlap )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from dev_thuxuan.readmissions._int_encounter_overlap )\n\tthen 1\n\telse 0\n end as overlaps_with_another_encounter_flag,\n case\n when aa.ms_drg_code is null then 1\n\telse 0\n end as missing_ms_drg_flag,\n case\n when cc.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs aa\n left join dev_thuxuan.terminology.discharge_disposition bb\n on aa.discharge_disposition_code = bb.discharge_disposition_code\n left join dev_thuxuan.terminology.ms_drg cc\n on aa.ms_drg_code = cc.ms_drg_code\n),\n\n\n-- Here we add a disqualified_encounter_flag.\n-- This disqualified_encounter_flag = 1\n-- when any of the critical data quality flags\n-- from the above CTE are equal to 1.\nall_data_quality_flags as (\nselect\n encounter_id,\n diagnosis_ccs,\n case\n when\n\t (missing_admit_date_flag = 1)\n\t or\n\t (missing_discharge_date_flag = 1)\n\t or\n\t (admit_after_discharge_flag = 1)\n\t or\n\t (missing_discharge_disposition_code_flag = 1)\n\t or\n\t (invalid_discharge_disposition_code_flag = 1)\n\t or\n\t (missing_primary_diagnosis_flag = 1)\n\t or\n\t (invalid_primary_diagnosis_code_flag = 1)\n\t or\n\t (no_diagnosis_ccs_flag = 1)\n\t or\n\t (overlaps_with_another_encounter_flag = 1)\n\t or\n\t (missing_ms_drg_flag = 1)\n\t or\n\t (invalid_ms_drg_flag = 1)\n\t then 1\n\telse 0\n end as disqualified_encounter_flag,\n missing_admit_date_flag,\n missing_discharge_date_flag,\n admit_after_discharge_flag,\n missing_discharge_disposition_code_flag,\n invalid_discharge_disposition_code_flag,\n missing_primary_diagnosis_flag,\n invalid_primary_diagnosis_code_flag,\n no_diagnosis_ccs_flag,\n overlaps_with_another_encounter_flag,\n missing_ms_drg_flag,\n invalid_ms_drg_flag\nfrom encounter_data_quality_issues\n) \n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_overlap", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_overlap.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_overlap", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_overlap"], "alias": "_int_encounter_overlap", "checksum": {"name": "sha256", "checksum": "f962709bed5f4396f7956a8658c9f97ea39e81b7ab403a706e0bc323fe61f253"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_overlap", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1036491, "relation_name": "dev_thuxuan.readmissions._int_encounter_overlap", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we give a list of all pairs of encounters\r\n-- that have some date overlap.\r\n\r\n\r\nwith encounters_with_row_num as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over (\r\n partition by patient_id order by encounter_id\r\n\t) as row_num\r\nfrom {{ ref('readmissions__encounter') }}\r\n),\r\n\r\n\r\ncartesian as (\r\nselect\r\n aa.encounter_id as encounter_id_A,\r\n bb.encounter_id as encounter_id_B,\r\n aa.patient_id,\r\n aa.admit_date as Ai,\r\n aa.discharge_date as Af,\r\n bb.admit_date as Bi,\r\n bb.discharge_date as Bf,\r\n case\r\n when (aa.admit_date between bb.admit_date and bb.discharge_date) or (aa.discharge_date between bb.admit_date and bb.discharge_date) or\r\n (bb.admit_date between aa.admit_date and aa.discharge_date) or (bb.discharge_date between aa.admit_date and aa.discharge_date)\r\n then 1\r\n else 0\r\n end as overlap\r\n from encounters_with_row_num aa\r\n left join encounters_with_row_num bb\r\n on aa.patient_id = bb.patient_id and aa.row_num < bb.row_num\r\n),\r\n\r\n\r\noverlapping_pairs\r\nas\r\n(\r\n select\r\n patient_id,\r\n encounter_id_A,\r\n\tencounter_id_B\r\n from cartesian\r\n where overlap = 1\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom overlapping_pairs", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "compiled": true, "compiled_code": "\n\n-- Here we give a list of all pairs of encounters\n-- that have some date overlap.\n\n\nwith encounters_with_row_num as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over (\n partition by patient_id order by encounter_id\n\t) as row_num\nfrom dev_thuxuan.readmissions._int_encounter\n),\n\n\ncartesian as (\nselect\n aa.encounter_id as encounter_id_A,\n bb.encounter_id as encounter_id_B,\n aa.patient_id,\n aa.admit_date as Ai,\n aa.discharge_date as Af,\n bb.admit_date as Bi,\n bb.discharge_date as Bf,\n case\n when (aa.admit_date between bb.admit_date and bb.discharge_date) or (aa.discharge_date between bb.admit_date and bb.discharge_date) or\n (bb.admit_date between aa.admit_date and aa.discharge_date) or (bb.discharge_date between aa.admit_date and aa.discharge_date)\n then 1\n else 0\n end as overlap\n from encounters_with_row_num aa\n left join encounters_with_row_num bb\n on aa.patient_id = bb.patient_id and aa.row_num < bb.row_num\n),\n\n\noverlapping_pairs\nas\n(\n select\n patient_id,\n encounter_id_A,\n\tencounter_id_B\n from cartesian\n where overlap = 1\n)\n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_specialty_cohort", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_specialty_cohort"], "alias": "_int_encounter_specialty_cohort", "checksum": {"name": "sha256", "checksum": "28c65aded20c36a73d5fa59261d9b4042b2839b17242ddd308df2c7975a43b48"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_specialty_cohort", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1096435, "relation_name": "dev_thuxuan.readmissions._int_encounter_specialty_cohort", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list the specialty cohort for each encounter that has\r\n-- an associated specialty cohort.\r\n-- There are 5 possible specialty cohorts:\r\n-- [1] Medicine\r\n-- [2] Surgery/Gynecology\r\n-- [3] Cardiology\r\n-- [4] Cardiovascular\r\n-- [5] Neurology\r\n-- An encounter that has an ICD-10-PCS procedure code or a\r\n-- CCS procedure category that corresponds to the\r\n-- 'Surgery/Gynecology' cohort will always be in that cohort.\r\n-- For encounters that are not in the 'Surgery/Gynecology' cohort,\r\n-- we then check to see if they are in one of the other 4 cohorts.\r\n\r\n--ranking to eventually assign a cohort to encounters in multiple cohorts\r\nwith cohort_ranks as (\r\n select 'Surgery/Gynecology' as cohort, 1 as c_rank\r\n union all\r\n select 'Cardiorespiratory' as cohort, 2 as c_rank\r\n union all\r\n select 'Cardiovascular' as cohort, 3 as c_rank\r\n union all\r\n select 'Neurology' as cohort, 4 as c_rank\r\n union all\r\n select 'Medicine' as cohort, 5 as c_rank\r\n)\r\n\r\n\r\n--get all encounter ids in any procedure or diagnosis based cohorts\r\n, all_encounter_cohorts as (\r\n\r\n --encounter ids in procedure based cohorts\r\n select proc.encounter_id, 1 as c_rank\r\n from {{ ref('readmissions__procedure_ccs') }} proc\r\n left join {{ ref('readmissions__surgery_gynecology_cohort') }} sgc\r\n on proc.procedure_code = sgc.icd_10_pcs\r\n left join {{ ref('readmissions__specialty_cohort') }} sgsc\r\n on proc.ccs_procedure_category = sgsc.ccs and sgsc.specialty_cohort = 'Surgery/Gynecology'\r\n where sgc.icd_10_pcs is not null or sgsc.ccs is not null\r\n\r\n union all\r\n\r\n --encounter ids in diagnosis based cohorts\r\n select diag.encounter_id, cohort_ranks.c_rank\r\n from {{ ref('readmissions__encounter_with_ccs') }} diag\r\n inner join {{ ref('readmissions__specialty_cohort') }} sc\r\n on diag.ccs_diagnosis_category = sc.ccs and sc.procedure_or_diagnosis = 'Diagnosis'\r\n inner join cohort_ranks\r\n on sc.specialty_cohort = cohort_ranks.cohort\r\n)\r\n\r\n\r\n-- getting one cohort per encounter\r\n, main_encounter_cohort as (\r\n select encounter_id, min(c_rank) as main_c_rank\r\n from all_encounter_cohorts\r\n group by encounter_id\r\n\r\n)\r\n\r\n\r\n--getting all encounters, with labeled cohorts, if no cohort cohort is \"medicine\"\r\nselect enc.encounter_id, coalesce(cohort_ranks.cohort, 'Medicine') as specialty_cohort, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join main_encounter_cohort mec\r\n on enc.encounter_id = mec.encounter_id\r\nleft join cohort_ranks\r\n on mec.main_c_rank = cohort_ranks.c_rank", "language": "sql", "refs": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__surgery_gynecology_cohort", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__specialty_cohort", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "compiled": true, "compiled_code": "\n\n-- Here we list the specialty cohort for each encounter that has\n-- an associated specialty cohort.\n-- There are 5 possible specialty cohorts:\n-- [1] Medicine\n-- [2] Surgery/Gynecology\n-- [3] Cardiology\n-- [4] Cardiovascular\n-- [5] Neurology\n-- An encounter that has an ICD-10-PCS procedure code or a\n-- CCS procedure category that corresponds to the\n-- 'Surgery/Gynecology' cohort will always be in that cohort.\n-- For encounters that are not in the 'Surgery/Gynecology' cohort,\n-- we then check to see if they are in one of the other 4 cohorts.\n\n--ranking to eventually assign a cohort to encounters in multiple cohorts\nwith cohort_ranks as (\n select 'Surgery/Gynecology' as cohort, 1 as c_rank\n union all\n select 'Cardiorespiratory' as cohort, 2 as c_rank\n union all\n select 'Cardiovascular' as cohort, 3 as c_rank\n union all\n select 'Neurology' as cohort, 4 as c_rank\n union all\n select 'Medicine' as cohort, 5 as c_rank\n)\n\n\n--get all encounter ids in any procedure or diagnosis based cohorts\n, all_encounter_cohorts as (\n\n --encounter ids in procedure based cohorts\n select proc.encounter_id, 1 as c_rank\n from dev_thuxuan.readmissions._int_procedure_ccs proc\n left join dev_thuxuan.readmissions._value_set_surgery_gynecology_cohort sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join dev_thuxuan.readmissions._value_set_specialty_cohort sgsc\n on proc.ccs_procedure_category = sgsc.ccs and sgsc.specialty_cohort = 'Surgery/Gynecology'\n where sgc.icd_10_pcs is not null or sgsc.ccs is not null\n\n union all\n\n --encounter ids in diagnosis based cohorts\n select diag.encounter_id, cohort_ranks.c_rank\n from dev_thuxuan.readmissions._int_encounter_with_ccs diag\n inner join dev_thuxuan.readmissions._value_set_specialty_cohort sc\n on diag.ccs_diagnosis_category = sc.ccs and sc.procedure_or_diagnosis = 'Diagnosis'\n inner join cohort_ranks\n on sc.specialty_cohort = cohort_ranks.cohort\n)\n\n\n-- getting one cohort per encounter\n, main_encounter_cohort as (\n select encounter_id, min(c_rank) as main_c_rank\n from all_encounter_cohorts\n group by encounter_id\n\n)\n\n\n--getting all encounters, with labeled cohorts, if no cohort cohort is \"medicine\"\nselect enc.encounter_id, coalesce(cohort_ranks.cohort, 'Medicine') as specialty_cohort, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter enc\nleft join main_encounter_cohort mec\n on enc.encounter_id = mec.encounter_id\nleft join cohort_ranks\n on mec.main_c_rank = cohort_ranks.c_rank", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__encounter_with_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_with_ccs"], "alias": "_int_encounter_with_ccs", "checksum": {"name": "sha256", "checksum": "2f83bbfad722eac401d7efcd91792a7369b1ad1b20c1e29d16318c9de3caf85f"}, "config": {"enabled": true, "alias": "_int_encounter_with_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_with_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1126275, "relation_name": "dev_thuxuan.readmissions._int_encounter_with_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we add a CCS diagnosis category to\r\n-- every encounter that we can add a CCS diagnosis category to.\r\n-- The CCS diagnosis category is found using\r\n-- the encounter's primary diagnosis code.\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n aa.primary_diagnosis_code,\r\n\r\n case\r\n when bb.icd_10_cm is not null then 1\r\n else 0\r\n end as valid_primary_diagnosis_code_flag,\r\n\r\n cc.ccs_diagnosis_category,\r\n\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('terminology__icd_10_cm') }} bb\r\n on aa.primary_diagnosis_code = bb.icd_10_cm\r\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\r\n on aa.primary_diagnosis_code = cc.icd_10_cm", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "terminology__icd_10_cm", "package": null, "version": null}, {"name": "readmissions__icd_10_cm_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "compiled": true, "compiled_code": "\n\n-- Here we add a CCS diagnosis category to\n-- every encounter that we can add a CCS diagnosis category to.\n-- The CCS diagnosis category is found using\n-- the encounter's primary diagnosis code.\n\n\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.primary_diagnosis_code,\n\n case\n when bb.icd_10_cm is not null then 1\n else 0\n end as valid_primary_diagnosis_code_flag,\n\n cc.ccs_diagnosis_category,\n\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\n\nfrom\n dev_thuxuan.readmissions._int_encounter aa\n left join dev_thuxuan.terminology.icd_10_cm bb\n on aa.primary_diagnosis_code = bb.icd_10_cm\n left join dev_thuxuan.readmissions._value_set_icd_10_cm_to_ccs cc\n on aa.primary_diagnosis_code = cc.icd_10_cm", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__exclusion": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__exclusion", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__exclusion.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__exclusion.sql", "unique_id": "model.the_tuva_project.readmissions__exclusion", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__exclusion"], "alias": "_int_exclusion", "checksum": {"name": "sha256", "checksum": "b31e6649264b98b4fe7df0754f44c05dc3c88992718a139f0df3942b3920e93d"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_exclusion", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.116644, "relation_name": "dev_thuxuan.readmissions._int_exclusion", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that are excluded\r\n-- from being index admissions because they\r\n-- belong to one of these categories:\r\n-- [1] Medical Treatment of Cancer\r\n-- [2] Rehabilitation\r\n-- [3] Psychiatric\r\n\r\n\r\n-- encounter_ids for encounters that should be\r\n-- excluded because they belong to one of the\r\n-- exclusion categories\r\nwith exclusions as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }}\r\nwhere\r\n(ccs_diagnosis_category is not null)\r\nand\r\n(\r\nccs_diagnosis_category in\r\n (select distinct ccs_diagnosis_category\r\n from {{ ref('readmissions__exclusion_ccs_diagnosis_category') }} )\r\n)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [{"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__exclusion_ccs_diagnosis_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__exclusion.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that are excluded\n-- from being index admissions because they\n-- belong to one of these categories:\n-- [1] Medical Treatment of Cancer\n-- [2] Rehabilitation\n-- [3] Psychiatric\n\n\n-- encounter_ids for encounters that should be\n-- excluded because they belong to one of the\n-- exclusion categories\nwith exclusions as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs\nwhere\n(ccs_diagnosis_category is not null)\nand\n(\nccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from dev_thuxuan.readmissions._value_set_exclusion_ccs_diagnosis_category )\n)\n)\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_admission": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_admission", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_admission.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_admission.sql", "unique_id": "model.the_tuva_project.readmissions__index_admission", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_admission"], "alias": "_int_index_admission", "checksum": {"name": "sha256", "checksum": "dcb38723afc9f460fa4a604542fc958d1594b88e866be06132a22b1d40007e62"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_admission", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1196997, "relation_name": "dev_thuxuan.readmissions._int_index_admission", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list all index admissions for the hospital wide readmissions\r\n-- measure.\r\n-- These represent encounter_ids that meet the requirements to be an\r\n-- index admission for the HWR measure.\r\n-- These are the requirements for a hospitalization to be an index admission\r\n-- for the HWR measure:\r\n--\r\n-- Time Requirement: The discharge data must be at least 30 days\r\n-- earlier than the last dischareg date available\r\n-- in the dataset.\r\n-- \r\n-- Discharge Requirements: The patient must not be discharged to another\r\n-- acute care hospital; the patient must not have\r\n-- left against medical advice; and the patient\r\n-- must be alive at discharge.\r\n--\r\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\r\n-- (exclusions) diagnosis category we know the encounter was\r\n-- for medical treatment of cancer, rehabilitation,\r\n-- or psychiatric reasons.\r\n\r\n\r\n\r\nselect distinct a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\ninner join {{ ref('readmissions__index_time_requirement') }} b\r\n on a.encounter_id = b.encounter_id\r\ninner join {{ ref('readmissions__index_discharge_requirement') }} c\r\n on a.encounter_id = c.encounter_id\r\nleft join {{ ref('readmissions__exclusion') }} d\r\n on a.encounter_id = d.encounter_id\r\nwhere d.encounter_id is null", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__index_time_requirement", "package": null, "version": null}, {"name": "readmissions__index_discharge_requirement", "package": null, "version": null}, {"name": "readmissions__exclusion", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__exclusion"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all index admissions for the hospital wide readmissions\n-- measure.\n-- These represent encounter_ids that meet the requirements to be an\n-- index admission for the HWR measure.\n-- These are the requirements for a hospitalization to be an index admission\n-- for the HWR measure:\n--\n-- Time Requirement: The discharge data must be at least 30 days\n-- earlier than the last dischareg date available\n-- in the dataset.\n-- \n-- Discharge Requirements: The patient must not be discharged to another\n-- acute care hospital; the patient must not have\n-- left against medical advice; and the patient\n-- must be alive at discharge.\n--\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\n-- (exclusions) diagnosis category we know the encounter was\n-- for medical treatment of cancer, rehabilitation,\n-- or psychiatric reasons.\n\n\n\nselect distinct a.encounter_id, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter a\ninner join dev_thuxuan.readmissions._int_index_time_requirement b\n on a.encounter_id = b.encounter_id\ninner join dev_thuxuan.readmissions._int_index_discharge_requirement c\n on a.encounter_id = c.encounter_id\nleft join dev_thuxuan.readmissions._int_exclusion d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_discharge_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_discharge_requirement"], "alias": "_int_index_discharge_requirement", "checksum": {"name": "sha256", "checksum": "2b8b5e8b5553070da0cf0285073fbda99ccb81f78793989007f335d90c90351a"}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_discharge_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1227152, "relation_name": "dev_thuxuan.readmissions._int_index_discharge_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the discharge_disposition_code requirements to be an\r\n-- index admission:\r\n-- *** Must NOT be discharged to another acute care hospital\r\n-- *** Must NOT have left against medical advice\r\n-- *** Patient must be alive at discharge\r\n\r\n\r\n\r\nwith all_invalid_discharges as (\r\nselect encounter_id\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_disposition_code in (\r\n '02' -- Patient discharged/transferred to other short term general hospital for inpatient care.\r\n ,'07' -- Patient left against medical advice\r\n ,'20' -- Patient died\r\n )\r\n)\r\n\r\n-- All discharges that meet the discharge_disposition_code\r\n-- requirements to be an index admission\r\nselect a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\nleft join all_invalid_discharges b\r\n on a.encounter_id = b.encounter_id\r\nwhere b.encounter_id is null", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the discharge_disposition_code requirements to be an\n-- index admission:\n-- *** Must NOT be discharged to another acute care hospital\n-- *** Must NOT have left against medical advice\n-- *** Patient must be alive at discharge\n\n\n\nwith all_invalid_discharges as (\nselect encounter_id\nfrom dev_thuxuan.readmissions._int_encounter\nwhere discharge_disposition_code in (\n '02' -- Patient discharged/transferred to other short term general hospital for inpatient care.\n ,'07' -- Patient left against medical advice\n ,'20' -- Patient died\n )\n)\n\n-- All discharges that meet the discharge_disposition_code\n-- requirements to be an index admission\nselect a.encounter_id, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter a\nleft join all_invalid_discharges b\n on a.encounter_id = b.encounter_id\nwhere b.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__index_time_requirement": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__index_time_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_time_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_time_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_time_requirement"], "alias": "_int_index_time_requirement", "checksum": {"name": "sha256", "checksum": "fdcb889f1dfb18eac9c6391357319f305df38687d14351a70eed3b4ef5181853"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_time_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.125715, "relation_name": "dev_thuxuan.readmissions._int_index_time_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the time requirement to be an index admission:\r\n-- The discharge date must be at least 30 days\r\n-- earlier than the last discharge date available\r\n-- in the dataset.\r\n\r\n\r\n\r\nselect encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_date <= (select max(discharge_date)\r\n from {{ ref('readmissions__encounter') }} ) - 30", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the time requirement to be an index admission:\n-- The discharge date must be at least 30 days\n-- earlier than the last discharge date available\n-- in the dataset.\n\n\n\nselect encounter_id, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.readmissions._int_encounter\nwhere discharge_date <= (select max(discharge_date)\n from dev_thuxuan.readmissions._int_encounter ) - 30", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__planned_encounter": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__planned_encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__planned_encounter.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "unique_id": "model.the_tuva_project.readmissions__planned_encounter", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__planned_encounter"], "alias": "_int_planned_encounter", "checksum": {"name": "sha256", "checksum": "ae9c261fad8644fad894b8d6b87a15aeeb2688a7776f75dd635d172fc0e025d1"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_planned_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.129221, "relation_name": "dev_thuxuan.readmissions._int_planned_encounter", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids for all encounters\r\n-- that are planned.\r\n\r\n\r\n-- encounter_ids for encounters that we know\r\n-- are planned because they had a procedure category\r\n-- that is only present for planned encounters \r\nwith always_planned_px as (\r\nselect distinct pccs.encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pccs\r\ninner join {{ ref('readmissions__always_planned_ccs_procedure_category') }} apc\r\n on pccs.ccs_procedure_category = apc.ccs_procedure_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that we know\r\n-- are planned because they had a diagnosis category\r\n-- that is only present for planned encounters\r\nalways_planned_dx as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} dccs\r\ninner join {{ ref('readmissions__always_planned_ccs_diagnosis_category') }} apd\r\n on dccs.ccs_diagnosis_category = apd.ccs_diagnosis_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on one of their CCS procedure categories.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_ccs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pccs\r\ninner join {{ ref('readmissions__potentially_planned_ccs_procedure_category') }} pcs\r\n on pccs.ccs_procedure_category = pcs.ccs_procedure_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on their ICD-10-PCS procedure codes.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_icd_10_pcs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pcs\r\ninner join {{ ref('readmissions__potentially_planned_icd_10_pcs') }} pps\r\n on pcs.procedure_code = pps.icd_10_pcs\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are acute based\r\n-- on their primary diagnosis code or their CCS diagnosis category\r\nacute_encounters as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} dccs\r\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\r\n on dccs.primary_diagnosis_code = adi.icd_10_cm\r\nleft join {{ ref('readmissions__acute_diagnosis_ccs') }} adc\r\n on dccs.ccs_diagnosis_category = adc.ccs_diagnosis_category\r\nwhere adi.icd_10_cm is not null or adc.ccs_diagnosis_category is not null\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are:\r\n-- [1] potentially planned, based on one of\r\n-- their CCS procedure categories or\r\n-- their ICD-10-PCS procedure codes\r\n-- [2] not acute, based on their primary diagnosis code\r\n-- or their CCS diagnosis category\r\n-- These encounters are therefore confirmed to be planned\r\npotentially_planned_that_are_actually_planned as (\r\nselect distinct ppp.encounter_id\r\nfrom (\r\n select * from potentially_planned_px_ccs\r\n union all\r\n select * from potentially_planned_px_icd_10_pcs) ppp\r\nleft join acute_encounters\r\n on ppp.encounter_id = acute_encounters.encounter_id\r\nwhere acute_encounters.encounter_id is null\r\n\r\n)\r\n\r\n\r\n-- Aggregate of all encounter_ids for planned encounters\r\n\r\nselect * , '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_px\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_dx\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from potentially_planned_that_are_actually_planned", "language": "sql", "refs": [{"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__always_planned_ccs_diagnosis_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_ccs_procedure_category", "package": null, "version": null}, {"name": "readmissions__procedure_ccs", "package": null, "version": null}, {"name": "readmissions__potentially_planned_icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__encounter_with_ccs", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_icd_10_cm", "package": null, "version": null}, {"name": "readmissions__acute_diagnosis_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids for all encounters\n-- that are planned.\n\n\n-- encounter_ids for encounters that we know\n-- are planned because they had a procedure category\n-- that is only present for planned encounters \nwith always_planned_px as (\nselect distinct pccs.encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pccs\ninner join dev_thuxuan.readmissions._value_set_always_planned_ccs_procedure_category apc\n on pccs.ccs_procedure_category = apc.ccs_procedure_category\n),\n\n\n-- encounter_ids for encounters that we know\n-- are planned because they had a diagnosis category\n-- that is only present for planned encounters\nalways_planned_dx as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs dccs\ninner join dev_thuxuan.readmissions._value_set_always_planned_ccs_diagnosis_category apd\n on dccs.ccs_diagnosis_category = apd.ccs_diagnosis_category\n),\n\n\n-- encounter_ids for encounters that are potentially planned\n-- based on one of their CCS procedure categories.\n-- For these encounters to actually be planned, we must further\n-- require that they are NOT acute encounters\npotentially_planned_px_ccs as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pccs\ninner join dev_thuxuan.readmissions._value_set_potentially_planned_ccs_procedure_category pcs\n on pccs.ccs_procedure_category = pcs.ccs_procedure_category\n),\n\n\n-- encounter_ids for encounters that are potentially planned\n-- based on their ICD-10-PCS procedure codes.\n-- For these encounters to actually be planned, we must further\n-- require that they are NOT acute encounters\npotentially_planned_px_icd_10_pcs as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_procedure_ccs pcs\ninner join dev_thuxuan.readmissions._value_set_potentially_planned_icd_10_pcs pps\n on pcs.procedure_code = pps.icd_10_pcs\n),\n\n\n-- encounter_ids for encounters that are acute based\n-- on their primary diagnosis code or their CCS diagnosis category\nacute_encounters as (\nselect distinct encounter_id\nfrom dev_thuxuan.readmissions._int_encounter_with_ccs dccs\nleft join dev_thuxuan.readmissions._value_set_acute_diagnosis_icd_10_cm adi\n on dccs.primary_diagnosis_code = adi.icd_10_cm\nleft join dev_thuxuan.readmissions._value_set_acute_diagnosis_ccs adc\n on dccs.ccs_diagnosis_category = adc.ccs_diagnosis_category\nwhere adi.icd_10_cm is not null or adc.ccs_diagnosis_category is not null\n),\n\n\n-- encounter_ids for encounters that are:\n-- [1] potentially planned, based on one of\n-- their CCS procedure categories or\n-- their ICD-10-PCS procedure codes\n-- [2] not acute, based on their primary diagnosis code\n-- or their CCS diagnosis category\n-- These encounters are therefore confirmed to be planned\npotentially_planned_that_are_actually_planned as (\nselect distinct ppp.encounter_id\nfrom (\n select * from potentially_planned_px_ccs\n union all\n select * from potentially_planned_px_icd_10_pcs) ppp\nleft join acute_encounters\n on ppp.encounter_id = acute_encounters.encounter_id\nwhere acute_encounters.encounter_id is null\n\n)\n\n\n-- Aggregate of all encounter_ids for planned encounters\n\nselect * , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__procedure_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__procedure_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__procedure_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__procedure_ccs"], "alias": "_int_procedure_ccs", "checksum": {"name": "sha256", "checksum": "559e894edcdd88758b66a520f1ab0234d405d137e47ebb782ce681282fe746fa"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_procedure_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1332521, "relation_name": "dev_thuxuan.readmissions._int_procedure_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we map every procedure code to its corresponding\r\n-- CCS procedure category.\r\n-- This model may list more than one CCS procedure category\r\n-- per encounter_id because different procedures associated with the\r\n-- encounter (different rows on the stg_procedure model) may have\r\n-- different associated CCS procedure categories.\r\n\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.normalized_code as procedure_code,\r\n case\r\n when bb.icd_10_pcs is null then 0\r\n\telse 1\r\n end as valid_icd_10_pcs_flag,\r\n cc.ccs_procedure_category,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__stg_core__procedure') }} aa\r\n left join {{ ref('terminology__icd_10_pcs') }} bb\r\n on aa.normalized_code = bb.icd_10_pcs\r\n left join {{ ref('readmissions__icd_10_pcs_to_ccs') }} cc\r\n on aa.normalized_code = cc.icd_10_pcs\r\nwhere aa.normalized_code_type = 'icd-10-pcs'", "language": "sql", "refs": [{"name": "readmissions__stg_core__procedure", "package": null, "version": null}, {"name": "terminology__icd_10_pcs", "package": null, "version": null}, {"name": "readmissions__icd_10_pcs_to_ccs", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)-- Here we map every procedure code to its corresponding\n-- CCS procedure category.\n-- This model may list more than one CCS procedure category\n-- per encounter_id because different procedures associated with the\n-- encounter (different rows on the stg_procedure model) may have\n-- different associated CCS procedure categories.\n\n\n\nselect\n aa.encounter_id,\n aa.normalized_code as procedure_code,\n case\n when bb.icd_10_pcs is null then 0\n\telse 1\n end as valid_icd_10_pcs_flag,\n cc.ccs_procedure_category,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom\n __dbt__cte__readmissions__stg_core__procedure aa\n left join dev_thuxuan.terminology.icd_10_pcs bb\n on aa.normalized_code = bb.icd_10_pcs\n left join dev_thuxuan.readmissions._value_set_icd_10_pcs_to_ccs cc\n on aa.normalized_code = cc.icd_10_pcs\nwhere aa.normalized_code_type = 'icd-10-pcs'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__procedure", "sql": " __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__readmission_crude": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__readmission_crude", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__readmission_crude.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "unique_id": "model.the_tuva_project.readmissions__readmission_crude", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__readmission_crude"], "alias": "_int_readmission_crude", "checksum": {"name": "sha256", "checksum": "dd90b7f771f4984ab0228ce5dee79ee271adea2f92db1129773474d2f413d53d"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_readmission_crude", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1377823, "relation_name": "dev_thuxuan.readmissions._int_readmission_crude", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\n-- Here we calculate readmissions using all encounters\r\n-- that have valid admit and discharge dates and no overlap.\r\n-- This is meant to give a crude sense of the readmission\r\n-- rate without taking into account all the CMS HWR logic.\r\n\r\n\r\nwith encounter_info as (\r\nselect\r\n enc.encounter_id,\r\n enc.patient_id,\r\n enc.admit_date,\r\n enc.discharge_date\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_a\r\n on enc.encounter_id = over_a.encounter_id_A\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_b\r\n on enc.encounter_id = over_b.encounter_id_B\r\nwhere\r\n admit_date is not null\r\n and\r\n discharge_date is not null\r\n and\r\n admit_date <= discharge_date\r\nand over_a.encounter_id_A is null and over_b.encounter_id_B is null\r\n ),\r\n\r\n\r\nencounter_sequence as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over(\r\n partition by patient_id order by admit_date, discharge_date\r\n ) as encounter_seq\r\nfrom encounter_info\r\n),\r\n\r\n\r\nreadmission_calc as (\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\telse 0\r\n end as had_readmission_flag,\r\n bb.admit_date - aa.discharge_date as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"bb.admit_date\", \"aa.discharge_date\", \"day\") }}) <= 30 then 1\r\n\telse 0\r\n end as readmit_30_flag\r\nfrom encounter_sequence aa left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom readmission_calc", "language": "sql", "refs": [{"name": "readmissions__encounter", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}, {"name": "readmissions__encounter_overlap", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "compiled": true, "compiled_code": "\n\n-- Here we calculate readmissions using all encounters\n-- that have valid admit and discharge dates and no overlap.\n-- This is meant to give a crude sense of the readmission\n-- rate without taking into account all the CMS HWR logic.\n\n\nwith encounter_info as (\nselect\n enc.encounter_id,\n enc.patient_id,\n enc.admit_date,\n enc.discharge_date\nfrom dev_thuxuan.readmissions._int_encounter enc\nleft join dev_thuxuan.readmissions._int_encounter_overlap over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join dev_thuxuan.readmissions._int_encounter_overlap over_b\n on enc.encounter_id = over_b.encounter_id_B\nwhere\n admit_date is not null\n and\n discharge_date is not null\n and\n admit_date <= discharge_date\nand over_a.encounter_id_A is null and over_b.encounter_id_B is null\n ),\n\n\nencounter_sequence as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom encounter_info\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n case\n when bb.encounter_id is not null then 1\n\telse 0\n end as had_readmission_flag,\n bb.admit_date - aa.discharge_date as days_to_readmit,\n case\n when (datediff(\n day,\n bb.admit_date,\n aa.discharge_date\n )) <= 30 then 1\n\telse 0\n end as readmit_30_flag\nfrom encounter_sequence aa left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\n\n\nselect *, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__condition.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "ec76f237ade2d63b8123d7636b63abf4f719704011867479a89807a378a168b7"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.144782, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, condition_rank\r\n, normalized_code_type\r\n, claim_id\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__encounter.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__encounter", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__encounter"], "alias": "readmissions__stg_core__encounter", "checksum": {"name": "sha256", "checksum": "a95114e102c8d84943cf24d3f6ba53d56fe01f21842728423d2cc1558a9edc6e"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.145782, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id,\r\n patient_id,\r\n encounter_start_date,\r\n encounter_end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n ms_drg_code,\r\n paid_amount,\r\n primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\nwhere encounter_type = 'acute inpatient'", "language": "sql", "refs": [{"name": "core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "dev_thuxuan", "schema": "test", "name": "readmissions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__procedure.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "9d7956301a9813bb6becf26522ccf9532e24dcc9cd6041cd537dd15db6227fc6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884195.1477823, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) | as_bool\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, normalized_code_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}, "seed.the_tuva_project.terminology__admit_source": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__admit_source", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_source.csv", "original_file_path": "seeds\\terminology\\terminology__admit_source.csv", "unique_id": "seed.the_tuva_project.terminology__admit_source", "fqn": ["the_tuva_project", "terminology", "terminology__admit_source"], "alias": "admit_source", "checksum": {"name": "sha256", "checksum": "7068c87e74a237a6908ab4e7709afe8cfca181ad74d3e91ff9955926dc0e92ff"}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_source.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_source.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "admit_source", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6139748, "relation_name": "dev_thuxuan.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__admit_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__admit_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_type.csv", "original_file_path": "seeds\\terminology\\terminology__admit_type.csv", "unique_id": "seed.the_tuva_project.terminology__admit_type", "fqn": ["the_tuva_project", "terminology", "terminology__admit_type"], "alias": "admit_type", "checksum": {"name": "sha256", "checksum": "8fd4b52317db368c0e056c2d0682234f2ba7017161f67dcc055b33738608f14c"}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','admit_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "admit_type", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6196575, "relation_name": "dev_thuxuan.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ansi_fips_state": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ansi_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ansi_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ansi_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ansi_fips_state"], "alias": "ansi_fips_state", "checksum": {"name": "sha256", "checksum": "8b9ed6a3c0deef5889027408e19e785820305639d8185cbc6ff0a660266633d5"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ansi_fips_state.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ansi_fips_state.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ansi_fips_state", "tags": ["terminology", "medicare_cclf_connector"], "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6875725, "relation_name": "dev_thuxuan.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__apr_drg": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__apr_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__apr_drg.csv", "original_file_path": "seeds\\terminology\\terminology__apr_drg.csv", "unique_id": "seed.the_tuva_project.terminology__apr_drg", "fqn": ["the_tuva_project", "terminology", "terminology__apr_drg"], "alias": "apr_drg", "checksum": {"name": "sha256", "checksum": "09eb60b322cc83936cee0e221fdb694a6ab8e3dd8016c275885e126b58cb55b6"}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "medical_surgical": "varchar", "mdc_code": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','apr_drg.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','apr_drg.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "apr_drg", "tags": ["terminology", "data_profiling"], "column_types": {"apr_drg_code": "varchar", "medical_surgical": "varchar", "mdc_code": "varchar", "apr_drg_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8716128, "relation_name": "dev_thuxuan.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__bill_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__bill_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__bill_type.csv", "original_file_path": "seeds\\terminology\\terminology__bill_type.csv", "unique_id": "seed.the_tuva_project.terminology__bill_type", "fqn": ["the_tuva_project", "terminology", "terminology__bill_type"], "alias": "bill_type", "checksum": {"name": "sha256", "checksum": "398d806848f4a65fafccb3c4ad84b18f90ca269945d0121c4b81fe1b923d1627"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','bill_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','bill_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "bill_type", "tags": ["terminology", "data_profiling"], "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6369665, "relation_name": "dev_thuxuan.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__calendar": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__calendar", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__calendar.csv", "original_file_path": "seeds\\terminology\\terminology__calendar.csv", "unique_id": "seed.the_tuva_project.terminology__calendar", "fqn": ["the_tuva_project", "terminology", "terminology__calendar"], "alias": "calendar", "checksum": {"name": "sha256", "checksum": "e0e2dcef31be96e75c148c0c957eb818f563c04e71a5e7faefc8057598198671"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "pmpm"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','calendar.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "calendar", "tags": ["terminology", "pmpm"], "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.644991, "relation_name": "dev_thuxuan.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__claim_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__claim_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__claim_type.csv", "original_file_path": "seeds\\terminology\\terminology__claim_type.csv", "unique_id": "seed.the_tuva_project.terminology__claim_type", "fqn": ["the_tuva_project", "terminology", "terminology__claim_type"], "alias": "claim_type", "checksum": {"name": "sha256", "checksum": "5e72668475091f682d6782ae0d708213ddb0a1c5c1f4e3c457132e739ceb7cb5"}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','claim_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','claim_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "claim_type", "tags": ["terminology", "data_profiling"], "column_types": {"claim_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6519365, "relation_name": "dev_thuxuan.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__code_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__code_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__code_type.csv", "original_file_path": "seeds\\terminology\\terminology__code_type.csv", "unique_id": "seed.the_tuva_project.terminology__code_type", "fqn": ["the_tuva_project", "terminology", "terminology__code_type"], "alias": "code_type", "checksum": {"name": "sha256", "checksum": "3a94151ece0a448f49b110851a7dd224fdd59207faa27d61aebe5fd5d39c51b4"}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','code_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','code_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "code_type", "tags": ["terminology", "data_profiling"], "column_types": {"code_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6569574, "relation_name": "dev_thuxuan.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__discharge_disposition": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__discharge_disposition", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__discharge_disposition.csv", "original_file_path": "seeds\\terminology\\terminology__discharge_disposition.csv", "unique_id": "seed.the_tuva_project.terminology__discharge_disposition", "fqn": ["the_tuva_project", "terminology", "terminology__discharge_disposition"], "alias": "discharge_disposition", "checksum": {"name": "sha256", "checksum": "a76af528d7f867c651a809fdc4147595eb3a4e67f813b03f856f76f86a0b585c"}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','discharge_disposition.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','discharge_disposition.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "discharge_disposition", "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6630328, "relation_name": "dev_thuxuan.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__encounter_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__encounter_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__encounter_type.csv", "original_file_path": "seeds\\terminology\\terminology__encounter_type.csv", "unique_id": "seed.the_tuva_project.terminology__encounter_type", "fqn": ["the_tuva_project", "terminology", "terminology__encounter_type"], "alias": "encounter_type", "checksum": {"name": "sha256", "checksum": "a8d2626a7aa8401d6b2c32eed1226abd92f4e3967986c9ba66006e68cfbd927d"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"encounter_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','encounter_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','encounter_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "encounter_type", "tags": ["terminology", "claims_preprocessing"], "column_types": {"encounter_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6687121, "relation_name": "dev_thuxuan.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ethnicity": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ethnicity", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ethnicity.csv", "original_file_path": "seeds\\terminology\\terminology__ethnicity.csv", "unique_id": "seed.the_tuva_project.terminology__ethnicity", "fqn": ["the_tuva_project", "terminology", "terminology__ethnicity"], "alias": "ethnicity", "checksum": {"name": "sha256", "checksum": "bcfd53e2a625f5953eddc7252d70dadd8a688413415a52484c604d7233d52dd6"}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ethnicity.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ethnicity.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ethnicity", "tags": "terminology", "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6748137, "relation_name": "dev_thuxuan.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__fips_county": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__fips_county", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__fips_county.csv", "original_file_path": "seeds\\terminology\\terminology__fips_county.csv", "unique_id": "seed.the_tuva_project.terminology__fips_county", "fqn": ["the_tuva_project", "terminology", "terminology__fips_county"], "alias": "fips_county", "checksum": {"name": "sha256", "checksum": "206c5df28096e19cfc225b0cc29b1aed721a971d84007ace9f9a839dac378080"}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','fips_county.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','fips_county.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "fips_county", "tags": "terminology", "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.680819, "relation_name": "dev_thuxuan.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__gender": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__gender", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__gender.csv", "original_file_path": "seeds\\terminology\\terminology__gender.csv", "unique_id": "seed.the_tuva_project.terminology__gender", "fqn": ["the_tuva_project", "terminology", "terminology__gender"], "alias": "gender", "checksum": {"name": "sha256", "checksum": "de9feaea8b66f7ba74845ee5fc156cdd22e8e4533de13ca76d71ac495da358ff"}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"gender": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','gender.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','gender.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "gender", "tags": ["terminology", "data_profiling"], "column_types": {"gender": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.692575, "relation_name": "dev_thuxuan.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__hcpcs_level_2", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__hcpcs_level_2.csv", "original_file_path": "seeds\\terminology\\terminology__hcpcs_level_2.csv", "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2", "fqn": ["the_tuva_project", "terminology", "terminology__hcpcs_level_2"], "alias": "hcpcs_level_2", "checksum": {"name": "sha256", "checksum": "7c204c5d21b38f16be4dfdea1167634ccb992fac1b91699e94fc4180dd902d09"}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','hcpcs_level_2.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','hcpcs_level_2.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "hcpcs_level_2", "tags": "terminology", "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7018726, "relation_name": "dev_thuxuan.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_cm": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_cm"], "alias": "icd_10_cm", "checksum": {"name": "sha256", "checksum": "26bd81ab956f24c68160aadcef4bb75551ffb125b0ecadf437f6eb0e343099fb"}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "header_flag": "varchar", "short_description": "varchar", "long_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_cm.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_10_cm": "varchar", "header_flag": "varchar", "short_description": "varchar", "long_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.709959, "relation_name": "dev_thuxuan.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_pcs": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_pcs"], "alias": "icd_10_pcs", "checksum": {"name": "sha256", "checksum": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_10_pcs.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions"], "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7159638, "relation_name": "dev_thuxuan.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_cm": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_9_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_cm"], "alias": "icd_9_cm", "checksum": {"name": "sha256", "checksum": "ed4c7e9c312522e20df88cb21837ea0953be63016bbd49c48a44f215e55353db"}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_cm.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_9_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7226512, "relation_name": "dev_thuxuan.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_pcs": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__icd_9_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_pcs"], "alias": "icd_9_pcs", "checksum": {"name": "sha256", "checksum": "97258446a8c069119ada9e71632dd8a3f73135968cfdb38ba09109003915b525"}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','icd_9_pcs.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_9_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7303383, "relation_name": "dev_thuxuan.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__loinc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__loinc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc.csv", "original_file_path": "seeds\\terminology\\terminology__loinc.csv", "unique_id": "seed.the_tuva_project.terminology__loinc", "fqn": ["the_tuva_project", "terminology", "terminology__loinc"], "alias": "loinc", "checksum": {"name": "sha256", "checksum": "374101e8b4e4fd5038c5bcae0dca2e5fcf2992883068619e2cbadad7ea3a8e7b"}, "config": {"enabled": true, "alias": "loinc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.752134, "relation_name": "dev_thuxuan.terminology.loinc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__loinc_deprecated_mapping", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc_deprecated_mapping.csv", "original_file_path": "seeds\\terminology\\terminology__loinc_deprecated_mapping.csv", "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping", "fqn": ["the_tuva_project", "terminology", "terminology__loinc_deprecated_mapping"], "alias": "loinc_deprecated_mapping", "checksum": {"name": "sha256", "checksum": "eecd52c3944bc1abd373c557a286ee386438733c6daf2fbb844e86623f7af119"}, "config": {"enabled": true, "alias": "loinc_deprecated_mapping", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc_deprecated_mapping", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.763244, "relation_name": "dev_thuxuan.terminology.loinc_deprecated_mapping", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__mdc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__mdc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__mdc.csv", "original_file_path": "seeds\\terminology\\terminology__mdc.csv", "unique_id": "seed.the_tuva_project.terminology__mdc", "fqn": ["the_tuva_project", "terminology", "terminology__mdc"], "alias": "mdc", "checksum": {"name": "sha256", "checksum": "ff8bd52323887788765f3602e13e6083ecebee26d5b9466d118f531d46a445e3"}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mdc_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','mdc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','mdc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "mdc", "tags": "terminology", "column_types": {"mdc_code": "varchar", "mdc_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.769666, "relation_name": "dev_thuxuan.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_dual_eligibility", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_dual_eligibility.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_dual_eligibility.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_dual_eligibility"], "alias": "medicare_dual_eligibility", "checksum": {"name": "sha256", "checksum": "520243cb81b0f298c80fe446ea6c3d7b5f78d66d8caa6594e028073045210091"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_dual_eligibility.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_dual_eligibility", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7756822, "relation_name": "dev_thuxuan.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_orec": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_orec", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_orec.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_orec.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_orec", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_orec"], "alias": "medicare_orec", "checksum": {"name": "sha256", "checksum": "91af2feb419d4ab1b82f88a165db27a2ded30c3e3b221081dc0bebee6c9c44ed"}, "config": {"enabled": true, "alias": "medicare_orec", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_orec.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_orec.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_orec", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7826562, "relation_name": "dev_thuxuan.terminology.medicare_orec", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__medicare_status": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__medicare_status", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_status.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_status.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_status", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_status"], "alias": "medicare_status", "checksum": {"name": "sha256", "checksum": "c9d34774cf96cec7e8b301c8a965bdf320c0a03e65ffb96ba745ac3f161a2656"}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_status.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','medicare_status.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "medicare_status", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7943628, "relation_name": "dev_thuxuan.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ms_drg": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ms_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ms_drg.csv", "original_file_path": "seeds\\terminology\\terminology__ms_drg.csv", "unique_id": "seed.the_tuva_project.terminology__ms_drg", "fqn": ["the_tuva_project", "terminology", "terminology__ms_drg"], "alias": "ms_drg", "checksum": {"name": "sha256", "checksum": "d551fa50b60ab14efddee46089274d432d11570f3216db9aa6868074ace94ca2"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ms_drg.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ms_drg.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ms_drg", "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.80422, "relation_name": "dev_thuxuan.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ndc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ndc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ndc.csv", "original_file_path": "seeds\\terminology\\terminology__ndc.csv", "unique_id": "seed.the_tuva_project.terminology__ndc", "fqn": ["the_tuva_project", "terminology", "terminology__ndc"], "alias": "ndc", "checksum": {"name": "sha256", "checksum": "d53a75e4c3a87004c8cb4b4bf2368eada76e2ce9e60ad2d330420327d8fd30f2"}, "config": {"enabled": true, "alias": "ndc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ndc": "varchar", "rxcui": "varchar", "rxnorm_description": "varchar(3000)", "fda_description": "varchar(3000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ndc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "This file collects all ndcs collected by the fda and rxnorm, and compiles them into one list. The file is maintained by [CodeRX](https://coderx.io/) in partnership with Tuva Health.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ndc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ndc", "tags": ["terminology"], "column_types": {"ndc": "varchar", "rxcui": "varchar", "rxnorm_description": "varchar(3000)", "fda_description": "varchar(3000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8111236, "relation_name": "dev_thuxuan.terminology.ndc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__other_provider_taxonomy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__other_provider_taxonomy.csv", "original_file_path": "seeds\\terminology\\terminology__other_provider_taxonomy.csv", "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy", "fqn": ["the_tuva_project", "terminology", "terminology__other_provider_taxonomy"], "alias": "other_provider_taxonomy", "checksum": {"name": "sha256", "checksum": "ea344ae188db60f0f75e52a39114af49b7828fe050d3f761db03d4d07039cccf"}, "config": {"enabled": true, "alias": "other_provider_taxonomy", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "other_provider_taxonomy", "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8207114, "relation_name": "dev_thuxuan.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__payer_type": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__payer_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__payer_type.csv", "original_file_path": "seeds\\terminology\\terminology__payer_type.csv", "unique_id": "seed.the_tuva_project.terminology__payer_type", "fqn": ["the_tuva_project", "terminology", "terminology__payer_type"], "alias": "payer_type", "checksum": {"name": "sha256", "checksum": "282a78d9af16774f2afddfd20b98c6b5cb9fedb632a5dea1a887f0e15bafade0"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','payer_type.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','payer_type.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "payer_type", "tags": ["terminology", "data_profiling"], "column_types": {"payer_type": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8262174, "relation_name": "dev_thuxuan.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__place_of_service": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__place_of_service", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__place_of_service.csv", "original_file_path": "seeds\\terminology\\terminology__place_of_service.csv", "unique_id": "seed.the_tuva_project.terminology__place_of_service", "fqn": ["the_tuva_project", "terminology", "terminology__place_of_service"], "alias": "place_of_service", "checksum": {"name": "sha256", "checksum": "73979f823fbd58b0591864b102c9fbaea4459a05cc2aa4dcd3231c6a33c7ebb7"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','place_of_service.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','place_of_service.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "place_of_service", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.832223, "relation_name": "dev_thuxuan.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__present_on_admission": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__present_on_admission", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__present_on_admission.csv", "original_file_path": "seeds\\terminology\\terminology__present_on_admission.csv", "unique_id": "seed.the_tuva_project.terminology__present_on_admission", "fqn": ["the_tuva_project", "terminology", "terminology__present_on_admission"], "alias": "present_on_admission", "checksum": {"name": "sha256", "checksum": "1f17dd2ef1ccf1f8cb156ac0d4be3cf5e7e96b56bfcb97b5113d0de8aabace48"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "present_on_admit_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','present_on_admission.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','present_on_admission.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "present_on_admission", "tags": ["terminology", "data_profiling", "claims_preprocessing"], "column_types": {"present_on_admit_code": "varchar", "present_on_admit_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.838024, "relation_name": "dev_thuxuan.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__provider": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__provider", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__provider.csv", "original_file_path": "seeds\\terminology\\terminology__provider.csv", "unique_id": "seed.the_tuva_project.terminology__provider", "fqn": ["the_tuva_project", "terminology", "terminology__provider"], "alias": "provider", "checksum": {"name": "sha256", "checksum": "f88950a046cf237eda0f4b60cd8284961c4b9c59742960a8e63f7305fe89ed05"}, "config": {"enabled": true, "alias": "provider", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_provider_data/0.8.2','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_provider_data/0.8.2','provider.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "provider", "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8528547, "relation_name": "dev_thuxuan.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__race": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__race", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__race.csv", "original_file_path": "seeds\\terminology\\terminology__race.csv", "unique_id": "seed.the_tuva_project.terminology__race", "fqn": ["the_tuva_project", "terminology", "terminology__race"], "alias": "race", "checksum": {"name": "sha256", "checksum": "bcfd53e2a625f5953eddc7252d70dadd8a688413415a52484c604d7233d52dd6"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','race.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','race.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "race", "tags": ["terminology", "data_profiling"], "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8578453, "relation_name": "dev_thuxuan.terminology.race", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__revenue_center": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__revenue_center", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__revenue_center.csv", "original_file_path": "seeds\\terminology\\terminology__revenue_center.csv", "unique_id": "seed.the_tuva_project.terminology__revenue_center", "fqn": ["the_tuva_project", "terminology", "terminology__revenue_center"], "alias": "revenue_center", "checksum": {"name": "sha256", "checksum": "58bde54ea73aaaa50a0342bb8a28da19fe865ca82d3997c3297c9ad616ca9eb1"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','revenue_center.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','revenue_center.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "revenue_center", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8638325, "relation_name": "dev_thuxuan.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__rxnorm_to_atc": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__rxnorm_to_atc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__rxnorm_to_atc.csv", "original_file_path": "seeds\\terminology\\terminology__rxnorm_to_atc.csv", "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc", "fqn": ["the_tuva_project", "terminology", "terminology__rxnorm_to_atc"], "alias": "rxnorm_to_atc", "checksum": {"name": "sha256", "checksum": "3817989c76e5142e5e0e6827d61b00cab45c17a94b77f923898d844f9807ad4c"}, "config": {"enabled": true, "alias": "rxnorm_to_atc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"rxcui": "varchar", "rxnorm_description": "varchar(3000)", "atc_1_code": "varchar", "atc_1_name": "varchar", "atc_2_code": "varchar", "atc_2_name": "varchar", "atc_3_code": "varchar", "atc_3_name": "varchar", "atc_4_code": "varchar", "atc_4_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','rxnorm_to_atc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "This file maps atc classes to rxcui. The file is maintained by [CodeRX](https://coderx.io/) in partnership with Tuva Health.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','rxnorm_to_atc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "rxnorm_to_atc", "tags": ["terminology"], "column_types": {"rxcui": "varchar", "rxnorm_description": "varchar(3000)", "atc_1_code": "varchar", "atc_1_name": "varchar", "atc_2_code": "varchar", "atc_2_name": "varchar", "atc_3_code": "varchar", "atc_3_name": "varchar", "atc_4_code": "varchar", "atc_4_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.6312518, "relation_name": "dev_thuxuan.terminology.rxnorm_to_atc", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__snomed_ct": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__snomed_ct", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__snomed_ct.csv", "original_file_path": "seeds\\terminology\\terminology__snomed_ct.csv", "unique_id": "seed.the_tuva_project.terminology__snomed_ct", "fqn": ["the_tuva_project", "terminology", "terminology__snomed_ct"], "alias": "snomed_ct", "checksum": {"name": "sha256", "checksum": "b43378e55ac19ee1113d5b863784f7c8f5c5198d129d37c860bc43d311b5e00f"}, "config": {"enabled": true, "alias": "snomed_ct", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"snomed_ct": "varchar", "description": "varchar", "is_active": "varchar", "created": "date", "last_updated": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "snomed_ct", "tags": ["terminology"], "column_types": {"snomed_ct": "varchar", "description": "varchar", "is_active": "varchar", "created": "date", "last_updated": "date"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8932288, "relation_name": "dev_thuxuan.terminology.snomed_ct", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__snomed_ct_transitive_closures": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__snomed_ct_transitive_closures", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__snomed_ct_transitive_closures.csv", "original_file_path": "seeds\\terminology\\terminology__snomed_ct_transitive_closures.csv", "unique_id": "seed.the_tuva_project.terminology__snomed_ct_transitive_closures", "fqn": ["the_tuva_project", "terminology", "terminology__snomed_ct_transitive_closures"], "alias": "snomed_ct_transitive_closures", "checksum": {"name": "sha256", "checksum": "8b4906f98be3058e45aee7a8c557623623beeeaca290ca922146f1541ff85c7b"}, "config": {"enabled": true, "alias": "snomed_ct_transitive_closures", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"parent_snomed_code": "varchar", "parent_description": "varchar", "child_snomed_code": "varchar", "child_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct_transitive_closures.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_ct_transitive_closures.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "snomed_ct_transitive_closures", "tags": ["terminology"], "column_types": {"parent_snomed_code": "varchar", "parent_description": "varchar", "child_snomed_code": "varchar", "child_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.8992286, "relation_name": "dev_thuxuan.terminology.snomed_ct_transitive_closures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__snomed_icd_10_map": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__snomed_icd_10_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__snomed_icd_10_map.csv", "original_file_path": "seeds\\terminology\\terminology__snomed_icd_10_map.csv", "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map", "fqn": ["the_tuva_project", "terminology", "terminology__snomed_icd_10_map"], "alias": "snomed_icd_10_map", "checksum": {"name": "sha256", "checksum": "a9e5ce05b4fe9149571f87cfe6a77ef63f0f697da4f7e31a537bdc83927ee593"}, "config": {"enabled": true, "alias": "snomed_icd_10_map", "schema": "terminology", "database": null, "tags": ["terminology", "hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "varchar", "effective_time": "varchar", "active": "varchar", "module_id": "varchar", "ref_set_id": "varchar", "referenced_component_id": "varchar", "referenced_component_name": "varchar", "map_group": "varchar", "map_priority": "varchar", "map_rule": "varchar(500)", "map_advice": "varchar(500)", "map_target": "varchar", "map_target_name": "varchar", "correlation_id": "varchar", "map_category_id": "varchar", "map_category_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_icd_10_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "hcc_suspecting"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','snomed_icd_10_map.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "snomed_icd_10_map", "tags": ["terminology", "hcc_suspecting"], "column_types": {"id": "varchar", "effective_time": "varchar", "active": "varchar", "module_id": "varchar", "ref_set_id": "varchar", "referenced_component_id": "varchar", "referenced_component_name": "varchar", "map_group": "varchar", "map_priority": "varchar", "map_rule": "varchar(500)", "map_advice": "varchar(500)", "map_target": "varchar", "map_target_name": "varchar", "correlation_id": "varchar", "map_category_id": "varchar", "map_category_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.886229, "relation_name": "dev_thuxuan.terminology.snomed_icd_10_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__ssa_fips_state": {"database": "dev_thuxuan", "schema": "terminology", "name": "terminology__ssa_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ssa_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ssa_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ssa_fips_state"], "alias": "ssa_fips_state", "checksum": {"name": "sha256", "checksum": "79a3093e6af928b718e6ac895e2b0f94fecd19d083227846626cd88ddea299f7"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ssa_fips_state.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_terminology/0.8.2','ssa_fips_state.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "ssa_fips_state", "tags": "terminology", "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.7884429, "relation_name": "dev_thuxuan.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.pqi__measures": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "pqi__measures", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ahrq_measures\\pqi__measures.csv", "original_file_path": "seeds\\value_sets\\ahrq_measures\\pqi__measures.csv", "unique_id": "seed.the_tuva_project.pqi__measures", "fqn": ["the_tuva_project", "value_sets", "ahrq_measures", "pqi__measures"], "alias": "_value_set_pqi_measures", "checksum": {"name": "sha256", "checksum": "418bfe56cc5df98f458992857d672624a100921e46cdc0f67b04c704aaae42b3"}, "config": {"enabled": true, "alias": "_value_set_pqi_measures", "schema": "ahrq_measures", "database": null, "tags": ["pqi"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"pqi_number": "varchar", "pqi_name": "varchar", "pqi_description": "varchar(1000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["pqi"], "description": "names and descriptions of each of the PQI measures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ahrq_measures\\pqi__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ahrq_measures", "alias": "_value_set_pqi_measures", "tags": ["pqi"], "enabled": true, "column_types": {"pqi_number": "varchar", "pqi_name": "varchar", "pqi_description": "varchar(1000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.909744, "relation_name": "dev_thuxuan.ahrq_measures._value_set_pqi_measures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.pqi__value_sets": {"database": "dev_thuxuan", "schema": "ahrq_measures", "name": "pqi__value_sets", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ahrq_measures\\pqi__value_sets.csv", "original_file_path": "seeds\\value_sets\\ahrq_measures\\pqi__value_sets.csv", "unique_id": "seed.the_tuva_project.pqi__value_sets", "fqn": ["the_tuva_project", "value_sets", "ahrq_measures", "pqi__value_sets"], "alias": "_value_set_pqi", "checksum": {"name": "sha256", "checksum": "69f16d118a28d012e04eff04a533ee3842e86fd9bf36e1fc1e533389d1b6de71"}, "config": {"enabled": true, "alias": "_value_set_pqi", "schema": "ahrq_measures", "database": null, "tags": ["pqi"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code_value": "varchar", "value_set_name": "varchar", "pqi_number": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["pqi"], "description": "values sets from AHRQ for each of the published PQI measures", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ahrq_measures\\pqi__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ahrq_measures", "alias": "_value_set_pqi", "tags": ["pqi"], "enabled": true, "column_types": {"code_value": "varchar", "value_set_name": "varchar", "pqi_number": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9047437, "relation_name": "dev_thuxuan.ahrq_measures._value_set_pqi", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_body_systems", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_body_systems"], "alias": "_value_set_dxccsr_v2023_1_body_systems", "checksum": {"name": "sha256", "checksum": "7697bf1b376e5db2c79b42edf944e29332b40b534eeaf0f379ff17439b4fb440"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"body_system": "varchar", "ccsr_parent_category": "varchar", "parent_category_description": "varchar(3000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing descriptions of the top level categories used in the CCSR condition mapper.\nThis was manually exctracted from the User Guide PDF included with the DXCCSR SAS program.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_body_systems.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true, "column_types": {"body_system": "varchar", "ccsr_parent_category": "varchar", "parent_category_description": "varchar(3000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9172497, "relation_name": "dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_cleaned_map"], "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "cce1c4661615e89299e601fb26d3e3060b140864507858e5d0e8b61ea9b70c12"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the DXCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README. For each ICD-10-CM code, the table contains up to six CCSR category codes and a default CCSR category code.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9338715, "relation_name": "dev_thuxuan.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"database": "dev_thuxuan", "schema": "ccsr", "name": "ccsr__prccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__prccsr_v2023_1_cleaned_map"], "alias": "_value_set_prccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "fd84423264c0174b1fc1e2ba23f1ac7957ef4fa7aaefcb2c45932f587b59fedf"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the PRCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_prccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9430244, "relation_name": "dev_thuxuan.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__cms_chronic_conditions_hierarchy"], "alias": "_value_set_cms_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "3328c63a1bcb8d0813bb98a61739cb69306aa2726082b042baa377c4fb761302"}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"condition_id": "varchar", "condition": "varchar", "condition_column_name": "varchar", "chronic_condition_type": "varchar", "condition_category": "varchar", "additional_logic": "varchar", "claims_qualification": "varchar(1024)", "inclusion_type": "varchar", "code_system": "varchar", "code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\cms_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "schema": "chronic_conditions", "alias": "_value_set_cms_chronic_conditions_hierarchy", "tags": ["cms_chronic_conditions", "chronic_conditions"], "enabled": true, "column_types": {"condition_id": "varchar", "condition": "varchar", "condition_column_name": "varchar", "chronic_condition_type": "varchar", "condition_category": "varchar", "additional_logic": "varchar", "claims_qualification": "varchar(1024)", "inclusion_type": "varchar", "code_system": "varchar", "code": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9555836, "relation_name": "dev_thuxuan.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"database": "dev_thuxuan", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__tuva_chronic_conditions_hierarchy"], "alias": "_value_set_tuva_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "b379c992888d52f3b13270d7e804e5c5d0d1314d1039123674e6122884c37ce3"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"condition_family": "varchar", "condition": "varchar", "icd_10_cm_code": "varchar", "icd_10_cm_description": "varchar", "condition_column_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "A list of the diagnoses codes and their long and short names along with grouping logic classifying each code into a condition group and a condition family group.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\tuva_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_chronic_conditions_hierarchy.csv',compression=true,null_marker=true) }}", "schema": "chronic_conditions", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "enabled": true, "column_types": {"condition_family": "varchar", "condition": "varchar", "icd_10_cm_code": "varchar", "icd_10_cm_description": "varchar", "condition_column_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9645643, "relation_name": "dev_thuxuan.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.clinical_concepts": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "clinical_concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\clinical_concepts.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\clinical_concepts.csv", "unique_id": "seed.the_tuva_project.clinical_concepts", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "clinical_concepts"], "alias": "clinical_concepts", "checksum": {"name": "sha256", "checksum": "28904352227711d78b2ffd3f5b674269b3f16f92e5eba2a8f83b8749500ea30d"}, "config": {"enabled": true, "alias": "clinical_concepts", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_id": "varchar", "concept_name": "varchar", "status": "varchar", "concept_oid": "varchar", "last_update_date": "date", "last_update_note": "varchar", "concept_type": "varchar", "content_source": "varchar(3000)", "external_source_detail": "varchar(3000)", "concept_scope": "varchar(3000)", "value_set_search_notes": "varchar(3000)", "code": "varchar", "code_description": "varchar", "coding_system_id": "varchar", "coding_system_version": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_clinical_concepts.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "clinical_concepts", "tags": "clinical_concept_library", "column_types": {"concept_id": "varchar", "concept_name": "varchar", "status": "varchar", "concept_oid": "varchar", "last_update_date": "date", "last_update_note": "varchar", "concept_type": "varchar", "content_source": "varchar(3000)", "external_source_detail": "varchar(3000)", "concept_scope": "varchar(3000)", "value_set_search_notes": "varchar(3000)", "code": "varchar", "code_description": "varchar", "coding_system_id": "varchar", "coding_system_version": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9780836, "relation_name": "dev_thuxuan.clinical_concept_library.clinical_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.coding_systems": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "coding_systems", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\coding_systems.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\coding_systems.csv", "unique_id": "seed.the_tuva_project.coding_systems", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "coding_systems"], "alias": "coding_systems", "checksum": {"name": "sha256", "checksum": "2468b8aad4f2ee3fe8043f55d2cfde2203aefb7fa7d959b9e63d138361bdafae"}, "config": {"enabled": true, "alias": "coding_systems", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coding_system_id": "varchar", "coding_system_name": "varchar", "coding_system_uri": "varchar", "coding_system_oid": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_coding_systems.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_coding_systems.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "coding_systems", "tags": "clinical_concept_library", "column_types": {"coding_system_id": "varchar", "coding_system_name": "varchar", "coding_system_uri": "varchar", "coding_system_oid": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9986064, "relation_name": "dev_thuxuan.clinical_concept_library.coding_systems", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.value_set_members": {"database": "dev_thuxuan", "schema": "clinical_concept_library", "name": "value_set_members", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\clinical_concept_library\\value_set_members.csv", "original_file_path": "seeds\\value_sets\\clinical_concept_library\\value_set_members.csv", "unique_id": "seed.the_tuva_project.value_set_members", "fqn": ["the_tuva_project", "value_sets", "clinical_concept_library", "value_set_members"], "alias": "value_set_members", "checksum": {"name": "sha256", "checksum": "066f2f31496a1d94f83040789f89b512753bda8edc902a24a183ddadfcc305df"}, "config": {"enabled": true, "alias": "value_set_members", "schema": "clinical_concept_library", "database": null, "tags": ["clinical_concept_library"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"value_set_member_id": "varchar", "concept_id": "varchar", "status": "varchar", "last_update_date": "date", "last_update_note": "varchar", "code": "varchar", "code_description": "varchar(2000)", "coding_system_id": "varchar", "coding_system_version": "varchar", "include_descendants": "varchar", "comment": "varchar(2000)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_value_set_members.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["clinical_concept_library"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\clinical_concept_library\\clinical_concept_library_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','tuva_value_set_members.csv',compression=true,null_marker=true) }}", "schema": "clinical_concept_library", "alias": "value_set_members", "tags": "clinical_concept_library", "column_types": {"value_set_member_id": "varchar", "concept_id": "varchar", "status": "varchar", "last_update_date": "date", "last_update_note": "varchar", "code": "varchar", "code_description": "varchar(2000)", "coding_system_id": "varchar", "coding_system_version": "varchar", "include_descendants": "varchar", "comment": "varchar(2000)"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884192.9896052, "relation_name": "dev_thuxuan.clinical_concept_library.value_set_members", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__adjustment_rates", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__adjustment_rates"], "alias": "_value_set_adjustment_rates", "checksum": {"name": "sha256", "checksum": "51bc7577f57c9638cdc72ca40f108301756eb831a01345b7763c38bfbb869b4a"}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "payment_year": "integer", "normalization_factor": "numeric", "ma_coding_pattern_adjustment": "numeric"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_adjustment_rates.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_adjustment_rates", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "payment_year": "integer", "normalization_factor": "numeric", "ma_coding_pattern_adjustment": "numeric"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0062141, "relation_name": "dev_thuxuan.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__cpt_hcpcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__cpt_hcpcs"], "alias": "_value_set_cpt_hcpcs", "checksum": {"name": "sha256", "checksum": "511389c6e0558d00efb8c3cae2123a46f97e616d26bdf7b8a331670f857b1ac8"}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cpt_hcpcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "CPT/HCPCS encounter filtering included list by payment year. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cpt_hcpcs.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_cpt_hcpcs", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0132113, "relation_name": "dev_thuxuan.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__demographic_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__demographic_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__demographic_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__demographic_factors"], "alias": "_value_set_demographic_factors", "checksum": {"name": "sha256", "checksum": "b3bbcb21143941da7dc41c5ca2f68d4cbe180920e344ea1dded30722b7193c84"}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "plan_segment": "varchar", "gender": "varchar", "age_group": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_demographic_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_demographic_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "plan_segment": "varchar", "gender": "varchar", "age_group": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.024448, "relation_name": "dev_thuxuan.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disabled_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disabled_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disabled_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disabled_interaction_factors"], "alias": "_value_set_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "b2e6ac06c8ef6087ff21d9aa2b868cdddca29fda8fc8346563c81a56f0e97f2a"}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease and disabled interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disabled_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disabled_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.036299, "relation_name": "dev_thuxuan.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disease_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_factors"], "alias": "_value_set_disease_factors", "checksum": {"name": "sha256", "checksum": "64c15ace094f384cb6a38b0a0c67a0216f8eb2ef0e00cd8fc7537e9fd1a85f7f"}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "hcc_code": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disease_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "hcc_code": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0473826, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_hierarchy"], "alias": "_value_set_disease_hierarchy", "checksum": {"name": "sha256", "checksum": "48982402067756cdefe3729778775b1868734dacdc88f44407971aa120586468"}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "hcc_code": "varchar", "description": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_hierarchy", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "hcc_code": "varchar", "description": "varchar", "hccs_to_exclude": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.055004, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__disease_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_interaction_factors"], "alias": "_value_set_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "a2f6c69a63ed5c43e250b356ea308285effbb38643d732404f8e4277fe649a00"}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_disease_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_disease_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "short_name": "varchar", "description": "varchar", "hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0660038, "relation_name": "dev_thuxuan.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__enrollment_interaction_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__enrollment_interaction_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__enrollment_interaction_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__enrollment_interaction_factors"], "alias": "_value_set_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "8ff088e57fc620bde58a0e1707097011e249e3b2c65f1b1754da0cb6a0c3fa09"}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "gender": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "institutional_status": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_enrollment_interaction_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_enrollment_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "gender": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "institutional_status": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0775838, "relation_name": "dev_thuxuan.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__icd_10_cm_mappings", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__icd_10_cm_mappings"], "alias": "_value_set_icd_10_cm_mappings", "checksum": {"name": "sha256", "checksum": "03dda989fc2f10b3741665515d73d2352b52061d605ddf7fef318b53b1a24a57"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar", "cms_hcc_v28": "varchar", "cms_hcc_v28_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_icd_10_cm_mappings", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar", "cms_hcc_v28": "varchar", "cms_hcc_v28_flag": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0863152, "relation_name": "dev_thuxuan.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__payment_hcc_count_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__payment_hcc_count_factors"], "alias": "_value_set_payment_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "bf87f7657286107fa26c903a7ed24a2e8d39ca5fbd8869ee778adecb91bb2431"}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "payment_hcc_count": "varchar", "description": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Payment HCC count factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','cms_hcc_payment_hcc_count_factors.csv',compression=true,null_marker=true) }}", "schema": "cms_hcc", "alias": "_value_set_payment_hcc_count_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"model_version": "varchar", "factor_type": "varchar", "enrollment_status": "varchar", "medicaid_status": "varchar", "dual_status": "varchar", "orec": "varchar", "institutional_status": "varchar", "payment_hcc_count": "varchar", "description": "varchar", "coefficient": "float"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.0993147, "relation_name": "dev_thuxuan.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.data_quality__test_catalog": {"database": "dev_thuxuan", "schema": "data_quality", "name": "data_quality__test_catalog", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\data_quality\\data_quality__test_catalog.csv", "original_file_path": "seeds\\value_sets\\data_quality\\data_quality__test_catalog.csv", "unique_id": "seed.the_tuva_project.data_quality__test_catalog", "fqn": ["the_tuva_project", "value_sets", "data_quality", "data_quality__test_catalog"], "alias": "_value_set_test_catalog", "checksum": {"name": "sha256", "checksum": "39cef0b51c7a0c811782d01c67071b04b89e9ffd55672da9bbae154ada688997"}, "config": {"enabled": true, "alias": "_value_set_test_catalog", "schema": "data_quality", "database": null, "tags": ["data_quality", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "test_field": "varchar", "claim_type": "varchar", "pipeline_test": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','data_quality_test_catalog.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["data_quality", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\data_quality\\data_quality__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','data_quality_test_catalog.csv',compression=true,null_marker=true) }}", "schema": "data_quality", "alias": "_value_set_test_catalog", "tags": ["data_quality", "claims_preprocessing"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "test_field": "varchar", "claim_type": "varchar", "pipeline_test": "integer"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1088343, "relation_name": "dev_thuxuan.data_quality._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__categories": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__categories.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__categories.csv", "unique_id": "seed.the_tuva_project.ed_classification__categories", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__categories"], "alias": "_value_set_categories", "checksum": {"name": "sha256", "checksum": "cf0576acd61cdf96595d8efb636ca9fa6812aa88ea934ab70f7cffe1241f4c2f"}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"classification": "varchar", "classification_name": "varchar", "classification_order": "varchar", "classification_column": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','ed_classification_categories.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A mapping of ED Classifications to human readable names", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','ed_classification_categories.csv',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_categories", "tags": "ed_classification", "enabled": true, "column_types": {"classification": "varchar", "classification_name": "varchar", "classification_order": "varchar", "classification_column": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1158347, "relation_name": "dev_thuxuan.ed_classification._value_set_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "ed_classification", "enabled": true, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1263454, "relation_name": "dev_thuxuan.ed_classification._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__johnston_icd10", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd10.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd10"], "alias": "_value_set_johnston_icd10", "checksum": {"name": "sha256", "checksum": "86d77b4087f009aa80ba4a6ea7e1977c1230d6067ef4538b3a5cc0249e65657b"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd10", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd10": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "noner": "varchar", "epct": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd10',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd10": {"name": "icd10", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd10',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_johnston_icd10", "tags": "ed_classification", "enabled": true, "column_types": {"icd10": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "noner": "varchar", "epct": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1531763, "relation_name": "dev_thuxuan.ed_classification._value_set_johnston_icd10", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"database": "dev_thuxuan", "schema": "ed_classification", "name": "ed_classification__johnston_icd9", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification__johnston_icd9.csv", "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd9"], "alias": "_value_set_johnston_icd9", "checksum": {"name": "sha256", "checksum": "77255f5ce0469f045a941b092e3ec84002afb0d3dabfc3d24acb0cfe29d90829"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd9": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "epct": "varchar", "noner": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd9',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ed_classification"], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd9": {"name": "icd9", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','johnston_icd9',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_johnston_icd9", "tags": "ed_classification", "enabled": true, "column_types": {"icd9": "varchar", "edcnnpa": "varchar", "edcnpa": "varchar", "epct": "varchar", "noner": "varchar", "injury": "varchar", "psych": "varchar", "alcohol": "varchar", "drug": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1399326, "relation_name": "dev_thuxuan.ed_classification._value_set_johnston_icd9", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__clinical_concepts": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__clinical_concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__clinical_concepts.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__clinical_concepts.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__clinical_concepts"], "alias": "_value_set_clinical_concepts", "checksum": {"name": "sha256", "checksum": "e130e1696ce203c3c7faec7efadfc972c4e7502553190544a2077b4c2817ac75"}, "config": {"enabled": true, "alias": "_value_set_clinical_concepts", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Value sets for clinical concepts.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_clinical_concepts.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_clinical_concepts", "tags": "hcc_suspecting", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1757038, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_clinical_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__hcc_descriptions", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__hcc_descriptions.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__hcc_descriptions.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__hcc_descriptions"], "alias": "_value_set_hcc_descriptions", "checksum": {"name": "sha256", "checksum": "7e7ac940d8a7da977e3e33e93d6690af3d6b36c8791fb14a10f06beb8f3f779f"}, "config": {"enabled": true, "alias": "_value_set_hcc_descriptions", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hcc_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_descriptions.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_hcc_descriptions", "tags": "hcc_suspecting", "enabled": true, "column_types": {"hcc_code": "varchar", "hcc_description": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.182704, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_hcc_descriptions", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": {"database": "dev_thuxuan", "schema": "hcc_suspecting", "name": "hcc_suspecting__icd_10_cm_mappings", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\hcc_suspecting\\hcc_suspecting__icd_10_cm_mappings.csv", "original_file_path": "seeds\\value_sets\\hcc_suspecting\\hcc_suspecting__icd_10_cm_mappings.csv", "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings", "fqn": ["the_tuva_project", "value_sets", "hcc_suspecting", "hcc_suspecting__icd_10_cm_mappings"], "alias": "_value_set_icd_10_cm_mappings", "checksum": {"name": "sha256", "checksum": "2d5d504da80762d6e23c1d61b5ba3ad0d50ab964d5dd914af92570aa536104a9"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "hcc_suspecting", "database": null, "tags": ["hcc_suspecting"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"diagnosis_code": "varchar", "cms_hcc_esrd_v21": "varchar", "cms_hcc_esrd_v24": "varchar", "cms_hcc_v22": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v28": "varchar", "rx_hcc_v05": "varchar", "rx_hcc_v08": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["hcc_suspecting"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\hcc_suspecting\\hcc_suspecting_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','hcc_suspecting_icd_10_cm_mappings.csv',compression=true,null_marker=true) }}", "schema": "hcc_suspecting", "alias": "_value_set_icd_10_cm_mappings", "tags": "hcc_suspecting", "enabled": true, "column_types": {"diagnosis_code": "varchar", "cms_hcc_esrd_v21": "varchar", "cms_hcc_esrd_v24": "varchar", "cms_hcc_v22": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v28": "varchar", "rx_hcc_v05": "varchar", "rx_hcc_v08": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.1942365, "relation_name": "dev_thuxuan.hcc_suspecting._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__concepts": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__concepts", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__concepts.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__concepts.csv", "unique_id": "seed.the_tuva_project.quality_measures__concepts", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__concepts"], "alias": "_value_set_concepts", "checksum": {"name": "sha256", "checksum": "327c96bdd4582e91ea0c6f7f2b9641eba1e3973dab46402760c175af6e3987a8"}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "measure_id": "varchar", "measure_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_concepts.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_concepts.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_concepts", "tags": "quality_measures", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "measure_id": "varchar", "measure_name": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.203041, "relation_name": "dev_thuxuan.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__measures": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__measures", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__measures.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__measures.csv", "unique_id": "seed.the_tuva_project.quality_measures__measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__measures"], "alias": "_value_set_measures", "checksum": {"name": "sha256", "checksum": "ffba1ed18ece6d32fe634f279e2833b355b51c66691ef06db717ee4ebb257992"}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"id": "varchar", "name": "varchar", "description": "varchar(3000)", "version": "varchar", "steward": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_measures.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_measures.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_measures", "tags": "quality_measures", "enabled": true, "column_types": {"id": "varchar", "name": "varchar", "description": "varchar(3000)", "version": "varchar", "steward": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2119706, "relation_name": "dev_thuxuan.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.quality_measures__value_sets": {"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__value_sets", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\quality_measures\\quality_measures__value_sets.csv", "original_file_path": "seeds\\value_sets\\quality_measures\\quality_measures__value_sets.csv", "unique_id": "seed.the_tuva_project.quality_measures__value_sets", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__value_sets"], "alias": "_value_set_codes", "checksum": {"name": "sha256", "checksum": "e130e1696ce203c3c7faec7efadfc972c4e7502553190544a2077b4c2817ac75"}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_value_set_codes.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','quality_measures_value_set_codes.csv',compression=true,null_marker=true) }}", "schema": "quality_measures", "alias": "_value_set_codes", "tags": "quality_measures", "enabled": true, "column_types": {"concept_name": "varchar", "concept_oid": "varchar", "code": "varchar", "code_system": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2216508, "relation_name": "dev_thuxuan.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__acute_diagnosis_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_ccs"], "alias": "_value_set_acute_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "e947ff0e7faffc92d8c129ee41271241fb9e43c5f3249f18403fe20faa9be669"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_acute_diagnosis_ccs", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2291586, "relation_name": "dev_thuxuan.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__acute_diagnosis_icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_icd_10_cm"], "alias": "_value_set_acute_diagnosis_icd_10_cm", "checksum": {"name": "sha256", "checksum": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','acute_diagnosis_icd_10_cm.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_acute_diagnosis_icd_10_cm", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2376869, "relation_name": "dev_thuxuan.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__always_planned_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_diagnosis_category"], "alias": "_value_set_always_planned_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "1bfbe31c1b65d38e97936d54fa477faf6b189e69e7659499bce52ab8e85fa82e"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2427087, "relation_name": "dev_thuxuan.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__always_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_procedure_category"], "alias": "_value_set_always_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "cfb84522da7baa39ff06dd37fbab4677b01ef87969039775a9708f70353a99b3"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2467253, "relation_name": "dev_thuxuan.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__exclusion_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__exclusion_ccs_diagnosis_category"], "alias": "_value_set_exclusion_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "ed6c92b04b1d9b79a34ed80022e4192f2394510f57fd0b4121a8e31a30198d70"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','exclusion_ccs_diagnosis_category.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_exclusion_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.254978, "relation_name": "dev_thuxuan.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "0f2119b159a22eeb902b925b2eb98357b33bbc09bae3b7fceb04de71cf041476"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2630599, "relation_name": "dev_thuxuan.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__icd_10_pcs_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_pcs_to_ccs"], "alias": "_value_set_icd_10_pcs_to_ccs", "checksum": {"name": "sha256", "checksum": "b152259e1a13057a37cf15ae765f61c7c9559340b5469fa93909ad910929fd0e"}, "config": {"enabled": true, "alias": "_value_set_icd_10_pcs_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_pcs_to_ccs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2737553, "relation_name": "dev_thuxuan.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__potentially_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_ccs_procedure_category"], "alias": "_value_set_potentially_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "d46cf571e714e7ddb997c7be419b496c51d9e7ce0342d72be61d06fc0bf55669"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_ccs_procedure_category.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_potentially_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2817557, "relation_name": "dev_thuxuan.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__potentially_planned_icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_icd_10_pcs"], "alias": "_value_set_potentially_planned_icd_10_pcs", "checksum": {"name": "sha256", "checksum": "1d18cafa0d405e60cd1be1e039fbfb2dfa9591a1cef6a441b60c26a61de41ad3"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','potentially_planned_icd_10_pcs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_potentially_planned_icd_10_pcs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.2917938, "relation_name": "dev_thuxuan.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__specialty_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__specialty_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__specialty_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__specialty_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__specialty_cohort"], "alias": "_value_set_specialty_cohort", "checksum": {"name": "sha256", "checksum": "c1d715929a890fd44e1d5ad4aa89785523f221ce8f5ae8765c11a0e524426a45"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','specialty_cohort.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','specialty_cohort.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_specialty_cohort", "tags": "readmissions", "enabled": true, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.299792, "relation_name": "dev_thuxuan.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"database": "dev_thuxuan", "schema": "readmissions", "name": "readmissions__surgery_gynecology_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__surgery_gynecology_cohort"], "alias": "_value_set_surgery_gynecology_cohort", "checksum": {"name": "sha256", "checksum": "ba95843249cbc3167b4887251bf4efbecb2418fe086791e2c428d5748b0e4167"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_surgery_gynecology_cohort", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "enabled": true, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.30729, "relation_name": "dev_thuxuan.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "dev_thuxuan", "schema": "claims_preprocessing", "name": "service_category__service_categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\service_categories\\service_category__service_categories.csv", "original_file_path": "seeds\\value_sets\\service_categories\\service_category__service_categories.csv", "unique_id": "seed.the_tuva_project.service_category__service_categories", "fqn": ["the_tuva_project", "value_sets", "service_categories", "service_category__service_categories"], "alias": "_value_set_service_categories", "checksum": {"name": "sha256", "checksum": "07a3a74f961c5a75143dbd6a0da9c8db46985bc07021c8ad351627b10faa6659"}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "claims_preprocessing", "database": null, "tags": ["service_category", "claims_preprocessing"], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"service_category_1": "varchar", "service_category_2": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#cf751b"}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','service_category_service_categories.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["service_category", "claims_preprocessing"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#cf751b"}, "patch_path": "the_tuva_project://seeds\\value_sets\\service_categories\\service_categories_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/versioned_value_sets/0.8.2','service_category_service_categories.csv',compression=true,null_marker=true) }}", "schema": "claims_preprocessing", "alias": "_value_set_service_categories", "tags": ["service_category", "claims_preprocessing"], "enabled": true, "column_types": {"service_category_1": "varchar", "service_category_2": "varchar"}, "docs": {"node_color": "#cf751b"}}, "created_at": 1715884193.3143346, "relation_name": "dev_thuxuan.claims_preprocessing._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd9_icd9"], "alias": "unique_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884193.1601784, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd9 as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd9\nwhere icd9 is not null\ngroup by icd9\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd9", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd9')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd9_icd9", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd9_icd9"], "alias": "not_null_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884193.1621802, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd9", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd9_icd9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd9\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd9\nwhere icd9 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd9", "file_key_name": "seeds.ed_classification__johnston_icd9", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd10_icd10"], "alias": "unique_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884193.16418, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\unique_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n icd10 as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd10\nwhere icd10 is not null\ngroup by icd10\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "icd10", "model": "{{ get_where_subquery(ref('ed_classification__johnston_icd10')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ed_classification__johnston_icd10_icd10", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml", "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd10_icd10"], "alias": "not_null_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884193.1651795, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "ed_classification__johnston_icd10", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\seeds\\value_sets\\ed_classification\\ed_classification_seeds.yml\\not_null_ed_classification__johnston_icd10_icd10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect icd10\nfrom dev_thuxuan.ed_classification._value_set_johnston_icd10\nwhere icd10 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10", "attached_node": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "fqn": ["the_tuva_project", "ccsr", "not_null_ccsr__singular_condition_category_claim_id"], "alias": "not_null_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884193.5237818, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b", "fqn": ["the_tuva_project", "ccsr", "unique_ccsr__singular_condition_category_claim_id"], "alias": "unique_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884193.525776, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "ccsr__singular_condition_category", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n claim_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.ccsr.singular_condition_category\nwhere claim_id is not null\ngroup by claim_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category", "attached_node": "model.the_tuva_project.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1715884193.5973105, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1715884193.5983086, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id"], "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1715884193.5993881, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id"], "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1715884193.600977, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_condition"], "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1715884193.6019824, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_"], "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1715884193.604065, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || claim_id || start_date || condition) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.cms_chronic_conditions_long\nwhere (patient_id || claim_id || start_date || condition) is not null\ngroup by (patient_id || claim_id || start_date || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id"], "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1715884193.6050582, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id"], "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1715884193.6060362, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_condition"], "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1715884193.6070666, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_all", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id"], "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1715884193.6090071, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id"], "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1715884193.6100652, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition"], "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1715884193.6110332, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_"], "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1715884193.612064, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_hiv_aids\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id"], "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1715884193.620777, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id"], "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1715884193.6217535, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_condition"], "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1715884193.623848, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_"], "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1715884193.6253338, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__cms_chronic_conditions_oud", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from dev_thuxuan.chronic_conditions._int_cms_chronic_condition_oud\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Opioid Use Disorder (OUD)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud", "attached_node": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_long')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_"], "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1715884193.658306, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || condition) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_long\nwhere (patient_id || '_' || condition) is not null\ngroup by (patient_id || '_' || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1715884193.659311, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1715884193.6603107, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [{"name": "chronic_conditions__tuva_chronic_conditions_wide", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide", "attached_node": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('normalized_input__medical_claim')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_normalized_input__medical_claim__claim_id_claim_line_number_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46.sql", "original_file_path": "models\\claims_preprocessing\\claims_preprocessing_models.yml", "unique_id": "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f", "fqn": ["the_tuva_project", "claims_preprocessing", "unique_normalized_input__medical_claim__claim_id_claim_line_number_"], "alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46"}, "created_at": 1715884194.0206633, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46\") }}", "language": "sql", "refs": [{"name": "normalized_input__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.normalized_input__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\claims_preprocessing_models.yml\\unique_normalized_input__medic_bbd2054a58f89fc572df7bb74dd9ab46.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (claim_id||'-'||claim_line_number) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.claims_preprocessing.normalized_input_medical_claim\nwhere (claim_id||'-'||claim_line_number) is not null\ngroup by (claim_id||'-'||claim_line_number)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.normalized_input__medical_claim", "attached_node": "model.the_tuva_project.normalized_input__medical_claim"}, "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__patient_risk_scores')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__patient_risk_scores_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__patient_risk_scores_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__patient_risk_scores_patient_id"], "alias": "unique_cms_hcc__patient_risk_scores_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.1149085, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc.patient_risk_scores\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores", "attached_node": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id||'-'||model_version)", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_demographic_factors__patient_id_model_version_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors__patient_id_model_version_"], "alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87"}, "created_at": 1715884194.1159081, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87\") }}", "language": "sql", "refs": [{"name": "cms_hcc__int_demographic_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_demographi_537430abb11ae183012a8a0db61e9c87.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id||'-'||model_version) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc._int_demographic_factors\nwhere (patient_id||'-'||model_version) is not null\ngroup by (patient_id||'-'||model_version)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.cms_hcc__int_demographic_factors", "attached_node": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_eligible_conditions_condition_code", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_eligible_conditions_condition_code"], "alias": "not_null_cms_hcc__int_eligible_conditions_condition_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.117413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_eligible_conditions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_code\nfrom dev_thuxuan.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions", "attached_node": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_members_patient_id"], "alias": "not_null_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.119421, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom dev_thuxuan.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_members_patient_id"], "alias": "unique_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.1204195, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "cms_hcc__int_members", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.cms_hcc._int_members\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members", "attached_node": "model.the_tuva_project.cms_hcc__int_members"}, "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "condition_id", "model": "{{ get_where_subquery(ref('core__condition')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__condition_condition_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__condition_condition_id.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0", "fqn": ["the_tuva_project", "core", "unique_core__condition_condition_id"], "alias": "unique_core__condition_condition_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.3078, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__condition_condition_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n condition_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.condition\nwhere condition_id is not null\ngroup by condition_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "condition_id", "file_key_name": "models.core__condition", "attached_node": "model.the_tuva_project.core__condition"}, "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('core__medical_claim')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__medical_claim__claim_id_claim_line_number_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__medical_claim__claim_id_claim_line_number_.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0", "fqn": ["the_tuva_project", "core", "unique_core__medical_claim__claim_id_claim_line_number_"], "alias": "unique_core__medical_claim__claim_id_claim_line_number_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.3097968, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__medical_claim", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__medical_claim__claim_id_claim_line_number_.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (claim_id||'-'||claim_line_number) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.medical_claim\nwhere (claim_id||'-'||claim_line_number) is not null\ngroup by (claim_id||'-'||claim_line_number)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.core__medical_claim", "attached_node": "model.the_tuva_project.core__medical_claim"}, "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "procedure_id", "model": "{{ get_where_subquery(ref('core__procedure')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_core__procedure_procedure_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__procedure_procedure_id.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5", "fqn": ["the_tuva_project", "core", "unique_core__procedure_procedure_id"], "alias": "unique_core__procedure_procedure_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.3107939, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__procedure_procedure_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n procedure_id as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.core.procedure\nwhere procedure_id is not null\ngroup by procedure_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "procedure_id", "file_key_name": "models.core__procedure", "attached_node": "model.the_tuva_project.core__procedure"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_summary_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_summary_source_table"], "alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10"}, "created_at": 1715884194.4310462, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__f679bb8922eec2815a77cfff081e9e10.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_summary\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_summary_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_summary_test_category"], "alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477"}, "created_at": 1715884194.432046, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__336abc6fa3e364c103685e2faae83477.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_summary\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": {"test_metadata": {"name": "claims_preprocessing_pipeline_checks", "kwargs": {"model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_summary')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_", "resource_type": "test", "package_name": "the_tuva_project", "path": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "fqn": ["the_tuva_project", "data_quality", "claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_"], "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c"}, "created_at": 1715884194.4345505, "relation_name": null, "raw_code": "{{ test_claims_preprocessing_pipeline_checks(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_summary", "package": null, "version": null}, {"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.test_claims_preprocessing_pipeline_checks", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\claims_preprocessing_pipeline__d4efae38f014be38415215d3c15b873c.sql", "compiled": true, "compiled_code": "\n\n select *\n from dev_thuxuan.data_quality.claims_preprocessing_test_detail\n where pipeline_test = 1\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.data_quality__claims_preprocessing_summary", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_source_table"], "alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08"}, "created_at": 1715884194.4395635, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__5898c059411e7fc10ba8219c734e6e08.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_test_category"], "alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80"}, "created_at": 1715884194.4405632, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__56459226ea7065b8eb9a80d40b78ff80.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_detail')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_detail_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_detail_test_name"], "alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049"}, "created_at": 1715884194.4425633, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_detail", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__f05207c475588fc8a73c0e2b3a575049.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_detail\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_test_detail", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__412833294baa145f20c48137d8814886.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_source_table"], "alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__412833294baa145f20c48137d8814886"}, "created_at": 1715884194.4435637, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__412833294baa145f20c48137d8814886\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__412833294baa145f20c48137d8814886.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_category", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_test_category", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_test_category"], "alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367"}, "created_at": 1715884194.4445636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__b2af6c316533f702a46cd6223fa65367.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_category\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere test_category is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_category", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_test_result')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_test_result_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_test_result_test_name"], "alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49"}, "created_at": 1715884194.4455636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_test_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__9b4fbcc2957c4f9bd554a6666f91ad49.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_test_result\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_test_result", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "use_case", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_use_case", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims_preprocessing_use_case_use_case.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_use_case"], "alias": "not_null_data_quality__claims_preprocessing_use_case_use_case", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.4465635, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims_preprocessing_use_case_use_case.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect use_case\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere use_case is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "use_case", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "source_table", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_source_table", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_source_table"], "alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37"}, "created_at": 1715884194.4475634, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37\") }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims__e20e4fef5e6980ffb07c442849539e37.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect source_table\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere source_table is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "source_table", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "test_name", "model": "{{ get_where_subquery(ref('data_quality__claims_preprocessing_use_case')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_data_quality__claims_preprocessing_use_case_test_name", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_data_quality__claims_preprocessing_use_case_test_name.sql", "original_file_path": "models\\data_quality\\data_quality_models.yml", "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa", "fqn": ["the_tuva_project", "data_quality", "not_null_data_quality__claims_preprocessing_use_case_test_name"], "alias": "not_null_data_quality__claims_preprocessing_use_case_test_name", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1715884194.449564, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "data_quality__claims_preprocessing_use_case", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\data_quality\\data_quality_models.yml\\not_null_data_quality__claims_preprocessing_use_case_test_name.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect test_name\nfrom dev_thuxuan.data_quality.claims_preprocessing_use_case\nwhere test_name is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "test_name", "file_key_name": "models.data_quality__claims_preprocessing_use_case", "attached_node": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month || '_' || plan)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "original_file_path": "models\\financial_pmpm\\financial_pmpm_models.yml", "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_"], "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf"}, "created_at": 1715884194.6198876, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf\") }}", "language": "sql", "refs": [{"name": "financial_pmpm__pmpm_prep", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || year_month || '_' || plan) as unique_field,\n count(*) as n_records\n\nfrom dev_thuxuan.financial_pmpm.pmpm_prep\nwhere (patient_id || '_' || year_month || '_' || plan) is not null\ngroup by (patient_id || '_' || year_month || '_' || plan)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep", "attached_node": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__condition')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__condition_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__condition_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__condition_patient_id"], "alias": "not_null_quality_measures__stg_core__condition_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0434413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__condition_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__condition\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , encounter_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.condition\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition", "attached_node": "model.the_tuva_project.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__encounter_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__encounter_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__encounter_patient_id"], "alias": "not_null_quality_measures__stg_core__encounter_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.045441, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__encounter", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__encounter_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__encounter\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.encounter\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter", "attached_node": "model.the_tuva_project.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__medication_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__medication_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__medication_patient_id"], "alias": "not_null_quality_measures__stg_core__medication_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0474415, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__medication_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__medication\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , encounter_id\n , prescribing_date \n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.medication\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication", "attached_node": "model.the_tuva_project.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__observation_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__observation_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__observation_patient_id"], "alias": "not_null_quality_measures__stg_core__observation_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0484412, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__observation_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__observation\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , encounter_id\n , observation_date\n , result\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , normalized_description\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.observation\n\n\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation", "attached_node": "model.the_tuva_project.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_patient_id"], "alias": "not_null_quality_measures__stg_core__patient_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0509503, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_sex", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_sex.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_sex"], "alias": "not_null_quality_measures__stg_core__patient_sex", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0529618, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select sex\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere sex is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male", "unknown"], "column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b", "fqn": ["the_tuva_project", "quality_measures", "accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown"], "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae"}, "created_at": 1715884195.0549624, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\accepted_values_quality_measur_afa1e7d743ee8876cacdbc7a17f0b0ae.sql", "compiled": true, "compiled_code": "\n \n \n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n),all_values as (\n\n select\n sex as value_field,\n count(*) as n_records\n\n from __dbt__cte__quality_measures__stg_core__patient\n group by sex\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'female','male','unknown'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_birth_date", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_birth_date.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_birth_date"], "alias": "not_null_quality_measures__stg_core__patient_birth_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0589654, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__patient", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_birth_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)select birth_date\nfrom __dbt__cte__quality_measures__stg_core__patient\nwhere birth_date is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.patient\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient", "attached_node": "model.the_tuva_project.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "database": "dev_thuxuan", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__procedure_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__procedure_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__procedure_patient_id"], "alias": "not_null_quality_measures__stg_core__procedure_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1715884195.0609663, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [{"name": "quality_measures__stg_core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__procedure_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)select patient_id\nfrom __dbt__cte__quality_measures__stg_core__procedure\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , encounter_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2024-05-16 18:33:00.017657+00:00' as tuva_last_run\nfrom dev_thuxuan.core.procedure\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure", "attached_node": "model.the_tuva_project.quality_measures__stg_core__procedure"}}, "sources": {}, "macros": {"macro.input_layer.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\generate_schema_name.sql", "original_file_path": "../macros\\generate_schema_name.sql", "unique_id": "macro.input_layer.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\r\n {%- set default_schema = target.schema -%}\r\n {%- if custom_schema_name is not none -%}\r\n {{ custom_schema_name | trim }}\r\n {%- else -%}\r\n {{ default_schema }}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8516195, "supported_languages": null}, "macro.input_layer.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8536263, "supported_languages": null}, "macro.input_layer.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.bigquery__try_to_cast_date", "macro_sql": "{%- macro bigquery__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n safe_cast( date( {{ column_name }} ) as date )\r\n {%- else -%}\r\n safe_cast( {{ column_name }} as date )\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8536263, "supported_languages": null}, "macro.input_layer.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.default__try_to_cast_date", "macro_sql": "{%- macro default__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8536263, "supported_languages": null}, "macro.input_layer.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.postgres__try_to_cast_date", "macro_sql": "{%- macro postgres__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}[0-9]{2}[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{2}/[0-9]{2}/[0-9]{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8546271, "supported_languages": null}, "macro.input_layer.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.redshift__try_to_cast_date", "macro_sql": "{%- macro redshift__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}\\\\d{2}\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{2}/\\\\d{2}/\\\\d{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2} \\\\d{2}:\\\\d{2}:\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8556254, "supported_languages": null}, "macro.input_layer.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.snowflake__try_to_cast_date", "macro_sql": "{%- macro snowflake__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8556254, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"name": "snowflake__create_table_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {% set compiled_code = get_select_subquery(compiled_code) %}\n {% endif %}\n {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from (\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery", "macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8701305, "supported_languages": null}, "macro.dbt_snowflake.get_column_comment_sql": {"name": "get_column_comment_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_column_comment_sql", "macro_sql": "{% macro get_column_comment_sql(column_name, column_dict) -%}\n {% if (column_name|upper in column_dict) -%}\n {% set matched_column = column_name|upper -%}\n {% elif (column_name|lower in column_dict) -%}\n {% set matched_column = column_name|lower -%}\n {% elif (column_name in column_dict) -%}\n {% set matched_column = column_name -%}\n {% else -%}\n {% set matched_column = None -%}\n {% endif -%}\n {% if matched_column -%}\n {{ adapter.quote(column_name) }} COMMENT $${{ column_dict[matched_column]['description'] | replace('$', '[$]') }}$$\n {%- else -%}\n {{ adapter.quote(column_name) }} COMMENT $$$$\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.871131, "supported_languages": null}, "macro.dbt_snowflake.get_persist_docs_column_list": {"name": "get_persist_docs_column_list", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_persist_docs_column_list", "macro_sql": "{% macro get_persist_docs_column_list(model_columns, query_columns) %}\n(\n {% for column_name in query_columns %}\n {{ get_column_comment_sql(column_name, model_columns) }}\n {{- \", \" if not loop.last else \"\" }}\n {% endfor %}\n)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8721309, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag": {"name": "snowflake__create_view_as_with_temp_flag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro_sql": "{% macro snowflake__create_view_as_with_temp_flag(relation, sql, is_temporary=False) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} {% if is_temporary -%}\n temporary\n {%- endif %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {%- set contract_config = config.get('contract') -%}\n {%- if contract_config.enforced -%}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list", "macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8731306, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as": {"name": "snowflake__create_view_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as", "macro_sql": "{% macro snowflake__create_view_as(relation, sql) -%}\n {{ snowflake__create_view_as_with_temp_flag(relation, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8731306, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_columns_in_relation": {"name": "snowflake__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_columns_in_relation", "macro_sql": "{% macro snowflake__get_columns_in_relation(relation) -%}\n {%- set sql -%}\n describe table {{ relation }}\n {%- endset -%}\n {%- set result = run_query(sql) -%}\n\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many columns in relation {{ relation }}! dbt can only get\n information about relations with fewer than {{ maximum }} columns.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% set columns = [] %}\n {% for row in result %}\n {% do columns.append(api.Column.from_description(row['name'], row['type'])) %}\n {% endfor %}\n {% do return(columns) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8741307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_schemas": {"name": "snowflake__list_schemas", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_schemas", "macro_sql": "{% macro snowflake__list_schemas(database) -%}\n {# 10k limit from here: https://docs.snowflake.net/manuals/sql-reference/sql/show-schemas.html#usage-notes #}\n {% set maximum = 10000 %}\n {% set sql -%}\n show terse schemas in database {{ database }}\n limit {{ maximum }}\n {%- endset %}\n {% set result = run_query(sql) %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in database {{ database }}! dbt can only get\n information about databases with fewer than {{ maximum }} schemas.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {{ return(result) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8751307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"name": "snowflake__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many objects in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8751307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__check_schema_exists": {"name": "snowflake__check_schema_exists", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__check_schema_exists", "macro_sql": "{% macro snowflake__check_schema_exists(information_schema, schema) -%}\n {% call statement('check_schema_exists', fetch_result=True) -%}\n select count(*)\n from {{ information_schema }}.schemata\n where upper(schema_name) = upper('{{ schema }}')\n and upper(catalog_name) = upper('{{ information_schema.database }}')\n {%- endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8761306, "supported_languages": null}, "macro.dbt_snowflake.snowflake__rename_relation": {"name": "snowflake__rename_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__rename_relation", "macro_sql": "{% macro snowflake__rename_relation(from_relation, to_relation) -%}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ to_relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8761306, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_type": {"name": "snowflake__alter_column_type", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_column_type", "macro_sql": "{% macro snowflake__alter_column_type(relation, column_name, new_column_type) -%}\n {% call statement('alter_column_type') %}\n alter table {{ relation }} alter {{ adapter.quote(column_name) }} set data type {{ new_column_type }};\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8761306, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_comment": {"name": "snowflake__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_relation_comment", "macro_sql": "{% macro snowflake__alter_relation_comment(relation, relation_comment) -%}\n comment on {{ relation.type }} {{ relation }} IS $${{ relation_comment | replace('$', '[$]') }}$$;\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8771305, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_comment": {"name": "snowflake__alter_column_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_column_comment", "macro_sql": "{% macro snowflake__alter_column_comment(relation, column_dict) -%}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n alter {{ relation.type }} {{ relation }} alter\n {% for column_name in existing_columns if (column_name in existing_columns) or (column_name|lower in existing_columns) %}\n {{ get_column_comment_sql(column_name, column_dict) }} {{- ',' if not loop.last else ';' }}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8771305, "supported_languages": null}, "macro.dbt_snowflake.get_current_query_tag": {"name": "get_current_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.get_current_query_tag", "macro_sql": "{% macro get_current_query_tag() -%}\n {{ return(run_query(\"show parameters like 'query_tag' in session\").rows[0]['value']) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8781307, "supported_languages": null}, "macro.dbt_snowflake.set_query_tag": {"name": "set_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.set_query_tag", "macro_sql": "{% macro set_query_tag() -%}\n {{ return(adapter.dispatch('set_query_tag', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__set_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8781307, "supported_languages": null}, "macro.dbt_snowflake.snowflake__set_query_tag": {"name": "snowflake__set_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__set_query_tag", "macro_sql": "{% macro snowflake__set_query_tag() -%}\n {% set new_query_tag = config.get('query_tag') %}\n {% if new_query_tag %}\n {% set original_query_tag = get_current_query_tag() %}\n {{ log(\"Setting query_tag to '\" ~ new_query_tag ~ \"'. Will reset to '\" ~ original_query_tag ~ \"' after materialization.\") }}\n {% do run_query(\"alter session set query_tag = '{}'\".format(new_query_tag)) %}\n {{ return(original_query_tag)}}\n {% endif %}\n {{ return(none)}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.get_current_query_tag", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.879136, "supported_languages": null}, "macro.dbt_snowflake.unset_query_tag": {"name": "unset_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.unset_query_tag", "macro_sql": "{% macro unset_query_tag(original_query_tag) -%}\n {{ return(adapter.dispatch('unset_query_tag', 'dbt')(original_query_tag)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.879136, "supported_languages": null}, "macro.dbt_snowflake.snowflake__unset_query_tag": {"name": "snowflake__unset_query_tag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__unset_query_tag", "macro_sql": "{% macro snowflake__unset_query_tag(original_query_tag) -%}\n {% set new_query_tag = config.get('query_tag') %}\n {% if new_query_tag %}\n {% if original_query_tag %}\n {{ log(\"Resetting query_tag to '\" ~ original_query_tag ~ \"'.\") }}\n {% do run_query(\"alter session set query_tag = '{}'\".format(original_query_tag)) %}\n {% else %}\n {{ log(\"No original query_tag, unsetting parameter.\") }}\n {% do run_query(\"alter session unset query_tag\") %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.880133, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns": {"name": "snowflake__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns", "macro_sql": "{% macro snowflake__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {% for column in add_columns %}\n {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n {% endif %}\n\n {% if remove_columns %}\n\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {% for column in remove_columns %}\n {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8811333, "supported_languages": null}, "macro.dbt_snowflake.snowflake_dml_explicit_transaction": {"name": "snowflake_dml_explicit_transaction", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake_dml_explicit_transaction", "macro_sql": "{% macro snowflake_dml_explicit_transaction(dml) %}\n {#\n Use this macro to wrap all INSERT, MERGE, UPDATE, DELETE, and TRUNCATE\n statements before passing them into run_query(), or calling in the 'main' statement\n of a materialization\n #}\n {% set dml_transaction -%}\n begin;\n {{ dml }};\n commit;\n {%- endset %}\n\n {% do return(dml_transaction) %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8811333, "supported_languages": null}, "macro.dbt_snowflake.snowflake__truncate_relation": {"name": "snowflake__truncate_relation", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__truncate_relation", "macro_sql": "{% macro snowflake__truncate_relation(relation) -%}\n {% set truncate_dml %}\n truncate table {{ relation }}\n {% endset %}\n {% call statement('truncate_relation') -%}\n {{ snowflake_dml_explicit_transaction(truncate_dml) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8811333, "supported_languages": null}, "macro.dbt_snowflake.snowflake__copy_grants": {"name": "snowflake__copy_grants", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\apply_grants.sql", "original_file_path": "macros\\apply_grants.sql", "unique_id": "macro.dbt_snowflake.snowflake__copy_grants", "macro_sql": "{% macro snowflake__copy_grants() %}\n {% set copy_grants = config.get('copy_grants', False) %}\n {{ return(copy_grants) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8821318, "supported_languages": null}, "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement": {"name": "snowflake__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\apply_grants.sql", "original_file_path": "macros\\apply_grants.sql", "unique_id": "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro snowflake__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(False) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8821318, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_catalog": {"name": "snowflake__get_catalog", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\catalog.sql", "original_file_path": "macros\\catalog.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_catalog", "macro_sql": "{% macro snowflake__get_catalog(information_schema, schemas) -%}\n {% set query %}\n with tables as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n table_type as \"table_type\",\n comment as \"table_comment\",\n\n -- note: this is the _role_ that owns the table\n table_owner as \"table_owner\",\n\n 'Clustering Key' as \"stats:clustering_key:label\",\n clustering_key as \"stats:clustering_key:value\",\n 'The key used to cluster this table' as \"stats:clustering_key:description\",\n (clustering_key is not null) as \"stats:clustering_key:include\",\n\n 'Row Count' as \"stats:row_count:label\",\n row_count as \"stats:row_count:value\",\n 'An approximate count of rows in this table' as \"stats:row_count:description\",\n (row_count is not null) as \"stats:row_count:include\",\n\n 'Approximate Size' as \"stats:bytes:label\",\n bytes as \"stats:bytes:value\",\n 'Approximate size of the table as reported by Snowflake' as \"stats:bytes:description\",\n (bytes is not null) as \"stats:bytes:include\",\n\n 'Last Modified' as \"stats:last_modified:label\",\n to_varchar(convert_timezone('UTC', last_altered), 'yyyy-mm-dd HH24:MI'||'UTC') as \"stats:last_modified:value\",\n 'The timestamp for last update/change' as \"stats:last_modified:description\",\n (last_altered is not null and table_type='BASE TABLE') as \"stats:last_modified:include\"\n\n from {{ information_schema }}.tables\n\n ),\n\n columns as (\n\n select\n table_catalog as \"table_database\",\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n\n column_name as \"column_name\",\n ordinal_position as \"column_index\",\n data_type as \"column_type\",\n comment as \"column_comment\"\n\n from {{ information_schema }}.columns\n )\n\n select *\n from tables\n join columns using (\"table_database\", \"table_schema\", \"table_name\")\n where (\n {%- for schema in schemas -%}\n upper(\"table_schema\") = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n order by \"column_index\"\n {%- endset -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8832452, "supported_languages": null}, "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type": {"name": "dbt_snowflake_get_tmp_relation_type", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type", "macro_sql": "{% macro dbt_snowflake_get_tmp_relation_type(strategy, unique_key, language) %}\n{%- set tmp_relation_type = config.get('tmp_relation_type') -%}\n /* {#\n High-level principles:\n If we are running multiple statements (DELETE + INSERT),\n and we want to guarantee identical inputs to both statements,\n then we must first save the model query results as a temporary table\n (which presumably comes with a performance cost).\n If we are running a single statement (MERGE or INSERT alone),\n we _may_ save the model query definition as a view instead,\n for (presumably) faster overall incremental processing.\n\n Low-level specifics:\n If an invalid option is specified, then we will raise an\n excpetion with corresponding message.\n\n Languages other than SQL (like Python) will use a temporary table.\n With the default strategy of merge, the user may choose between a temporary\n table and view (defaulting to view).\n\n The append strategy can use a view because it will run a single INSERT statement.\n\n When unique_key is none, the delete+insert strategy can use a view beacuse a\n single INSERT statement is run with no DELETES as part of the statement.\n Otherwise, play it safe by using a temporary table.\n #} */\n\n {% if language == \"python\" and tmp_relation_type is not none %}\n {% do exceptions.raise_compiler_error(\n \"Python models currently only support 'table' for tmp_relation_type but \"\n ~ tmp_relation_type ~ \" was specified.\"\n ) %}\n {% endif %}\n\n {% if strategy == \"delete+insert\" and tmp_relation_type is not none and tmp_relation_type != \"table\" and unique_key is not none %}\n {% do exceptions.raise_compiler_error(\n \"In order to maintain consistent results when `unique_key` is not none,\n the `delete+insert` strategy only supports `table` for `tmp_relation_type` but \"\n ~ tmp_relation_type ~ \" was specified.\"\n )\n %}\n {% endif %}\n\n {% if language != \"sql\" %}\n {{ return(\"table\") }}\n {% elif tmp_relation_type == \"table\" %}\n {{ return(\"table\") }}\n {% elif tmp_relation_type == \"view\" %}\n {{ return(\"view\") }}\n {% elif strategy in (\"default\", \"merge\", \"append\") %}\n {{ return(\"view\") }}\n {% elif strategy == \"delete+insert\" and unique_key is none %}\n {{ return(\"view\") }}\n {% else %}\n {{ return(\"table\") }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8858118, "supported_languages": null}, "macro.dbt_snowflake.materialization_incremental_snowflake": {"name": "materialization_incremental_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.materialization_incremental_snowflake", "macro_sql": "{% materialization incremental, adapter='snowflake', supported_languages=['sql', 'python'] -%}\n\n {% set original_query_tag = set_query_tag() %}\n\n {#-- Set vars --#}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] -%}\n {% set target_relation = this %}\n {% set existing_relation = load_relation(this) %}\n\n {#-- The temp relation will be a view (faster) or temp table, depending on upsert/merge strategy --#}\n {%- set unique_key = config.get('unique_key') -%}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set tmp_relation_type = dbt_snowflake_get_tmp_relation_type(incremental_strategy, unique_key, language) %}\n {% set tmp_relation = make_temp_relation(this).incorporate(type=tmp_relation_type) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- Can't overwrite a view with a table - we must drop --#}\n {{ log(\"Dropping relation \" ~ target_relation ~ \" because it is a view and this model is a table.\") }}\n {% do adapter.drop_relation(existing_relation) %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n {% elif full_refresh_mode %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {#-- Create the temp relation, either as a view or as a temp table --#}\n {% if tmp_relation_type == 'view' %}\n {%- call statement('create_tmp_relation') -%}\n {{ snowflake__create_view_as_with_temp_flag(tmp_relation, compiled_code, True) }}\n {%- endcall -%}\n {% else %}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ create_table_as(True, tmp_relation, compiled_code, language) }}\n {%- endcall -%}\n {% endif %}\n\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': tmp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n\n {%- call statement('main') -%}\n {{ strategy_sql_macro_func(strategy_arg_dict) }}\n {%- endcall -%}\n {% endif %}\n\n {% do drop_relation_if_exists(tmp_relation) %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = target_relation.incorporate(type='table') %}\n\n {% set should_revoke =\n should_revoke(existing_relation.is_table, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type", "macro.dbt.make_temp_relation", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro.dbt.process_schema_changes", "macro.dbt.drop_relation_if_exists", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8898659, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.snowflake__get_incremental_default_sql": {"name": "snowflake__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\incremental.sql", "original_file_path": "macros\\materializations\\incremental.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_incremental_default_sql", "macro_sql": "{% macro snowflake__get_incremental_default_sql(arg_dict) %}\n {{ return(get_incremental_merge_sql(arg_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8908172, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_merge_sql": {"name": "snowflake__get_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_merge_sql", "macro_sql": "{% macro snowflake__get_merge_sql(target, source_sql, unique_key, dest_columns, incremental_predicates) -%}\n\n {#\n Workaround for Snowflake not being happy with a merge on a constant-false predicate.\n When no unique_key is provided, this macro will do a regular insert. If a unique_key\n is provided, then this macro will do a proper merge instead.\n #}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute='name')) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set dml -%}\n {%- if unique_key is none -%}\n\n {{ sql_header if sql_header is not none }}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source_sql }}\n )\n\n {%- else -%}\n\n {{ default__get_merge_sql(target, source_sql, unique_key, dest_columns, incremental_predicates) }}\n\n {%- endif -%}\n {%- endset -%}\n\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.default__get_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8918154, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql": {"name": "snowflake__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql", "macro_sql": "{% macro snowflake__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) %}\n {% set dml = default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) %}\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.892816, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_merge_sql": {"name": "snowflake__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\merge.sql", "original_file_path": "macros\\materializations\\merge.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_merge_sql", "macro_sql": "{% macro snowflake__snapshot_merge_sql(target, source, insert_cols) %}\n {% set dml = default__snapshot_merge_sql(target, source, insert_cols) %}\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql", "macro.dbt_snowflake.snowflake_dml_explicit_transaction"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.892816, "supported_languages": null}, "macro.dbt_snowflake.snowflake__load_csv_rows": {"name": "snowflake__load_csv_rows", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\seed.sql", "original_file_path": "macros\\materializations\\seed.sql", "unique_id": "macro.dbt_snowflake.snowflake__load_csv_rows", "macro_sql": "{% macro snowflake__load_csv_rows(model, agate_table) %}\n {% set batch_size = get_batch_size() %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query('BEGIN', auto_begin=False) %}\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n {% do adapter.add_query('COMMIT', auto_begin=False) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8958328, "supported_languages": null}, "macro.dbt_snowflake.materialization_seed_snowflake": {"name": "materialization_seed_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\seed.sql", "original_file_path": "macros\\materializations\\seed.sql", "unique_id": "macro.dbt_snowflake.materialization_seed_snowflake", "macro_sql": "{% materialization seed, adapter='snowflake' %}\n {% set original_query_tag = set_query_tag() %}\n\n {% set relations = materialization_seed_default() %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return(relations) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_seed_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8958328, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_snapshot_snowflake": {"name": "materialization_snapshot_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshot.sql", "unique_id": "macro.dbt_snowflake.materialization_snapshot_snowflake", "macro_sql": "{% materialization snapshot, adapter='snowflake' %}\n {% set original_query_tag = set_query_tag() %}\n {% set relations = materialization_snapshot_default() %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return(relations) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_snapshot_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8958328, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_table_snowflake": {"name": "materialization_table_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.materialization_table_snowflake", "macro_sql": "{% materialization table, adapter='snowflake', supported_languages=['sql', 'python']%}\n\n {% set original_query_tag = set_query_tag() %}\n\n {%- set identifier = model['alias'] -%}\n {%- set language = model['language'] -%}\n\n {% set grant_config = config.get('grants') %}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#-- Drop the relation if it was a view to \"convert\" it in a table. This may lead to\n -- downtime, but it should be a relatively infrequent occurrence #}\n {% if old_relation is not none and not old_relation.is_table %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ drop_relation_if_exists(old_relation) }}\n {% endif %}\n\n {% call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8988318, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation, temporary=False) %}\n{{ compiled_code }}\ndef materialize(session, df, target_relation):\n # make sure pandas exists\n import importlib.util\n package_name = 'pandas'\n if importlib.util.find_spec(package_name):\n import pandas\n if isinstance(df, pandas.core.frame.DataFrame):\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n {% set target_relation_name = resolve_model_name(target_relation) %}\n df.write.mode(\"overwrite\").save_as_table('{{ target_relation_name }}', create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.8988318, "supported_languages": null}, "macro.dbt_snowflake.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.py_script_comment", "macro_sql": "{% macro py_script_comment()%}\n# To run this in snowsight, you need to select entry point to be main\n# And you may have to modify the return type to text to get the result back\n# def main(session):\n# dbt = dbtObj(session.table)\n# df = model(dbt, session)\n# return df.collect()\n\n# to run this in local notebook, you need to create a session following examples https://github.com/Snowflake-Labs/sfguide-getting-started-snowpark-python\n# then you can do the following to run model\n# dbt = dbtObj(session.table)\n# df = model(dbt, session)\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.899834, "supported_languages": null}, "macro.dbt_snowflake.materialization_test_snowflake": {"name": "materialization_test_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\test.sql", "original_file_path": "macros\\materializations\\test.sql", "unique_id": "macro.dbt_snowflake.materialization_test_snowflake", "macro_sql": "{%- materialization test, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set relations = materialization_test_default() %}\n {% do unset_query_tag(original_query_tag) %}\n {{ return(relations) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.materialization_test_default", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.899834, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"name": "materialization_view_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\view.sql", "original_file_path": "macros\\materializations\\view.sql", "unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.create_or_replace_view", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9008322, "supported_languages": ["sql"]}, "macro.dbt_snowflake.snowflake__array_construct": {"name": "snowflake__array_construct", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt_snowflake.snowflake__array_construct", "macro_sql": "{% macro snowflake__array_construct(inputs, data_type) -%}\n array_construct( {{ inputs|join(' , ') }} )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9008322, "supported_languages": null}, "macro.dbt_snowflake.snowflake__bool_or": {"name": "snowflake__bool_or", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt_snowflake.snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n\n boolor_agg({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9008322, "supported_languages": null}, "macro.dbt_snowflake.snowflake__escape_single_quotes": {"name": "snowflake__escape_single_quotes", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt_snowflake.snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9008322, "supported_languages": null}, "macro.dbt_snowflake.snowflake__right": {"name": "snowflake__right", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt_snowflake.snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9008322, "supported_languages": null}, "macro.dbt_snowflake.snowflake__safe_cast": {"name": "snowflake__safe_cast", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt_snowflake.snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9020014, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp": {"name": "snowflake__current_timestamp", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp", "macro_sql": "{% macro snowflake__current_timestamp() -%}\n convert_timezone('UTC', current_timestamp())\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9020014, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_string_as_time": {"name": "snowflake__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_string_as_time", "macro_sql": "{% macro snowflake__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"to_timestamp_ntz('\" ~ timestamp ~ \"')\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9020014, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_get_time": {"name": "snowflake__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__snapshot_get_time", "macro_sql": "{% macro snowflake__snapshot_get_time() -%}\n to_timestamp_ntz({{ current_timestamp() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9020014, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_backcompat": {"name": "snowflake__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_backcompat", "macro_sql": "{% macro snowflake__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9020014, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat": {"name": "snowflake__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\utils\\timestamps.sql", "original_file_path": "macros\\utils\\timestamps.sql", "unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro snowflake__current_timestamp_in_utc_backcompat() %}\n convert_timezone('UTC', {{ snowflake__current_timestamp_backcompat() }})::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_backcompat", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.903022, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.904022, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.904022, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9050221, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9050221, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9050221, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9060059, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9060059, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9060059, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9060059, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9060059, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9071336, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9071336, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9081054, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9081054, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9081054, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.909092, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\apply_grants.sql", "original_file_path": "macros\\adapters\\apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9101021, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.912025, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9130225, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9130225, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9130225, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql) %}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9130225, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9140224, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9140224, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9150226, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9150226, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9150226, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.916022, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.916022, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.916022, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9175467, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9185836, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9185836, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9195776, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9195776, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9195776, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\indexes.sql", "original_file_path": "macros\\adapters\\indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.920577, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9211094, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9221299, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9221299, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9221299, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9221299, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.92313, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.92313, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.92313, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9241552, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\metadata.sql", "original_file_path": "macros\\adapters\\metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9241552, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9251912, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9251912, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9251912, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9262476, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9262476, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\persist_docs.sql", "original_file_path": "macros\\adapters\\persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9271917, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9301195, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9301195, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9312122, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9312122, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9312122, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.932213, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.932213, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.932213, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.933198, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.933198, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.933198, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.933198, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.934203, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.934749, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.934749, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.934749, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\relation.sql", "original_file_path": "macros\\adapters\\relation.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9358554, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9358554, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9358554, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9358554, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\schema.sql", "original_file_path": "macros\\adapters\\schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.936947, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.936947, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.936947, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\timestamps.sql", "original_file_path": "macros\\adapters\\timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_snowflake.snowflake__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.937951, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9408622, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9418619, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9428613, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\datetime.sql", "original_file_path": "macros\\etc\\datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9428613, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.944861, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9458606, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\etc\\statement.sql", "original_file_path": "macros\\etc\\statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9458606, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\accepted_values.sql", "original_file_path": "macros\\generic_test_sql\\accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9468617, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\not_null.sql", "original_file_path": "macros\\generic_test_sql\\not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9468617, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\relationships.sql", "original_file_path": "macros\\generic_test_sql\\relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.947861, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros\\generic_test_sql\\unique.sql", "original_file_path": "macros\\generic_test_sql\\unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.947861, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.947861, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9488611, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9488611, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_database.sql", "original_file_path": "macros\\get_custom_name\\get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.949861, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.949861, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.949861, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_schema.sql", "original_file_path": "macros\\get_custom_name\\get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9508607, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9513676, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9513676, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\configs.sql", "original_file_path": "macros\\materializations\\configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9523754, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9533813, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9533813, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9533813, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9543812, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\hooks.sql", "original_file_path": "macros\\materializations\\hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9543812, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9563794, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9563794, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.957379, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9583838, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "original_file_path": "macros\\materializations\\models\\incremental\\column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9593787, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9653783, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "original_file_path": "macros\\materializations\\models\\incremental\\is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.966379, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.971898, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.97397, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.97397, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9759727, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9759727, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\merge.sql", "original_file_path": "macros\\materializations\\models\\incremental\\merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9769754, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9819748, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9829764, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.983973, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "original_file_path": "macros\\materializations\\models\\incremental\\on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9852278, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9872348, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9872348, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9872348, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9882338, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9882338, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9882338, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9882338, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9892335, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9892335, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9892335, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\incremental\\strategies.sql", "original_file_path": "macros\\materializations\\models\\incremental\\strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9892335, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9902337, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9912333, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9912333, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9912333, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9922338, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(model['columns'])) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.993234, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.993234, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "original_file_path": "macros\\materializations\\models\\table\\columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9942336, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9952335, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9952335, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9962332, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9962332, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9972334, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select\n {% for column in model['columns'] %}\n {{ column }}{{ \", \" if not loop.last }}\n {% endfor %}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9972334, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\table.sql", "original_file_path": "macros\\materializations\\models\\table\\table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884187.9992332, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "original_file_path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0017443, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0027487, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0027487, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0027487, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0037482, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\helpers.sql", "original_file_path": "macros\\materializations\\models\\view\\helpers.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0037482, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\helpers.sql", "original_file_path": "macros\\materializations\\models\\view\\helpers.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0047479, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\view.sql", "original_file_path": "macros\\materializations\\models\\view\\view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0077477, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.011747, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.013747, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.013747, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0147474, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0147474, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0147474, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0147474, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0147474, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0157473, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0157473, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0157473, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0157473, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\helpers.sql", "original_file_path": "macros\\materializations\\seeds\\helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.018259, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\seeds\\seed.sql", "original_file_path": "macros\\materializations\\seeds\\seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.02277, "supported_languages": ["sql"]}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0257692, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0267706, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0267706, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0267706, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0267706, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0267706, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.027771, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.02877, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.02877, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.02877, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\helpers.sql", "original_file_path": "macros\\materializations\\snapshots\\helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0297706, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0362964, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0372965, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "original_file_path": "macros\\materializations\\snapshots\\snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0372965, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0412967, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0412967, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0422971, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.043297, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.043297, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.043297, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0452964, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0472975, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0472975, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\helpers.sql", "original_file_path": "macros\\materializations\\tests\\helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0489168, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\test.sql", "original_file_path": "macros\\materializations\\tests\\test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0534446, "supported_languages": ["sql"]}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0534446, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\tests\\where_subquery.sql", "original_file_path": "macros\\materializations\\tests\\where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0544453, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0564454, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0564454, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0574477, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0584466, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.059447, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.059447, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.059447, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.060447, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\any_value.sql", "original_file_path": "macros\\utils\\any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.060447, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.060447, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_append.sql", "original_file_path": "macros\\utils\\array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.060447, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0614488, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_concat.sql", "original_file_path": "macros\\utils\\array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0614488, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0614488, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\array_construct.sql", "original_file_path": "macros\\utils\\array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0624473, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0624473, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\bool_or.sql", "original_file_path": "macros\\utils\\bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0624473, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.063447, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\cast_bool_to_text.sql", "original_file_path": "macros\\utils\\cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.063447, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.063447, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\concat.sql", "original_file_path": "macros\\utils\\concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.063447, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0654438, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0654438, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0654438, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0654438, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0654438, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0664437, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0664437, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0664437, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0664437, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0664437, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0674434, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0674434, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.067947, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\data_types.sql", "original_file_path": "macros\\utils\\data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.067947, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.067947, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\dateadd.sql", "original_file_path": "macros\\utils\\dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0689514, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0689514, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\datediff.sql", "original_file_path": "macros\\utils\\datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0689514, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0699549, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\date_trunc.sql", "original_file_path": "macros\\utils\\date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0699549, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0699549, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\escape_single_quotes.sql", "original_file_path": "macros\\utils\\escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0699549, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.070955, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\except.sql", "original_file_path": "macros\\utils\\except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.070955, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.070955, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\hash.sql", "original_file_path": "macros\\utils\\hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.070955, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0719547, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\intersect.sql", "original_file_path": "macros\\utils\\intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0719547, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0719547, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0719547, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\last_day.sql", "original_file_path": "macros\\utils\\last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0729547, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0729547, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\length.sql", "original_file_path": "macros\\utils\\length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0729547, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0739548, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\listagg.sql", "original_file_path": "macros\\utils\\listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0739548, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0749547, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\literal.sql", "original_file_path": "macros\\utils\\literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0749547, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0749547, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\position.sql", "original_file_path": "macros\\utils\\position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0749547, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0759547, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\replace.sql", "original_file_path": "macros\\utils\\replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0759547, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0759547, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\right.sql", "original_file_path": "macros\\utils\\right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0769546, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0769546, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\safe_cast.sql", "original_file_path": "macros\\utils\\safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0769546, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0779545, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0779545, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros\\utils\\split_part.sql", "original_file_path": "macros\\utils\\split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0779545, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0789545, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0789545, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.079955, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests\\generic\\builtin.sql", "original_file_path": "tests\\generic\\builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.079955, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0809548, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\accepted_range.sql", "original_file_path": "macros\\generic_tests\\accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0819547, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0819547, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\at_least_one.sql", "original_file_path": "macros\\generic_tests\\at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n where {{ column_name }} is not null\n limit 1\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0829544, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0839546, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\cardinality_equality.sql", "original_file_path": "macros\\generic_tests\\cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0844574, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0854611, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equality.sql", "original_file_path": "macros\\generic_tests\\equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0864644, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.087464, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\equal_rowcount.sql", "original_file_path": "macros\\generic_tests\\equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0884645, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.089464, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\expression_is_true.sql", "original_file_path": "macros\\generic_tests\\expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.089464, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0904646, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\fewer_rows_than.sql", "original_file_path": "macros\\generic_tests\\fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0924644, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0954676, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "original_file_path": "macros\\generic_tests\\mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0974672, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0984666, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_accepted_values.sql", "original_file_path": "macros\\generic_tests\\not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0994675, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0994675, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_constant.sql", "original_file_path": "macros\\generic_tests\\not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.0994675, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1009738, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_empty_string.sql", "original_file_path": "macros\\generic_tests\\not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1009738, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1019814, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\not_null_proportion.sql", "original_file_path": "macros\\generic_tests\\not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1029878, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1039875, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\recency.sql", "original_file_path": "macros\\generic_tests\\recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1049879, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.105988, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\relationships_where.sql", "original_file_path": "macros\\generic_tests\\relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.105988, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1069875, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\sequential_values.sql", "original_file_path": "macros\\generic_tests\\sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1089878, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1089878, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\generic_tests\\unique_combination_of_columns.sql", "original_file_path": "macros\\generic_tests\\unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1099882, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1109858, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\log_info.sql", "original_file_path": "macros\\jinja_helpers\\log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1109858, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1109858, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_log_format.sql", "original_file_path": "macros\\jinja_helpers\\pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1109858, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1119854, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\pretty_time.sql", "original_file_path": "macros\\jinja_helpers\\pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1119854, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\slugify.sql", "original_file_path": "macros\\jinja_helpers\\slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1129851, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_ephemeral.sql", "original_file_path": "macros\\jinja_helpers\\_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.113985, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\jinja_helpers\\_is_relation.sql", "original_file_path": "macros\\jinja_helpers\\_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.113985, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1149852, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.115985, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.115985, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\date_spine.sql", "original_file_path": "macros\\sql\\date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.115985, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.snowflake__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1174886, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1174886, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1184928, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1184928, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1184928, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\deduplicate.sql", "original_file_path": "macros\\sql\\deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1184928, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.119493, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.119493, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1209967, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_series.sql", "original_file_path": "macros\\sql\\generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1209967, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1220005, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\generate_surrogate_key.sql", "original_file_path": "macros\\sql\\generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1230004, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.124, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_column_values.sql", "original_file_path": "macros\\sql\\get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.126, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1270044, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_filtered_columns_in_relation.sql", "original_file_path": "macros\\sql\\get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1280034, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1280034, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_query_results_as_dict.sql", "original_file_path": "macros\\sql\\get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1290035, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1300032, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_pattern.sql", "original_file_path": "macros\\sql\\get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1310036, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1320035, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_relations_by_prefix.sql", "original_file_path": "macros\\sql\\get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.133003, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.133003, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_single_value.sql", "original_file_path": "macros\\sql\\get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1340036, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.136214, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.136214, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1372147, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_pattern_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1382146, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1382146, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_tables_by_prefix_sql.sql", "original_file_path": "macros\\sql\\get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1392155, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1392155, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1402154, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1402154, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\get_table_types_sql.sql", "original_file_path": "macros\\sql\\get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1402154, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1402154, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\groupby.sql", "original_file_path": "macros\\sql\\groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1412153, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1422505, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1422505, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1432724, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\haversine_distance.sql", "original_file_path": "macros\\sql\\haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.144261, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1452906, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck.sql", "original_file_path": "macros\\sql\\nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1452906, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1452906, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\nullcheck_table.sql", "original_file_path": "macros\\sql\\nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1463237, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.147291, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\pivot.sql", "original_file_path": "macros\\sql\\pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1483076, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1483076, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_add.sql", "original_file_path": "macros\\sql\\safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1493042, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1493042, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_divide.sql", "original_file_path": "macros\\sql\\safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1493042, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1493042, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\safe_subtract.sql", "original_file_path": "macros\\sql\\safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1508975, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1519926, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\star.sql", "original_file_path": "macros\\sql\\star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1540956, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1540956, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\surrogate_key.sql", "original_file_path": "macros\\sql\\surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1540956, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.157999, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\union.sql", "original_file_path": "macros\\sql\\union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1620905, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1630936, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\unpivot.sql", "original_file_path": "macros\\sql\\unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1650975, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.snowflake__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.166096, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.166096, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\sql\\width_bucket.sql", "original_file_path": "macros\\sql\\width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.166096, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1676943, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_host.sql", "original_file_path": "macros\\web\\get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1676943, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1687796, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_parameter.sql", "original_file_path": "macros\\web\\get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1687796, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1687796, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros\\web\\get_url_path.sql", "original_file_path": "macros\\web\\get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1698682, "supported_languages": null}, "macro.the_tuva_project.apply_regex": {"name": "apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.apply_regex", "macro_sql": "{%- macro apply_regex(column_name, regex) -%}\r\n\r\n {{ return(adapter.dispatch('apply_regex')(column_name, regex)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.the_tuva_project.snowflake__apply_regex"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.170877, "supported_languages": null}, "macro.the_tuva_project.default__apply_regex": {"name": "default__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.default__apply_regex", "macro_sql": "{%- macro default__apply_regex(column_name, regex) -%}\r\n\r\n regexp_like({{ column_name }}, '{{ regex}}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.170877, "supported_languages": null}, "macro.the_tuva_project.snowflake__apply_regex": {"name": "snowflake__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.snowflake__apply_regex", "macro_sql": "{%- macro snowflake__apply_regex(column_name, regex) -%}\r\n\r\n regexp_like({{ column_name }}, '{{ regex }}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.170877, "supported_languages": null}, "macro.the_tuva_project.bigquery__apply_regex": {"name": "bigquery__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.bigquery__apply_regex", "macro_sql": "{%- macro bigquery__apply_regex(column_name, regex) -%}\r\n\r\n regexp_contains({{ column_name }}, r'{{ regex }}')\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.170877, "supported_languages": null}, "macro.the_tuva_project.postgres__apply_regex": {"name": "postgres__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.postgres__apply_regex", "macro_sql": "{%- macro postgres__apply_regex(column_name, regex) -%}\r\n\r\n {{ column_name }} similar to '{{ regex }}'\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.170877, "supported_languages": null}, "macro.the_tuva_project.redshift__apply_regex": {"name": "redshift__apply_regex", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\apply_regex.sql", "original_file_path": "macros\\apply_regex.sql", "unique_id": "macro.the_tuva_project.redshift__apply_regex", "macro_sql": "{%- macro redshift__apply_regex(column_name, regex) -%}\r\n\r\n {{ column_name }} similar to '{{ regex }}'\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1718774, "supported_languages": null}, "macro.the_tuva_project.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\r\n {{ adapter.dispatch('date_part') (datepart, date) }}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1718774, "supported_languages": null}, "macro.the_tuva_project.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\r\n date_part('{{ datepart }}', {{ date }})\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1718774, "supported_languages": null}, "macro.the_tuva_project.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\date_part.sql", "original_file_path": "macros\\date_part.sql", "unique_id": "macro.the_tuva_project.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\r\n extract({{ datepart }} from {{ date }})\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1728754, "supported_languages": null}, "macro.the_tuva_project.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\generate_schema_name.sql", "original_file_path": "macros\\generate_schema_name.sql", "unique_id": "macro.the_tuva_project.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\r\n {%- set default_schema = target.schema -%}\r\n {%- if custom_schema_name is not none -%}\r\n {{ custom_schema_name | trim }}\r\n {%- else -%}\r\n {{ default_schema }}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1728754, "supported_languages": null}, "macro.the_tuva_project.load_seed": {"name": "load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.load_seed", "macro_sql": "{% macro load_seed(uri,pattern,compression=false,headers=false,null_marker=false) %}\r\n{{ return(adapter.dispatch('load_seed', 'the_tuva_project')(uri,pattern,compression,headers,null_marker)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.the_tuva_project.snowflake__load_seed"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.175782, "supported_languages": null}, "macro.the_tuva_project.duckdb__load_seed": {"name": "duckdb__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.duckdb__load_seed", "macro_sql": "{% macro duckdb__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"'\" ~col.name~\"'\" ~ \": \" ~ \"'\"~col.dtype~\"'\") %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',') -%}\r\n{# { log( cols,true) } #}\r\n\r\n{% set sql %}\r\n set s3_access_key_id='AKIA2EPVNTV4FLAEBFGE';\r\n set s3_secret_access_key='TARgblERrFP81Op+52KZW7HrP1Om6ObEDQAUVN2u';\r\n set s3_region='us-east-1';\r\n create or replace table {{this}} as\r\n select\r\n *\r\n from\r\n read_csv('s3://{{ uri }}/{{ pattern }}*',\r\n {% if null_marker == true %} nullstr = '\\N' {% else %} nullstr = '' {% endif %},\r\n header=true,\r\n columns= { {{ cols }} } )\r\n\r\n{% endset %}\r\n\r\n{% call statement('ducksql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('ducksql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\r\n{# debugging { log(results, True) } #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1767828, "supported_languages": null}, "macro.the_tuva_project.redshift__load_seed": {"name": "redshift__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.redshift__load_seed", "macro_sql": "{% macro redshift__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% set sql %}\r\ncopy {{ this }}\r\n from 's3://{{ uri }}/{{ pattern }}'\r\n access_key_id 'AKIA2EPVNTV4FLAEBFGE'\r\n secret_access_key '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'\r\n csv\r\n {% if compression == true %} gzip {% else %} {% endif %}\r\n {% if headers == true %} ignoreheader 1 {% else %} {% endif %}\r\n emptyasnull\r\n region 'us-east-1'\r\n\r\n{% endset %}\r\n\r\n{% call statement('redsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('redsql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\r\n{# debugging { log(results, True) } #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1777828, "supported_languages": null}, "macro.the_tuva_project.snowflake__load_seed": {"name": "snowflake__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.snowflake__load_seed", "macro_sql": "{% macro snowflake__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% set sql %} \r\ncopy into {{ this }}\r\n from s3://{{ uri }}\r\n file_format = (type = CSV\r\n {% if compression == true %} compression = 'GZIP' {% else %} compression = 'none' {% endif %}\r\n {% if headers == true %} skip_header = 1 {% else %} {% endif %}\r\n empty_field_as_null = true\r\n field_optionally_enclosed_by = '\"'\r\n)\r\npattern = '.*\\/{{pattern}}.*';\r\n{% endset %}\r\n{% call statement('snowsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('snowsql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ~ \"/\" ~ pattern ~ \"*\\n rows: \" ~ results['data']|sum(attribute=2),True) }}\r\n{# debugging { log(results, True)} #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1787827, "supported_languages": null}, "macro.the_tuva_project.bigquery__load_seed": {"name": "bigquery__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.bigquery__load_seed", "macro_sql": "{% macro bigquery__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(col.name ~ \" \" ~ col.dtype) %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',') -%}\r\n{# { log( cols,true) } #}\r\n{% set sql %}\r\nload data into {{ this }} ( {{collist|join(',')}} )\r\nfrom files (format = 'csv',\r\n uris = ['gs://{{ uri }}/{{ pattern }}*'],\r\n {% if compression == true %} compression = 'GZIP', {% else %} {% endif %}\r\n {% if headers == true %} skip_leading_rows = 1, {% else %} {% endif %}\r\n {% if null_marker == true %} null_marker = '\\\\N', {% else %} {% endif %}\r\n quote = '\"',\r\n allow_quoted_newlines = True\r\n )\r\n{% endset %}\r\n\r\n{% call statement('bigsql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# { log(sql, True) } #}\r\n{% set results = load_result('bigsql') %}\r\n{{ log(\"Loaded data from external gs resource\\n loaded to: \" ~ this ~ \"\\n from: gs://\" ~ uri ~ \"/\" ~ pattern ~ \"*\",True) }}\r\n{# log(results, True) #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1797826, "supported_languages": null}, "macro.the_tuva_project.databricks__load_seed": {"name": "databricks__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.databricks__load_seed", "macro_sql": "{% macro databricks__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% if execute %}\r\n\r\n{%- set s3_path = 's3://' ~ uri ~ '/' -%}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',\\n ') -%}\r\n\r\n{% set sql %}\r\nCOPY INTO {{ this }}\r\nFROM (\r\n SELECT\r\n {{ cols }}\r\n\r\n FROM '{{ s3_path }}'\r\n {% if env_var('AWS_SESSION_TOKEN', False) %}\r\n WITH (\r\n CREDENTIAL (\r\n AWS_ACCESS_KEY = \"{{ env_var('AWS_ACCESS_KEY') }}\",\r\n AWS_SECRET_KEY = \"{{ env_var('AWS_SECRET_KEY') }}\",\r\n AWS_SESSION_TOKEN = \"{{ env_var('AWS_SESSION_TOKEN') }}\"\r\n )\r\n )\r\n {% endif %}\r\n)\r\nFILEFORMAT = CSV\r\nPATTERN = '{{ pattern }}*'\r\nFORMAT_OPTIONS (\r\n {% if headers == true %} 'skipRows' = '1', {% else %} 'skipRows' = '0', {% endif %}\r\n {% if null_marker == true %} 'nullValue' = '\\\\N', {% else %} {% endif %}\r\n 'enforceSchema' = 'true',\r\n 'inferSchema' = 'false',\r\n 'sep' = ','\r\n)\r\nCOPY_OPTIONS (\r\n 'mergeSchema' = 'false',\r\n 'force' = 'true'\r\n)\r\n{% endset %}\r\n\r\n{# check logs/dbt.log for output #}\r\n{{ log(cols, info=False) }}\r\n{{ log('Current model: ' ~ this ~ '\\n', info=False) }}\r\n{{ log('Full s3 path: ' ~ s3_path ~ '\\n', info=False) }}\r\n{{ log(sql, info=False) }}\r\n\r\n{% call statement('databrickssql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% set results = load_result('databrickssql') %}\r\n{% set rows_affected = results['data'][0][0] %}\r\n\r\n{{ log(results, info=False) }}\r\n{{ log(rows_affected, info=False) }}\r\n\r\n{{ log(\"Loaded data from external s3 resource:\", True) }}\r\n{{ log(\" source: \\t\" ~ s3_path ~ pattern, True) }}\r\n{{ log(\" target: \\t\" ~ this | replace('`',''), True) }}\r\n{{ log(\" rows: \\t\\033[92m\" ~ rows_affected ~ \"\\033[0m\", True) }}\r\n\r\n{% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1827822, "supported_languages": null}, "macro.the_tuva_project.default__load_seed": {"name": "default__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.default__load_seed", "macro_sql": "{% macro default__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% if execute %}\r\n{% do log('No adapter found, seed not loaded',info = True) %}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1827822, "supported_languages": null}, "macro.the_tuva_project.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.185289, "supported_languages": null}, "macro.the_tuva_project.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.bigquery__try_to_cast_date", "macro_sql": "{%- macro bigquery__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n safe_cast( date( {{ column_name }} ) as date )\r\n {%- else -%}\r\n safe_cast( {{ column_name }} as date )\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.185289, "supported_languages": null}, "macro.the_tuva_project.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.default__try_to_cast_date", "macro_sql": "{%- macro default__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.185289, "supported_languages": null}, "macro.the_tuva_project.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.postgres__try_to_cast_date", "macro_sql": "{%- macro postgres__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}[0-9]{2}[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{2}/[0-9]{2}/[0-9]{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1862936, "supported_languages": null}, "macro.the_tuva_project.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.redshift__try_to_cast_date", "macro_sql": "{%- macro redshift__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}\\\\d{2}\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{2}/\\\\d{2}/\\\\d{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2} \\\\d{2}:\\\\d{2}:\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1862936, "supported_languages": null}, "macro.the_tuva_project.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.snowflake__try_to_cast_date", "macro_sql": "{%- macro snowflake__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1862936, "supported_languages": null}, "macro.the_tuva_project.eligibility_denominator_invalid_values": {"name": "eligibility_denominator_invalid_values", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\eligibility_denominator_invalid_values.sql", "original_file_path": "macros\\data_quality\\eligibility_denominator_invalid_values.sql", "unique_id": "macro.the_tuva_project.eligibility_denominator_invalid_values", "macro_sql": "{% macro eligibility_denominator_invalid_values(relation) %}\r\n{%- set sql_statement -%}\r\n select test_field\r\n from {{ ref('data_quality__test_catalog') }}\r\n where source_table = 'normalized_input__eligibility'\r\n and test_category = 'invalid_values'\r\n{%- endset -%}\r\n\r\n{%- set results = run_query(sql_statement) -%}\r\n\r\n{%- if execute -%}\r\n{%- set results_list = results.columns[0].values() -%}\r\n{%- else -%}\r\n{%- set results_list = [] -%}\r\n{%- endif -%}\r\n\r\n {%- for test_field in results_list -%}\r\n select\r\n cat.test_name\r\n , count(distinct rel.patient_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ relation }} as rel\r\n left join {{ ref('data_quality__test_catalog') }} as cat\r\n on cat.test_category = 'invalid_values'\r\n and cat.source_table = 'normalized_input__eligibility'\r\n and cat.test_field = '{{ test_field }}'\r\n where rel.{{ test_field }} is not null\r\n group by cat.test_name\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1882935, "supported_languages": null}, "macro.the_tuva_project.eligibility_missing_column_check": {"name": "eligibility_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\eligibility_missing_column_check.sql", "original_file_path": "macros\\data_quality\\eligibility_missing_column_check.sql", "unique_id": "macro.the_tuva_project.eligibility_missing_column_check", "macro_sql": "{% macro eligibility_missing_column_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n patient_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1882935, "supported_languages": null}, "macro.the_tuva_project.medical_claim_date_check": {"name": "medical_claim_date_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_date_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_date_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_date_check", "macro_sql": "{% macro medical_claim_date_check(relation, column_list, claim_type=false) %}\r\n {%- for column_item in column_list -%}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }} as rel\r\n left join {{ ref('terminology__calendar') }} as cal\r\n on rel.{{ column_item }} = cal.full_date\r\n where cal.full_date is null\r\n and rel.{{ column_item }} is not null\r\n {% if claim_type -%}\r\n and rel.claim_type = '{{ claim_type }}'\r\n {% endif -%}\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1892982, "supported_languages": null}, "macro.the_tuva_project.medical_claim_denominator_invalid_values": {"name": "medical_claim_denominator_invalid_values", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_denominator_invalid_values.sql", "original_file_path": "macros\\data_quality\\medical_claim_denominator_invalid_values.sql", "unique_id": "macro.the_tuva_project.medical_claim_denominator_invalid_values", "macro_sql": "{% macro medical_claim_denominator_invalid_values(relation) %}\r\n{%- set sql_statement -%}\r\n select test_field\r\n from {{ ref('data_quality__test_catalog') }}\r\n where source_table = 'normalized_input__medical_claim'\r\n and test_category = 'invalid_values'\r\n{%- endset -%}\r\n\r\n{%- set results = run_query(sql_statement) -%}\r\n\r\n{%- if execute -%}\r\n{%- set results_list = results.columns[0].values() -%}\r\n{%- else -%}\r\n{%- set results_list = [] -%}\r\n{%- endif -%}\r\n\r\n {%- for test_field in results_list -%}\r\n select\r\n cat.test_name\r\n , count(distinct rel.claim_id||rel.data_source) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ relation }} as rel\r\n left join {{ ref('data_quality__test_catalog') }} as cat\r\n on cat.test_category = 'invalid_values'\r\n and cat.source_table = 'normalized_input__medical_claim'\r\n and cat.test_field = '{{ test_field }}'\r\n where rel.{{ test_field }} is not null\r\n group by cat.test_name\r\n {% if not loop.last -%}\r\n union all\r\n {% endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.191327, "supported_languages": null}, "macro.the_tuva_project.medical_claim_header_duplicate_check": {"name": "medical_claim_header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_header_duplicate_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_header_duplicate_check", "macro_sql": "{% macro medical_claim_header_duplicate_check(relation, column_list, claim_type) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n , count(distinct {{ column_item }}) as duplicate_count\r\n from {{ relation }}\r\n where claim_type = '{{ claim_type }}'\r\n group by\r\n claim_id\r\n , data_source\r\n having count(distinct {{ column_item }}) > 1\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.191327, "supported_languages": null}, "macro.the_tuva_project.medical_claim_missing_column_check": {"name": "medical_claim_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\medical_claim_missing_column_check.sql", "original_file_path": "macros\\data_quality\\medical_claim_missing_column_check.sql", "unique_id": "macro.the_tuva_project.medical_claim_missing_column_check", "macro_sql": "{% macro medical_claim_missing_column_check(relation, column_list, claim_type) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n and claim_type = '{{ claim_type }}'\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1923695, "supported_languages": null}, "macro.the_tuva_project.pharmacy_claim_header_duplicate_check": {"name": "pharmacy_claim_header_duplicate_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\pharmacy_claim_header_duplicate_check.sql", "original_file_path": "macros\\data_quality\\pharmacy_claim_header_duplicate_check.sql", "unique_id": "macro.the_tuva_project.pharmacy_claim_header_duplicate_check", "macro_sql": "{% macro pharmacy_claim_header_duplicate_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n , count(distinct {{ column_item }}) as duplicate_count\r\n from {{ relation }}\r\n group by claim_id, data_source\r\n having count(distinct {{ column_item }}) > 1\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1923695, "supported_languages": null}, "macro.the_tuva_project.pharmacy_claim_missing_column_check": {"name": "pharmacy_claim_missing_column_check", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\data_quality\\pharmacy_claim_missing_column_check.sql", "original_file_path": "macros\\data_quality\\pharmacy_claim_missing_column_check.sql", "unique_id": "macro.the_tuva_project.pharmacy_claim_missing_column_check", "macro_sql": "{% macro pharmacy_claim_missing_column_check(relation, column_list) %}\r\n {%- for column_item in column_list %}\r\n select\r\n claim_id\r\n , data_source\r\n , '{{ column_item }}' as column_checked\r\n from {{ relation }}\r\n where {{ column_item }} is null\r\n {% if not loop.last -%}\r\n union all\r\n {%- endif -%}\r\n {%- endfor -%}\r\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1933823, "supported_languages": null}, "macro.the_tuva_project.test_claims_preprocessing_pipeline_checks": {"name": "test_claims_preprocessing_pipeline_checks", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\tests\\claims_preprocessing_pipeline_checks.sql", "original_file_path": "macros\\tests\\claims_preprocessing_pipeline_checks.sql", "unique_id": "macro.the_tuva_project.test_claims_preprocessing_pipeline_checks", "macro_sql": "{% test claims_preprocessing_pipeline_checks(model) %}\r\n\r\n select *\r\n from {{ ref('data_quality__claims_preprocessing_test_detail' )}}\r\n where pipeline_test = 1\r\n\r\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1715884188.1933823, "supported_languages": null}}, "docs": {"doc.input_layer.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "input_layer", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.input_layer.__overview__", "block_contents": "# \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is difficult to analyze - we're working to change that. The Tuva Project is an open source knowledge base, code base, and community for healthcare data people.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/)\r\nWe're writing the open book on how to transform and analyze healthcare data.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://github.com/tuva-health)\r\nWe're translating knowledge into precise code that anyone can run on their healthcare data.\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nWe're building a community we're healthcare data people can ask questions and share knowledge about healthcare data."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"model.the_tuva_project.normalize__all_codes": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__all_codes", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__all_codes.sql", "original_file_path": "models\\normalize\\normalize__all_codes.sql", "unique_id": "model.the_tuva_project.normalize__all_codes", "fqn": ["the_tuva_project", "normalize", "normalize__all_codes"], "alias": "all_codes", "checksum": {"name": "sha256", "checksum": "bfe45493f53fdf295365ccc84ca30d4c547bd9f70ae18f80633b19b0be2edee8"}, "config": {"enabled": false, "alias": "all_codes", "schema": "normalize", "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped condition codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "all_codes", "tags": "normalized", "materialized": "view", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7824724, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.all_codes", "raw_code": "{{ config(\r\n enabled = ( var('enable_normalize_engine', False) == True and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\nwith agg_cte as (\r\n {% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n select * From {{ref('normalize__stg_unmapped_lab_result')}} union all\r\n select * From {{ref('normalize__stg_unmapped_medication')}} union all\r\n select * From {{ref('normalize__stg_unmapped_observation')}} union all\r\n {%- endif %}\r\n select * From {{ref('normalize__stg_unmapped_condition')}} union all\r\n select * From {{ref('normalize__stg_unmapped_procedure')}}\r\n)\r\n\r\nselect SOURCE_CODE_TYPE,\r\n SOURCE_CODE,\r\n SOURCE_DESCRIPTION,\r\n item_count,\r\n domains,\r\n data_sources,\r\n normalized_code_type,\r\n normalized_code,\r\n normalized_description,\r\n not_mapped,\r\n added_by,\r\n added_date,\r\n reviewed_by,\r\n reviewed_date,\r\n notes\r\nfrom {{ ref('custom_mapped') }}\r\n\r\nunion distinct\r\n\r\n\r\nselect un.SOURCE_CODE_TYPE,\r\n un.SOURCE_CODE,\r\n un.SOURCE_DESCRIPTION,\r\n un.item_count,\r\n un.domains,\r\n un.data_sources,\r\n un.normalized_code_type,\r\n un.normalized_code,\r\n un.normalized_description,\r\n un.not_mapped,\r\n un.added_by,\r\n un.added_date,\r\n un.reviewed_by,\r\n un.reviewed_date,\r\n un.notes\r\n from {{ref('normalize__all_unmapped')}} un \r\n left join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(un.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( un.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (un.source_code = custom_mapped.source_code\r\n or ( un.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (un.source_description = custom_mapped.source_description\r\n or ( un.source_description is null and custom_mapped.source_description is null)\r\n )\r\n where custom_mapped.source_code_type is null\r\n and custom_mapped.source_code is null\r\n and custom_mapped.source_description is null", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_lab_result", "package": null, "version": null}, {"name": "normalize__stg_unmapped_medication", "package": null, "version": null}, {"name": "normalize__stg_unmapped_observation", "package": null, "version": null}, {"name": "normalize__stg_unmapped_condition", "package": null, "version": null}, {"name": "normalize__stg_unmapped_procedure", "package": null, "version": null}, {"name": "custom_mapped", "package": null, "version": null}, {"name": "normalize__all_unmapped", "package": null, "version": null}, {"name": "custom_mapped", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__all_unmapped": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__all_unmapped", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__all_unmapped.sql", "original_file_path": "models\\normalize\\normalize__all_unmapped.sql", "unique_id": "model.the_tuva_project.normalize__all_unmapped", "fqn": ["the_tuva_project", "normalize", "normalize__all_unmapped"], "alias": "all_unmapped", "checksum": {"name": "sha256", "checksum": "54d9f538415c7eb96ab4ed54984498f1754fd73bdbfca384df5001567cf3815c"}, "config": {"enabled": false, "alias": "all_unmapped", "schema": "normalize", "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped condition codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "all_unmapped", "tags": "normalized", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7794724, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.all_unmapped", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\nwith agg_cte as (\r\n {% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n select * From {{ref('normalize__stg_unmapped_lab_result')}} union all\r\n select * From {{ref('normalize__stg_unmapped_medication')}} union all\r\n select * From {{ref('normalize__stg_unmapped_observation')}} union all\r\n {%- endif %}\r\n select * From {{ref('normalize__stg_unmapped_condition')}} union all\r\n select * From {{ref('normalize__stg_unmapped_procedure')}}\r\n)\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n {{ dbt.listagg(measure=\"distinct i.domain\", delimiter_text=\"', '\", order_by_clause=\"order by i.domain\" )}} as domains,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom agg_cte i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_lab_result", "package": null, "version": null}, {"name": "normalize__stg_unmapped_medication", "package": null, "version": null}, {"name": "normalize__stg_unmapped_observation", "package": null, "version": null}, {"name": "normalize__stg_unmapped_condition", "package": null, "version": null}, {"name": "normalize__stg_unmapped_procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__unmapped_condition": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__unmapped_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__unmapped_condition.sql", "original_file_path": "models\\normalize\\normalize__unmapped_condition.sql", "unique_id": "model.the_tuva_project.normalize__unmapped_condition", "fqn": ["the_tuva_project", "normalize", "normalize__unmapped_condition"], "alias": "unmapped_condition", "checksum": {"name": "sha256", "checksum": "6271dbccfffb27274c77f737232ce2c0f3867efda3e74021333bbeab2ee7f95e"}, "config": {"enabled": false, "alias": "unmapped_condition", "schema": "normalize", "database": null, "tags": ["normalize"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalize"], "description": "unmapped condition codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "unmapped_condition", "tags": "normalize", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.785028, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.unmapped_condition", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n i.domain as domain,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom {{ref('normalize__stg_unmapped_condition')}} i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.DOMAIN", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__unmapped_lab_result": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__unmapped_lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__unmapped_lab_result.sql", "original_file_path": "models\\normalize\\normalize__unmapped_lab_result.sql", "unique_id": "model.the_tuva_project.normalize__unmapped_lab_result", "fqn": ["the_tuva_project", "normalize", "normalize__unmapped_lab_result"], "alias": "unmapped_lab_result", "checksum": {"name": "sha256", "checksum": "9295d012eed959d8c42df6560c754e218190e0b771e56cc417be7c3042ff703b"}, "config": {"enabled": false, "alias": "unmapped_lab_result", "schema": "normalize", "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "unmapped_lab_result", "tags": "normalized", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7910483, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.unmapped_lab_result", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n i.domain as domain,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom {{ref('normalize__stg_unmapped_lab_result')}} i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.DOMAIN", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__unmapped_medication": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__unmapped_medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__unmapped_medication.sql", "original_file_path": "models\\normalize\\normalize__unmapped_medication.sql", "unique_id": "model.the_tuva_project.normalize__unmapped_medication", "fqn": ["the_tuva_project", "normalize", "normalize__unmapped_medication"], "alias": "unmapped_medication", "checksum": {"name": "sha256", "checksum": "c817604225008005f57b144045c7c62a20dcdb34b4d3fad0e29a3cc5e4360b4d"}, "config": {"enabled": false, "alias": "unmapped_medication", "schema": "normalize", "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "unmapped_medication", "tags": "normalized", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7940319, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.unmapped_medication", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n i.domain as domain,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom {{ref('normalize__stg_unmapped_medication')}} i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.DOMAIN", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__unmapped_observation": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__unmapped_observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__unmapped_observation.sql", "original_file_path": "models\\normalize\\normalize__unmapped_observation.sql", "unique_id": "model.the_tuva_project.normalize__unmapped_observation", "fqn": ["the_tuva_project", "normalize", "normalize__unmapped_observation"], "alias": "unmapped_observation", "checksum": {"name": "sha256", "checksum": "6cec7542b0cb8f4cb23a6135032e37843fe2d7048f150669d2c2806abf64ed30"}, "config": {"enabled": false, "alias": "unmapped_observation", "schema": "normalize", "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "unmapped_observation", "tags": "normalized", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.797048, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.unmapped_observation", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n i.domain as domain,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom {{ref('normalize__stg_unmapped_observation')}} i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.DOMAIN", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__unmapped_procedure": [{"database": "dev_thuxuan", "schema": "normalize", "name": "normalize__unmapped_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\normalize__unmapped_procedure.sql", "original_file_path": "models\\normalize\\normalize__unmapped_procedure.sql", "unique_id": "model.the_tuva_project.normalize__unmapped_procedure", "fqn": ["the_tuva_project", "normalize", "normalize__unmapped_procedure"], "alias": "unmapped_procedure", "checksum": {"name": "sha256", "checksum": "0ae481eaa1f6c3aaa031bbdbd2cc27634bf6ae7b9e03dbccf187f71243c7a5da"}, "config": {"enabled": false, "alias": "unmapped_procedure", "schema": "normalize", "database": null, "tags": ["normalize"], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalize"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "normalize", "alias": "unmapped_procedure", "tags": "normalize", "materialized": "table", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7880492, "config_call_dict": {"enabled": false}, "relation_name": "dev_thuxuan.normalize.unmapped_procedure", "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n sum(i.item_count) as item_count,\r\n i.domain as domain,\r\n {{ dbt.listagg(measure=\"distinct i.DATA_SOURCE\", delimiter_text=\"', '\", order_by_clause=\"order by i.DATA_SOURCE\" )}} as data_sources,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code_type,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_code,\r\n cast( null as {{ dbt.type_string() }} ) as normalized_description,\r\n cast( null as {{ dbt.type_string() }} ) as not_mapped,\r\n cast( null as {{ dbt.type_string() }} ) as added_by,\r\n cast( null as {{ dbt.type_string() }} ) as added_date,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_by,\r\n cast( null as {{ dbt.type_string() }} ) as reviewed_date,\r\n cast( null as {{ dbt.type_string() }} ) as notes\r\nfrom {{ref('normalize__stg_unmapped_procedure')}} i\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.DOMAIN", "language": "sql", "refs": [{"name": "normalize__stg_unmapped_procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.listagg", "macro.dbt.type_string"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__stg_unmapped_condition": [{"database": "dev_thuxuan", "schema": "test", "name": "normalize__stg_unmapped_condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\staging\\normalize__stg_unmapped_condition.sql", "original_file_path": "models\\normalize\\staging\\normalize__stg_unmapped_condition.sql", "unique_id": "model.the_tuva_project.normalize__stg_unmapped_condition", "fqn": ["the_tuva_project", "normalize", "staging", "normalize__stg_unmapped_condition"], "alias": "normalize__stg_unmapped_condition", "checksum": {"name": "sha256", "checksum": "51cfaf7cae2fdf916f11ad0b1c6121261719fa0b3bc106ee6afceca3c83eaff6"}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped condition codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "normalized", "materialized": "ephemeral", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.7990484, "config_call_dict": {"enabled": false}, "relation_name": null, "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) == True %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'condition' as domain,\r\n i.data_source\r\nfrom {{ref('core__condition')}} i\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(i.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( i.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (i.source_code = custom_mapped.source_code\r\n or ( i.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (i.source_description = custom_mapped.source_description\r\n or ( i.source_description is null and custom_mapped.source_description is null)\r\n )\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\n and custom_mapped.not_mapped is null\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% else %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'condition' as domain,\r\n i.data_source\r\nfrom {{ref('core__condition')}} i\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__condition", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__stg_unmapped_lab_result": [{"database": "dev_thuxuan", "schema": "test", "name": "normalize__stg_unmapped_lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\staging\\normalize__stg_unmapped_lab_result.sql", "original_file_path": "models\\normalize\\staging\\normalize__stg_unmapped_lab_result.sql", "unique_id": "model.the_tuva_project.normalize__stg_unmapped_lab_result", "fqn": ["the_tuva_project", "normalize", "staging", "normalize__stg_unmapped_lab_result"], "alias": "normalize__stg_unmapped_lab_result", "checksum": {"name": "sha256", "checksum": "cef6a030750e4370c6e9215aae08b0fd10c2765f610fdea72d96be1806a6d5c1"}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "normalized", "materialized": "ephemeral", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8026333, "config_call_dict": {"enabled": false}, "relation_name": null, "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) == True %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'lab_result' as domain,\r\n i.data_source\r\nfrom {{ref('core__lab_result')}} i\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(i.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( i.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (i.source_code = custom_mapped.source_code\r\n or ( i.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (i.source_description = custom_mapped.source_description\r\n or ( i.source_description is null and custom_mapped.source_description is null)\r\n )\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\n and custom_mapped.not_mapped is null\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% else %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'lab_result' as domain,\r\n i.data_source\r\nfrom {{ref('core__lab_result')}} i\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__lab_result", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__stg_unmapped_medication": [{"database": "dev_thuxuan", "schema": "test", "name": "normalize__stg_unmapped_medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\staging\\normalize__stg_unmapped_medication.sql", "original_file_path": "models\\normalize\\staging\\normalize__stg_unmapped_medication.sql", "unique_id": "model.the_tuva_project.normalize__stg_unmapped_medication", "fqn": ["the_tuva_project", "normalize", "staging", "normalize__stg_unmapped_medication"], "alias": "normalize__stg_unmapped_medication", "checksum": {"name": "sha256", "checksum": "277ca00aa8f6dca6bee281a84f7eda59a5f01ff3bfdfc0ce5c527c9dc50d6947"}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "normalized", "materialized": "ephemeral", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8056338, "config_call_dict": {"enabled": false}, "relation_name": null, "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) == True %}\r\n\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'medication' as domain,\r\n i.data_source\r\nfrom {{ref('core__medication')}} i\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(i.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( i.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (i.source_code = custom_mapped.source_code\r\n or ( i.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (i.source_description = custom_mapped.source_description\r\n or ( i.source_description is null and custom_mapped.source_description is null)\r\n )\r\nwhere i.ndc_code is null and i.ndc_description is null and i.rxnorm_code is null and i.rxnorm_description is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\n and custom_mapped.not_mapped is null\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% else %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'medication' as domain,\r\n i.data_source\r\nfrom {{ref('core__medication')}} i\r\nwhere i.ndc_code is null and i.ndc_description is null and i.rxnorm_code is null and i.rxnorm_description is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__medication", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__stg_unmapped_observation": [{"database": "dev_thuxuan", "schema": "test", "name": "normalize__stg_unmapped_observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\staging\\normalize__stg_unmapped_observation.sql", "original_file_path": "models\\normalize\\staging\\normalize__stg_unmapped_observation.sql", "unique_id": "model.the_tuva_project.normalize__stg_unmapped_observation", "fqn": ["the_tuva_project", "normalize", "staging", "normalize__stg_unmapped_observation"], "alias": "normalize__stg_unmapped_observation", "checksum": {"name": "sha256", "checksum": "a9512ad1277bf1515e5eae6976123052c5e5b121ead7919e8f884bc56a29ab3a"}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "normalized", "materialized": "ephemeral", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8076398, "config_call_dict": {"enabled": false}, "relation_name": null, "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('clinical_enabled', var('tuva_marts_enabled', False))\r\n ) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) == True %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'observation' as domain,\r\n i.data_source\r\nfrom {{ref('core__observation')}} i\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(i.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( i.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (i.source_code = custom_mapped.source_code\r\n or ( i.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (i.source_description = custom_mapped.source_description\r\n or ( i.source_description is null and custom_mapped.source_description is null)\r\n )\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\n and custom_mapped.not_mapped is null\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% else %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'observation' as domain,\r\n i.data_source\r\nfrom {{ref('core__observation')}} i\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__observation", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "model.the_tuva_project.normalize__stg_unmapped_procedure": [{"database": "dev_thuxuan", "schema": "test", "name": "normalize__stg_unmapped_procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "normalize\\staging\\normalize__stg_unmapped_procedure.sql", "original_file_path": "models\\normalize\\staging\\normalize__stg_unmapped_procedure.sql", "unique_id": "model.the_tuva_project.normalize__stg_unmapped_procedure", "fqn": ["the_tuva_project", "normalize", "staging", "normalize__stg_unmapped_procedure"], "alias": "normalize__stg_unmapped_procedure", "checksum": {"name": "sha256", "checksum": "9214c66a73fc9a2e7f7fc5e2f78f62c6bd2fb88e8b3e0b01727a8673e6faee99"}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": ["normalized"], "meta": {}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#1a7aa9"}, "contract": {"enforced": false}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["normalized"], "description": "unmapped procedure codes\n", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#1a7aa9"}, "patch_path": "the_tuva_project://models\\normalize\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "normalized", "materialized": "ephemeral", "enabled": false, "bind": false, "docs": {"node_color": "#1a7aa9"}}, "created_at": 1715884194.8005726, "config_call_dict": {"enabled": false}, "relation_name": null, "raw_code": "{{ config(\r\n enabled = ( ( var('enable_normalize_engine', False) == True or var('enable_normalize_engine', False) == \"unmapped\") and\r\n var('claims_enabled', var('clinical_enabled', var('tuva_marts_enabled', False)))\r\n ) | as_bool\r\n )\r\n}}\r\n\r\n{% if var('enable_normalize_engine',false) == True %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'procedure' as domain,\r\n i.data_source\r\nfrom {{ref('core__procedure')}} i\r\nleft join {{ ref('custom_mapped') }} custom_mapped\r\n on ( lower(i.source_code_type) = lower(custom_mapped.source_code_type)\r\n or ( i.source_code_type is null and custom_mapped.source_code_type is null)\r\n )\r\n and (i.source_code = custom_mapped.source_code\r\n or ( i.source_code is null and custom_mapped.source_code is null)\r\n )\r\n and (i.source_description = custom_mapped.source_description\r\n or ( i.source_description is null and custom_mapped.source_description is null)\r\n )\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\n and custom_mapped.not_mapped is null\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% else %}\r\n\r\nselect i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION,\r\n count(*) as item_count,\r\n 'procedure' as domain,\r\n i.data_source\r\nfrom {{ref('core__procedure')}} i\r\nwhere i.NORMALIZED_CODE is null and i.NORMALIZED_DESCRIPTION is null\r\n and not ( i.SOURCE_CODE is null and i.SOURCE_DESCRIPTION is null)\r\ngroup by i.SOURCE_CODE_TYPE, i.SOURCE_CODE, i.SOURCE_DESCRIPTION, i.data_source\r\n\r\n{% endif %}", "language": "sql", "refs": [{"name": "core__procedure", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null}], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [{"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_factors_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "original_file_path": "snapshots\\cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_factors_snapshot", "cms_hcc__patient_risk_factors_snapshot"], "alias": "patient_risk_factors_snapshot", "checksum": {"name": "sha256", "checksum": "93de4ccb7b0962ce79e9d1b54e8b3ce626ab0fc1757a0a8a7583c350fd5f1c3e"}, "config": {"enabled": false, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715884191.899225, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_factors_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"patient_risk_factors_snapshot\"\r\n , \"tags\": \"cms_hcc\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||model_version||payment_year||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_factors", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [{"database": "dev_thuxuan", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_scores_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "cms_hcc\\cms_hcc__patient_risk_scores_snapshot.sql", "original_file_path": "snapshots\\cms_hcc\\cms_hcc__patient_risk_scores_snapshot.sql", "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_scores_snapshot", "cms_hcc__patient_risk_scores_snapshot"], "alias": "patient_risk_scores_snapshot", "checksum": {"name": "sha256", "checksum": "0341ef994d38335ca5a8a59a7c8acdb47696f43200dd33027fcdc2093ed44ed8"}, "config": {"enabled": false, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||payment_year||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715884191.9077494, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||payment_year||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.cms_hcc.patient_risk_scores_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"patient_risk_scores_snapshot\"\r\n , \"tags\": \"cms_hcc\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||payment_year||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\r\n\r\n", "language": "sql", "refs": [{"name": "cms_hcc__patient_risk_scores", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": [{"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_counts_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_counts_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_counts_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_counts_snapshot", "quality_measures__summary_counts_snapshot"], "alias": "summary_counts_snapshot", "checksum": {"name": "sha256", "checksum": "7d70c425e79217b6b2af25984cc5901a5a70e2cd1d16eee9e6f5af049c719978"}, "config": {"enabled": false, "alias": "summary_counts_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715884191.9147496, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.quality_measures.summary_counts_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_counts_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_counts') }}\r\n\r\n", "language": "sql", "refs": [{"name": "quality_measures__summary_counts", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": [{"database": "dev_thuxuan", "schema": "quality_measures", "name": "quality_measures__summary_long_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_long_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_long_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_long_snapshot", "quality_measures__summary_long_snapshot"], "alias": "summary_long_snapshot", "checksum": {"name": "sha256", "checksum": "4bfc791820a1666cb034b4056c07c14bbed4a0f1303be9230db39500626d9305"}, "config": {"enabled": false, "alias": "summary_long_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#64b0e1"}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": "#64b0e1"}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false, "docs": {"node_color": "#64b0e1"}}, "created_at": 1715884191.9212625, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}, "relation_name": "dev_thuxuan.quality_measures.summary_long_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_long_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_long') }}\r\n\r\n", "language": "sql", "refs": [{"name": "quality_measures__summary_long", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}}]}, "parent_map": {"model.input_layer.condition": [], "model.input_layer.eligibility": ["seed.input_layer.eligibility_seed"], "model.input_layer.encounter": [], "model.input_layer.lab_result": [], "model.input_layer.location": [], "model.input_layer.medical_claim": ["seed.input_layer.medical_claim_seed"], "model.input_layer.medication": [], "model.input_layer.observation": [], "model.input_layer.patient": [], "model.input_layer.pharmacy_claim": ["seed.input_layer.pharmacy_claim_seed"], "model.input_layer.practitioner": [], "model.input_layer.procedure": [], "seed.input_layer.eligibility_seed": [], "seed.input_layer.lab_result_seed": [], "seed.input_layer.medical_claim_seed": [], "seed.input_layer.observation_seed": [], "seed.input_layer.pharmacy_claim_seed": [], "model.the_tuva_project.ahrq_measures__pqi_denom_long": ["model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_denom"], "model.the_tuva_project.ahrq_measures__pqi_exclusion_long": ["model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"], "model.the_tuva_project.ahrq_measures__pqi_num_long": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__int_pqi_16_num"], "model.the_tuva_project.ahrq_measures__pqi_rate": ["model.the_tuva_project.ahrq_measures__pqi_denom_long", "model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__pqi_summary": ["model.the_tuva_project.ahrq_measures__pqi_num_long", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__measures"], "model.the_tuva_project.ahrq_measures__int_pqi_01_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_01_num": ["model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_03_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_03_num": ["model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_05_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_05_num": ["model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_07_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_07_num": ["model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_08_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_08_num": ["model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_11_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_11_num": ["model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_12_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_12_num": ["model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_14_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_14_num": ["model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_15_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_15_num": ["model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_16_denom": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_16_num": ["model.the_tuva_project.ahrq_measures__int_pqi_16_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "seed.the_tuva_project.pqi__value_sets", "seed.the_tuva_project.pqi__value_sets"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age": ["model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender": ["model.the_tuva_project.ahrq_measures__stg_pqi_patient"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter"], "model.the_tuva_project.ahrq_measures__stg_pqi_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ahrq_measures__stg_pqi_member_months": ["model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.ahrq_measures__stg_pqi_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.ahrq_measures__stg_pqi_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"], "model.the_tuva_project.ccsr__long_procedure_category": ["model.the_tuva_project.ccsr__procedure_category_map", "model.the_tuva_project.ccsr__stg_core__procedure"], "model.the_tuva_project.ccsr__singular_condition_category": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__procedure_category_map": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "model.the_tuva_project.value_set_member_relevant_fields"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": ["model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": ["model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"], "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.medical_claim_expanded": ["model.input_layer.medical_claim"], "model.the_tuva_project.acute_inpatient__summary": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__data_quality_summary": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__institutional_claims": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.emergency_department__summary": ["model.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_last_claim_values", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_claims"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__stg_medical_claim"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.emergency_department__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.emergency_department__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.emergency_department__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.normalized_input__eligibility": ["model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__stg_eligibility"], "model.the_tuva_project.normalized_input__medical_claim": ["model.the_tuva_project.normalized_input__int_admit_source_final", "model.the_tuva_project.normalized_input__int_admit_type_final", "model.the_tuva_project.normalized_input__int_apr_drg_final", "model.the_tuva_project.normalized_input__int_bill_type_final", "model.the_tuva_project.normalized_input__int_diagnosis_code_final", "model.the_tuva_project.normalized_input__int_discharge_disposition_final", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_ms_drg_final", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_final", "model.the_tuva_project.normalized_input__int_procedure_code_final", "model.the_tuva_project.normalized_input__int_procedure_date_final", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "model.the_tuva_project.normalized_input__stg_medical_claim"], "model.the_tuva_project.normalized_input__pharmacy_claim": ["model.the_tuva_project.normalized_input__stg_pharmacy_claim"], "model.the_tuva_project.normalized_input__int_admit_source_final": ["model.the_tuva_project.normalized_input__int_admit_source_voting"], "model.the_tuva_project.normalized_input__int_admit_source_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source"], "model.the_tuva_project.normalized_input__int_admit_type_final": ["model.the_tuva_project.normalized_input__int_admit_type_voting"], "model.the_tuva_project.normalized_input__int_admit_type_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__admit_type"], "model.the_tuva_project.normalized_input__int_apr_drg_final": ["model.the_tuva_project.normalized_input__int_apr_drg_voting"], "model.the_tuva_project.normalized_input__int_apr_drg_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"], "model.the_tuva_project.normalized_input__int_bill_type_final": ["model.the_tuva_project.normalized_input__int_bill_type_voting"], "model.the_tuva_project.normalized_input__int_bill_type_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type"], "model.the_tuva_project.normalized_input__int_diagnosis_code_final": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting"], "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"], "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": ["model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"], "model.the_tuva_project.normalized_input__int_discharge_disposition_final": ["model.the_tuva_project.normalized_input__int_discharge_disposition_voting"], "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__discharge_disposition"], "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": ["model.the_tuva_project.normalized_input__stg_eligibility", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_medical_date_aggregation": ["model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"], "model.the_tuva_project.normalized_input__int_medical_npi_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.normalized_input__int_ms_drg_final": ["model.the_tuva_project.normalized_input__int_ms_drg_voting"], "model.the_tuva_project.normalized_input__int_ms_drg_voting": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.normalized_input__int_place_of_service_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service"], "model.the_tuva_project.normalized_input__int_present_on_admit_final": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting"], "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.normalized_input__int_present_on_admit_voting": ["model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"], "model.the_tuva_project.normalized_input__int_procedure_code_final": ["model.the_tuva_project.normalized_input__int_procedure_code_voting"], "model.the_tuva_project.normalized_input__int_procedure_code_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs"], "model.the_tuva_project.normalized_input__int_procedure_code_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize"], "model.the_tuva_project.normalized_input__int_procedure_date_final": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_date_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.normalized_input__int_procedure_date_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"], "model.the_tuva_project.normalized_input__int_revenue_center_normalize": ["model.the_tuva_project.normalized_input__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.normalized_input__int_undetermined_claim_type": ["model.the_tuva_project.normalized_input__stg_medical_claim"], "model.the_tuva_project.normalized_input__stg_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.normalized_input__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.normalized_input__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.service_category__dq_input_layer_results": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__claim_type", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.value_set_member_relevant_fields": ["seed.the_tuva_project.clinical_concepts", "seed.the_tuva_project.coding_systems", "seed.the_tuva_project.value_set_members"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["model.the_tuva_project.cms_hcc__patient_risk_factors", "seed.the_tuva_project.cms_hcc__adjustment_rates"], "model.the_tuva_project.cms_hcc__int_demographic_factors": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"], "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"], "model.the_tuva_project.cms_hcc__int_disease_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"], "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"], "model.the_tuva_project.cms_hcc__int_eligible_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"], "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"], "model.the_tuva_project.cms_hcc__int_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"], "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"], "model.the_tuva_project.cms_hcc__int_hcc_mapping": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"], "model.the_tuva_project.cms_hcc__int_members": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__condition": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__snomed_ct"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.core__stg_claims_eligibility"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result", "seed.the_tuva_project.terminology__loinc", "seed.the_tuva_project.terminology__snomed_ct"], "model.the_tuva_project.core__location": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.core__stg_claims_medical_claim"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.core__stg_clinical_medication", "seed.the_tuva_project.terminology__ndc", "seed.the_tuva_project.terminology__ndc", "seed.the_tuva_project.terminology__rxnorm_to_atc", "seed.the_tuva_project.terminology__rxnorm_to_atc"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.core__stg_clinical_observation", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__icd_9_pcs", "seed.the_tuva_project.terminology__loinc", "seed.the_tuva_project.terminology__snomed_ct"], "model.the_tuva_project.core__patient": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"], "model.the_tuva_project.core__practitioner": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"], "model.the_tuva_project.core__procedure": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.terminology__icd_9_pcs", "seed.the_tuva_project.terminology__snomed_ct"], "model.the_tuva_project.core__stg_claims_condition": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_patient": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.core__stg_claims_practitioner": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_procedure": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_condition": ["model.input_layer.condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.input_layer.encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.input_layer.lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.input_layer.location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.input_layer.medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.input_layer.observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.input_layer.patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.input_layer.practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.input_layer.procedure"], "model.the_tuva_project.data_quality__claims_preprocessing_summary": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_use_case": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__pharmacy_claim", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_status", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__race"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": ["model.the_tuva_project.normalized_input__eligibility", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__calendar", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": ["model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__claim_type", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__code_type", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__present_on_admission", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": ["model.the_tuva_project.normalized_input__pharmacy_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": ["model.the_tuva_project.normalized_input__medical_claim", "seed.the_tuva_project.data_quality__test_catalog"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail", "model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.financial_pmpm__pmpm_payer": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.hcc_suspecting__list": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"], "model.the_tuva_project.hcc_suspecting__list_rollup": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__summary": ["model.the_tuva_project.hcc_suspecting__list", "model.the_tuva_project.hcc_suspecting__stg_core__patient"], "model.the_tuva_project.hcc_suspecting__int_all_conditions": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions", "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"], "model.the_tuva_project.hcc_suspecting__int_all_medications": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim"], "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_lab_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_medication_suspects": ["model.the_tuva_project.hcc_suspecting__int_all_medications", "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_observation_suspects": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history", "model.the_tuva_project.hcc_suspecting__int_prep_conditions", "model.the_tuva_project.hcc_suspecting__stg_core__observation", "seed.the_tuva_project.hcc_suspecting__clinical_concepts", "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"], "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"], "model.the_tuva_project.hcc_suspecting__int_prep_conditions": ["model.the_tuva_project.hcc_suspecting__stg_core__condition", "seed.the_tuva_project.terminology__snomed_icd_10_map"], "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "seed.the_tuva_project.hcc_suspecting__clinical_concepts"], "model.the_tuva_project.hcc_suspecting__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.hcc_suspecting__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.hcc_suspecting__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.hcc_suspecting__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_date_column": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.insights__count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__orphan_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.insights__sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__summary_counts": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__int_cbe0055_long", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__summary_wide": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_cbe0055_exclusions": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_cbe0055_long": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cbe0055_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_cbe0055_numerator": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cbe0055__denominator": ["model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cbe0055__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_cqm236_denominator": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_cqm236_exclusions": ["model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_cqm236_long": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_cqm236_numerator": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.quality_measures__int_cqm236__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": [], "model.the_tuva_project.quality_measures__int_nqf0053_denominator": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0053_long": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf0053_numerator": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0059_denominator": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0059_long": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf0059_numerator": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf2372_long": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__stg_core__patient"], "model.the_tuva_project.quality_measures__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": ["model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_medical_claim"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_summary": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.readmissions__readmission_crude": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"], "model.the_tuva_project.readmissions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "seed.the_tuva_project.terminology__admit_source": [], "seed.the_tuva_project.terminology__admit_type": [], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__apr_drg": [], "seed.the_tuva_project.terminology__bill_type": [], "seed.the_tuva_project.terminology__calendar": [], "seed.the_tuva_project.terminology__claim_type": [], "seed.the_tuva_project.terminology__code_type": [], "seed.the_tuva_project.terminology__discharge_disposition": [], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__gender": [], "seed.the_tuva_project.terminology__hcpcs_level_2": [], "seed.the_tuva_project.terminology__icd_10_cm": [], "seed.the_tuva_project.terminology__icd_10_pcs": [], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__medicare_orec": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__ms_drg": [], "seed.the_tuva_project.terminology__ndc": [], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": [], "seed.the_tuva_project.terminology__place_of_service": [], "seed.the_tuva_project.terminology__present_on_admission": [], "seed.the_tuva_project.terminology__provider": [], "seed.the_tuva_project.terminology__race": [], "seed.the_tuva_project.terminology__revenue_center": [], "seed.the_tuva_project.terminology__rxnorm_to_atc": [], "seed.the_tuva_project.terminology__snomed_ct": [], "seed.the_tuva_project.terminology__snomed_ct_transitive_closures": [], "seed.the_tuva_project.terminology__snomed_icd_10_map": [], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.pqi__measures": [], "seed.the_tuva_project.pqi__value_sets": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": [], "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": [], "seed.the_tuva_project.clinical_concepts": [], "seed.the_tuva_project.coding_systems": [], "seed.the_tuva_project.value_set_members": [], "seed.the_tuva_project.cms_hcc__adjustment_rates": [], "seed.the_tuva_project.cms_hcc__cpt_hcpcs": [], "seed.the_tuva_project.cms_hcc__demographic_factors": [], "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": [], "seed.the_tuva_project.cms_hcc__disease_factors": [], "seed.the_tuva_project.cms_hcc__disease_hierarchy": [], "seed.the_tuva_project.cms_hcc__disease_interaction_factors": [], "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": [], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": [], "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": [], "seed.the_tuva_project.data_quality__test_catalog": [], "seed.the_tuva_project.ed_classification__categories": [], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": [], "seed.the_tuva_project.ed_classification__johnston_icd9": [], "seed.the_tuva_project.hcc_suspecting__clinical_concepts": [], "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": [], "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": [], "seed.the_tuva_project.quality_measures__value_sets": [], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": [], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": [], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": [], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": [], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": [], "seed.the_tuva_project.readmissions__specialty_cohort": [], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": [], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": ["seed.the_tuva_project.ed_classification__johnston_icd9"], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": ["seed.the_tuva_project.ed_classification__johnston_icd10"], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": ["model.the_tuva_project.ccsr__singular_condition_category"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": ["model.the_tuva_project.normalized_input__medical_claim"], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": ["model.the_tuva_project.core__condition"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": ["model.the_tuva_project.core__medical_claim"], "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": ["model.the_tuva_project.core__procedure"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": ["model.the_tuva_project.data_quality__claims_preprocessing_summary"], "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": ["model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": ["model.the_tuva_project.quality_measures__stg_core__condition"], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": ["model.the_tuva_project.quality_measures__stg_core__encounter"], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": ["model.the_tuva_project.quality_measures__stg_core__medication"], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": ["model.the_tuva_project.quality_measures__stg_core__observation"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "child_map": {"model.input_layer.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.input_layer.eligibility": ["model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__stg_eligibility"], "model.input_layer.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.input_layer.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.input_layer.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.input_layer.medical_claim": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.medical_claim_expanded", "model.the_tuva_project.normalized_input__stg_medical_claim"], "model.input_layer.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.input_layer.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.input_layer.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.input_layer.pharmacy_claim": ["model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.normalized_input__stg_pharmacy_claim"], "model.input_layer.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.input_layer.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "seed.input_layer.eligibility_seed": ["model.input_layer.eligibility"], "seed.input_layer.lab_result_seed": [], "seed.input_layer.medical_claim_seed": ["model.input_layer.medical_claim"], "seed.input_layer.observation_seed": [], "seed.input_layer.pharmacy_claim_seed": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.ahrq_measures__pqi_denom_long": ["model.the_tuva_project.ahrq_measures__pqi_rate"], "model.the_tuva_project.ahrq_measures__pqi_exclusion_long": [], "model.the_tuva_project.ahrq_measures__pqi_num_long": ["model.the_tuva_project.ahrq_measures__pqi_rate", "model.the_tuva_project.ahrq_measures__pqi_summary"], "model.the_tuva_project.ahrq_measures__pqi_rate": [], "model.the_tuva_project.ahrq_measures__pqi_summary": [], "model.the_tuva_project.ahrq_measures__int_pqi_01_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_01_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_03_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_03_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_05_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_05_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_07_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_07_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_08_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_08_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_11_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_11_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_12_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_12_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_14_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_14_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_15_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_15_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_16_denom": ["model.the_tuva_project.ahrq_measures__int_pqi_16_num", "model.the_tuva_project.ahrq_measures__pqi_denom_long"], "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions": ["model.the_tuva_project.ahrq_measures__int_pqi_16_num", "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"], "model.the_tuva_project.ahrq_measures__int_pqi_16_num": ["model.the_tuva_project.ahrq_measures__pqi_num_long"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg": ["model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"], "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union": ["model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"], "model.the_tuva_project.ahrq_measures__stg_pqi_condition": ["model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_num"], "model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__int_pqi_16_num", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union", "model.the_tuva_project.ahrq_measures__pqi_summary"], "model.the_tuva_project.ahrq_measures__stg_pqi_member_months": ["model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_denom"], "model.the_tuva_project.ahrq_measures__stg_pqi_patient": ["model.the_tuva_project.ahrq_measures__int_pqi_01_denom", "model.the_tuva_project.ahrq_measures__int_pqi_03_denom", "model.the_tuva_project.ahrq_measures__int_pqi_05_denom", "model.the_tuva_project.ahrq_measures__int_pqi_07_denom", "model.the_tuva_project.ahrq_measures__int_pqi_08_denom", "model.the_tuva_project.ahrq_measures__int_pqi_11_denom", "model.the_tuva_project.ahrq_measures__int_pqi_12_denom", "model.the_tuva_project.ahrq_measures__int_pqi_14_denom", "model.the_tuva_project.ahrq_measures__int_pqi_15_denom", "model.the_tuva_project.ahrq_measures__int_pqi_16_denom", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age", "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender"], "model.the_tuva_project.ahrq_measures__stg_pqi_procedure": ["model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_num"], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category"], "model.the_tuva_project.ccsr__long_procedure_category": [], "model.the_tuva_project.ccsr__singular_condition_category": ["test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": ["test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f"], "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": ["test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0"], "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": [], "model.the_tuva_project.medical_claim_expanded": [], "model.the_tuva_project.acute_inpatient__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"], "model.the_tuva_project.acute_inpatient__data_quality_summary": [], "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": [], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__institutional_claims": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "model.the_tuva_project.acute_inpatient__encounter_id"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.emergency_department__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__stg_eligibility": [], "model.the_tuva_project.emergency_department__stg_medical_claim": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.emergency_department__stg_service_category": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.normalized_input__eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.emergency_department__stg_eligibility"], "model.the_tuva_project.normalized_input__medical_claim": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.emergency_department__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f"], "model.the_tuva_project.normalized_input__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case"], "model.the_tuva_project.normalized_input__int_admit_source_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_admit_source_voting": ["model.the_tuva_project.normalized_input__int_admit_source_final"], "model.the_tuva_project.normalized_input__int_admit_type_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_admit_type_voting": ["model.the_tuva_project.normalized_input__int_admit_type_final"], "model.the_tuva_project.normalized_input__int_apr_drg_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_apr_drg_voting": ["model.the_tuva_project.normalized_input__int_apr_drg_final"], "model.the_tuva_project.normalized_input__int_bill_type_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_bill_type_voting": ["model.the_tuva_project.normalized_input__int_bill_type_final"], "model.the_tuva_project.normalized_input__int_diagnosis_code_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize": ["model.the_tuva_project.normalized_input__int_diagnosis_code_voting", "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"], "model.the_tuva_project.normalized_input__int_diagnosis_code_voting": ["model.the_tuva_project.normalized_input__int_diagnosis_code_final"], "model.the_tuva_project.normalized_input__int_discharge_disposition_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_discharge_disposition_voting": ["model.the_tuva_project.normalized_input__int_discharge_disposition_final"], "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize": ["model.the_tuva_project.normalized_input__eligibility"], "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize": ["model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__int_medical_date_aggregation", "model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_medical_date_aggregation": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_medical_npi_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_ms_drg_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_ms_drg_voting": ["model.the_tuva_project.normalized_input__int_ms_drg_final"], "model.the_tuva_project.normalized_input__int_place_of_service_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_present_on_admit_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_present_on_admit_normalize": ["model.the_tuva_project.normalized_input__int_present_on_admit_voting", "model.the_tuva_project.normalized_input__int_present_on_admit_voting"], "model.the_tuva_project.normalized_input__int_present_on_admit_voting": ["model.the_tuva_project.normalized_input__int_present_on_admit_final"], "model.the_tuva_project.normalized_input__int_procedure_code_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_procedure_code_normalize": ["model.the_tuva_project.normalized_input__int_procedure_code_voting", "model.the_tuva_project.normalized_input__int_procedure_code_voting", "model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_code_voting": ["model.the_tuva_project.normalized_input__int_procedure_code_final"], "model.the_tuva_project.normalized_input__int_procedure_date_final": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_procedure_date_normalize": ["model.the_tuva_project.normalized_input__int_procedure_date_voting"], "model.the_tuva_project.normalized_input__int_procedure_date_voting": ["model.the_tuva_project.normalized_input__int_procedure_date_final"], "model.the_tuva_project.normalized_input__int_revenue_center_normalize": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__int_undetermined_claim_type": ["model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__stg_eligibility": ["model.the_tuva_project.normalized_input__eligibility", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"], "model.the_tuva_project.normalized_input__stg_medical_claim": ["model.the_tuva_project.normalized_input__int_admit_source_voting", "model.the_tuva_project.normalized_input__int_admit_type_voting", "model.the_tuva_project.normalized_input__int_apr_drg_voting", "model.the_tuva_project.normalized_input__int_bill_type_voting", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_ms_drg_voting", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.normalized_input__int_undetermined_claim_type", "model.the_tuva_project.normalized_input__medical_claim"], "model.the_tuva_project.normalized_input__stg_pharmacy_claim": ["model.the_tuva_project.normalized_input__pharmacy_claim"], "model.the_tuva_project.service_category__dq_input_layer_results": [], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__dq_input_layer_results"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": [], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": [], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.emergency_department__stg_service_category"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__emergency_department_institutional"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_institutional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.value_set_member_relevant_fields": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"], "model.the_tuva_project.cms_hcc__int_demographic_factors": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors", "model.the_tuva_project.cms_hcc__patient_risk_factors", "model.the_tuva_project.cms_hcc__patient_risk_factors", "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400"], "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_disease_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_eligible_conditions": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc"], "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_hcc_count_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "model.the_tuva_project.cms_hcc__int_hcc_mapping": ["model.the_tuva_project.cms_hcc__int_hcc_hierarchy"], "model.the_tuva_project.cms_hcc__int_members": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.core__condition": ["model.the_tuva_project.ahrq_measures__stg_pqi_condition", "model.the_tuva_project.ccsr__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.hcc_suspecting__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.financial_pmpm__stg_eligibility"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.ahrq_measures__stg_pqi_inpatient_encounter", "model.the_tuva_project.ed_classification__stg_encounter", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.hcc_suspecting__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__lab_result"], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.quality_measures__stg_medical_claim", "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.hcc_suspecting__stg_core__medication", "model.the_tuva_project.quality_measures__stg_core__medication"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.hcc_suspecting__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.core__patient": ["model.the_tuva_project.ahrq_measures__stg_pqi_patient", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "model.the_tuva_project.cms_hcc__stg_core__patient", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.hcc_suspecting__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"], "model.the_tuva_project.core__practitioner": [], "model.the_tuva_project.core__procedure": ["model.the_tuva_project.ahrq_measures__stg_pqi_procedure", "model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.readmissions__stg_core__procedure", "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5"], "model.the_tuva_project.core__stg_claims_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.core__stg_claims_encounter": [], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__location"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_practitioner"], "model.the_tuva_project.core__stg_claims_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.core__stg_claims_practitioner": ["model.the_tuva_project.core__practitioner"], "model.the_tuva_project.core__stg_claims_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.core__stg_clinical_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.the_tuva_project.core__location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.the_tuva_project.core__practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.data_quality__claims_preprocessing_summary": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_encounter", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_claims_pharmacy_claim", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_claims_procedure", "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "model.the_tuva_project.data_quality__claims_preprocessing_use_case", "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result": ["test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9"], "model.the_tuva_project.data_quality__claims_preprocessing_use_case": ["test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa", "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"], "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim", "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details": ["model.the_tuva_project.data_quality__claims_preprocessing_summary", "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_detail"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_quality__claims_preprocessing_test_result"], "model.the_tuva_project.ed_classification__summary": [], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.financial_pmpm__pmpm_prep", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__orphan_claim_by_claim_type"], "model.the_tuva_project.financial_pmpm__pmpm_payer": [], "model.the_tuva_project.financial_pmpm__pmpm_payer_plan": [], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__pmpm_payer", "model.the_tuva_project.financial_pmpm__pmpm_payer_plan", "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.hcc_suspecting__list": ["model.the_tuva_project.hcc_suspecting__list_rollup", "model.the_tuva_project.hcc_suspecting__summary"], "model.the_tuva_project.hcc_suspecting__list_rollup": [], "model.the_tuva_project.hcc_suspecting__summary": [], "model.the_tuva_project.hcc_suspecting__int_all_conditions": ["model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"], "model.the_tuva_project.hcc_suspecting__int_all_medications": ["model.the_tuva_project.hcc_suspecting__int_medication_suspects"], "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_lab_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_medication_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_observation_suspects": ["model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__list"], "model.the_tuva_project.hcc_suspecting__int_prep_conditions": ["model.the_tuva_project.hcc_suspecting__int_all_conditions", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs": ["model.the_tuva_project.hcc_suspecting__int_lab_suspects"], "model.the_tuva_project.hcc_suspecting__stg_core__condition": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions"], "model.the_tuva_project.hcc_suspecting__stg_core__lab_result": ["model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"], "model.the_tuva_project.hcc_suspecting__stg_core__medication": ["model.the_tuva_project.hcc_suspecting__int_all_medications"], "model.the_tuva_project.hcc_suspecting__stg_core__observation": ["model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "model.the_tuva_project.hcc_suspecting__stg_core__patient": ["model.the_tuva_project.hcc_suspecting__summary"], "model.the_tuva_project.hcc_suspecting__stg_core__pharmacy_claim": ["model.the_tuva_project.hcc_suspecting__int_all_medications"], "model.the_tuva_project.insights__count_claim_by_claim_type": [], "model.the_tuva_project.insights__count_claim_by_date_column": [], "model.the_tuva_project.insights__count_claim_by_service_category": [], "model.the_tuva_project.insights__orphan_claim_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_service_category": [], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": [], "model.the_tuva_project.insights__trend_count_claim_by_service_category": [], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": [], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": [], "model.the_tuva_project.quality_measures__summary_counts": [], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__summary_counts", "model.the_tuva_project.quality_measures__summary_wide"], "model.the_tuva_project.quality_measures__summary_wide": [], "model.the_tuva_project.quality_measures__int_cbe0055_exclusions": ["model.the_tuva_project.quality_measures__int_cbe0055_long"], "model.the_tuva_project.quality_measures__int_cbe0055_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_cbe0055_numerator": ["model.the_tuva_project.quality_measures__int_cbe0055_long"], "model.the_tuva_project.quality_measures__int_cbe0055__denominator": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cbe0055_long", "model.the_tuva_project.quality_measures__int_cbe0055_numerator"], "model.the_tuva_project.quality_measures__int_cbe0055__performance_period": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cbe0055_numerator"], "model.the_tuva_project.quality_measures__int_cqm236_denominator": ["model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_cqm236_numerator"], "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations": ["model.the_tuva_project.quality_measures__int_cqm236_exclusions"], "model.the_tuva_project.quality_measures__int_cqm236_exclusions": ["model.the_tuva_project.quality_measures__int_cqm236_long"], "model.the_tuva_project.quality_measures__int_cqm236_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_cqm236_numerator": ["model.the_tuva_project.quality_measures__int_cqm236_long"], "model.the_tuva_project.quality_measures__int_cqm236__performance_period": ["model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0053_denominator": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0053_numerator"], "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications": ["model.the_tuva_project.quality_measures__int_nqf0053_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0053_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0053_long"], "model.the_tuva_project.quality_measures__int_nqf0053_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0053_numerator": ["model.the_tuva_project.quality_measures__int_nqf0053_long"], "model.the_tuva_project.quality_measures__int_nqf0053__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0059_denominator": ["model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf0059_numerator"], "model.the_tuva_project.quality_measures__int_nqf0059_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0059_long"], "model.the_tuva_project.quality_measures__int_nqf0059_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0059_numerator": ["model.the_tuva_project.quality_measures__int_nqf0059_long"], "model.the_tuva_project.quality_measures__int_nqf0059__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf2372_numerator"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": ["model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__int_nqf2372_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"], "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp": ["model.the_tuva_project.quality_measures__int_cbe0055_exclusions", "model.the_tuva_project.quality_measures__int_cqm236_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0053_exclusions", "model.the_tuva_project.quality_measures__int_nqf0059_exclusions", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.quality_measures__int_cqm236_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_long", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_long", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_long", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_long", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp", "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_numerator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative", "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__readmission_summary"], "model.the_tuva_project.readmissions__readmission_summary": [], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__readmission_crude", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_crude": [], "model.the_tuva_project.readmissions__stg_core__condition": [], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_admit_source_voting"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_admit_type_voting"], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__apr_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_apr_drg_voting", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__bill_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_bill_type_voting", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__calendar": ["model.the_tuva_project.ahrq_measures__stg_pqi_member_months", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize", "model.the_tuva_project.normalized_input__int_procedure_date_normalize"], "seed.the_tuva_project.terminology__claim_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__code_type": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"], "seed.the_tuva_project.terminology__discharge_disposition": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_discharge_disposition_voting", "model.the_tuva_project.readmissions__encounter_data_quality"], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__gender": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__hcpcs_level_2": ["model.the_tuva_project.core__observation", "model.the_tuva_project.core__procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__icd_10_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__condition", "model.the_tuva_project.core__observation", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize", "model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.terminology__icd_10_pcs": ["model.the_tuva_project.core__observation", "model.the_tuva_project.core__procedure", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.normalized_input__int_procedure_code_normalize", "model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__icd_9_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__condition", "model.the_tuva_project.core__observation", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"], "seed.the_tuva_project.terminology__icd_9_pcs": ["model.the_tuva_project.core__observation", "model.the_tuva_project.core__procedure", "model.the_tuva_project.normalized_input__int_procedure_code_normalize"], "seed.the_tuva_project.terminology__loinc": ["model.the_tuva_project.core__lab_result", "model.the_tuva_project.core__observation"], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_orec": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_status": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__ms_drg": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_ms_drg_voting", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__ndc": ["model.the_tuva_project.core__medication", "model.the_tuva_project.core__medication"], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__payer_type": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__place_of_service": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_place_of_service_normalize", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__present_on_admission": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"], "seed.the_tuva_project.terminology__provider": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.ed_classification__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize", "model.the_tuva_project.normalized_input__int_medical_npi_normalize"], "seed.the_tuva_project.terminology__race": ["model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"], "seed.the_tuva_project.terminology__revenue_center": ["model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.normalized_input__int_revenue_center_normalize", "model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__rxnorm_to_atc": ["model.the_tuva_project.core__medication", "model.the_tuva_project.core__medication"], "seed.the_tuva_project.terminology__snomed_ct": ["model.the_tuva_project.core__condition", "model.the_tuva_project.core__lab_result", "model.the_tuva_project.core__observation", "model.the_tuva_project.core__procedure"], "seed.the_tuva_project.terminology__snomed_ct_transitive_closures": [], "seed.the_tuva_project.terminology__snomed_icd_10_map": ["model.the_tuva_project.hcc_suspecting__int_prep_conditions"], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.pqi__measures": ["model.the_tuva_project.ahrq_measures__pqi_summary"], "seed.the_tuva_project.pqi__value_sets": ["model.the_tuva_project.ahrq_measures__int_pqi_01_num", "model.the_tuva_project.ahrq_measures__int_pqi_03_num", "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__int_pqi_05_num", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_07_num", "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_08_num", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_11_num", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_12_num", "model.the_tuva_project.ahrq_measures__int_pqi_14_num", "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_15_num", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions", "model.the_tuva_project.ahrq_measures__int_pqi_16_num", "model.the_tuva_project.ahrq_measures__int_pqi_16_num"], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": ["model.the_tuva_project.ccsr__long_condition_category"], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": ["model.the_tuva_project.ccsr__dx_vertical_pivot"], "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": ["model.the_tuva_project.ccsr__procedure_category_map"], "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"], "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": [], "seed.the_tuva_project.clinical_concepts": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.coding_systems": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.value_set_members": ["model.the_tuva_project.value_set_member_relevant_fields"], "seed.the_tuva_project.cms_hcc__adjustment_rates": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "seed.the_tuva_project.cms_hcc__cpt_hcpcs": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "seed.the_tuva_project.cms_hcc__demographic_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"], "seed.the_tuva_project.cms_hcc__disease_factors": ["model.the_tuva_project.cms_hcc__int_disease_factors"], "seed.the_tuva_project.cms_hcc__disease_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_hierarchy"], "seed.the_tuva_project.cms_hcc__disease_interaction_factors": ["model.the_tuva_project.cms_hcc__int_disease_interaction_factors"], "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": ["model.the_tuva_project.cms_hcc__int_hcc_mapping"], "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "seed.the_tuva_project.data_quality__test_catalog": ["model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures", "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility", "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values", "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details", "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"], "seed.the_tuva_project.ed_classification__categories": ["model.the_tuva_project.ed_classification__summary"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.hcc_suspecting__clinical_concepts": ["model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects", "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"], "seed.the_tuva_project.hcc_suspecting__hcc_descriptions": ["model.the_tuva_project.hcc_suspecting__int_all_conditions", "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects", "model.the_tuva_project.hcc_suspecting__int_lab_suspects", "model.the_tuva_project.hcc_suspecting__int_medication_suspects", "model.the_tuva_project.hcc_suspecting__int_observation_suspects"], "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings": ["model.the_tuva_project.hcc_suspecting__int_all_conditions"], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": ["model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cbe0055__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_cqm236__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0053__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf0059__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"], "seed.the_tuva_project.quality_measures__value_sets": ["model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055__denominator", "model.the_tuva_project.quality_measures__int_cbe0055_numerator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_denominator", "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_denominator", "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications", "model.the_tuva_project.quality_measures__int_nqf0053_numerator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_denominator", "model.the_tuva_project.quality_measures__int_nqf0059_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness", "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia", "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty", "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__exclusion"], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": ["model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__specialty_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0": [], "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd": [], "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7": [], "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": [], "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": [], "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": [], "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": [], "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": [], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": [], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": [], "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f": [], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": [], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400": [], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": [], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": [], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": [], "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0": [], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": [], "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15": [], "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47": [], "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa": [], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": [], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": [], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": [], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": [], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": [], "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": []}, "group_map": {}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index eb671295f..7a264cd3a 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.5.0", "generated_at": "2024-05-10T13:57:40.108958Z", "invocation_id": "e50d9557-e0ce-4212-8187-4b7de7f3a0f5", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.939257Z", "completed_at": "2024-05-10T13:57:32.983504Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:32.987063Z", "completed_at": "2024-05-10T13:57:32.987063Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.055248260498046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.949350Z", "completed_at": "2024-05-10T13:57:32.984501Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:32.988061Z", "completed_at": "2024-05-10T13:57:32.988061Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05604410171508789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.959755Z", "completed_at": "2024-05-10T13:57:32.985055Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:32.989092Z", "completed_at": "2024-05-10T13:57:32.989092Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05501842498779297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.967317Z", "completed_at": "2024-05-10T13:57:32.985055Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:32.990281Z", "completed_at": "2024-05-10T13:57:32.990281Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05603504180908203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.976289Z", "completed_at": "2024-05-10T13:57:32.986062Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:32.990281Z", "completed_at": "2024-05-10T13:57:32.990281Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05604243278503418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:32.999380Z", "completed_at": "2024-05-10T13:57:33.034841Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.042093Z", "completed_at": "2024-05-10T13:57:33.042093Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.049772024154663086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.007386Z", "completed_at": "2024-05-10T13:57:33.037935Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.043074Z", "completed_at": "2024-05-10T13:57:33.043074Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04877352714538574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.012387Z", "completed_at": "2024-05-10T13:57:33.039114Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.043074Z", "completed_at": "2024-05-10T13:57:33.043074Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04977250099182129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.016100Z", "completed_at": "2024-05-10T13:57:33.040054Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.044073Z", "completed_at": "2024-05-10T13:57:33.044073Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.049796104431152344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.024107Z", "completed_at": "2024-05-10T13:57:33.041073Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.046072Z", "completed_at": "2024-05-10T13:57:33.046072Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05030202865600586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.054614Z", "completed_at": "2024-05-10T13:57:33.055633Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.063751Z", "completed_at": "2024-05-10T13:57:33.063751Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016175270080566406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.056815Z", "completed_at": "2024-05-10T13:57:33.057837Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.064737Z", "completed_at": "2024-05-10T13:57:33.064737Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017171621322631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.lab_result_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.058297Z", "completed_at": "2024-05-10T13:57:33.059317Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.064737Z", "completed_at": "2024-05-10T13:57:33.064737Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017171621322631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.059713Z", "completed_at": "2024-05-10T13:57:33.060727Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.066803Z", "completed_at": "2024-05-10T13:57:33.066803Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017171621322631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.observation_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.061729Z", "completed_at": "2024-05-10T13:57:33.063751Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.068784Z", "completed_at": "2024-05-10T13:57:33.068784Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017170190811157227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.075784Z", "completed_at": "2024-05-10T13:57:33.076787Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.085065Z", "completed_at": "2024-05-10T13:57:33.085065Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015407800674438477, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.077787Z", "completed_at": "2024-05-10T13:57:33.078787Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.086192Z", "completed_at": "2024-05-10T13:57:33.086192Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01643061637878418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.079526Z", "completed_at": "2024-05-10T13:57:33.079526Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.086192Z", "completed_at": "2024-05-10T13:57:33.086192Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016868114471435547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.081549Z", "completed_at": "2024-05-10T13:57:33.082054Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.088215Z", "completed_at": "2024-05-10T13:57:33.088215Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01758599281311035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.084063Z", "completed_at": "2024-05-10T13:57:33.085065Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.090375Z", "completed_at": "2024-05-10T13:57:33.090375Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01661086082458496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.096394Z", "completed_at": "2024-05-10T13:57:33.098942Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.107948Z", "completed_at": "2024-05-10T13:57:33.107948Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01603984832763672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.clinical_concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.099947Z", "completed_at": "2024-05-10T13:57:33.101950Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.107948Z", "completed_at": "2024-05-10T13:57:33.107948Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017452001571655273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.101950Z", "completed_at": "2024-05-10T13:57:33.102967Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.109054Z", "completed_at": "2024-05-10T13:57:33.109054Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01717972755432129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.103947Z", "completed_at": "2024-05-10T13:57:33.104947Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.110468Z", "completed_at": "2024-05-10T13:57:33.110468Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017193317413330078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.105947Z", "completed_at": "2024-05-10T13:57:33.106967Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.111573Z", "completed_at": "2024-05-10T13:57:33.111573Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018193483352661133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.119101Z", "completed_at": "2024-05-10T13:57:33.120121Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.128101Z", "completed_at": "2024-05-10T13:57:33.129101Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015010595321655273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.121119Z", "completed_at": "2024-05-10T13:57:33.122121Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.129101Z", "completed_at": "2024-05-10T13:57:33.129101Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01550912857055664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.122121Z", "completed_at": "2024-05-10T13:57:33.123102Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.130103Z", "completed_at": "2024-05-10T13:57:33.130103Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016534805297851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.124102Z", "completed_at": "2024-05-10T13:57:33.125103Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.131606Z", "completed_at": "2024-05-10T13:57:33.131606Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01653456687927246, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.126118Z", "completed_at": "2024-05-10T13:57:33.128101Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.132632Z", "completed_at": "2024-05-10T13:57:33.132632Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016535520553588867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.140336Z", "completed_at": "2024-05-10T13:57:33.141351Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.148516Z", "completed_at": "2024-05-10T13:57:33.148516Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015377044677734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.141973Z", "completed_at": "2024-05-10T13:57:33.143016Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.149523Z", "completed_at": "2024-05-10T13:57:33.149523Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016376972198486328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.coding_systems"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.143016Z", "completed_at": "2024-05-10T13:57:33.143993Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.150531Z", "completed_at": "2024-05-10T13:57:33.150531Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01535487174987793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.data_quality__test_catalog"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.144993Z", "completed_at": "2024-05-10T13:57:33.145992Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.151528Z", "completed_at": "2024-05-10T13:57:33.151528Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01636028289794922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.146992Z", "completed_at": "2024-05-10T13:57:33.148516Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.153529Z", "completed_at": "2024-05-10T13:57:33.153529Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016315698623657227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.160953Z", "completed_at": "2024-05-10T13:57:33.161970Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.234077Z", "completed_at": "2024-05-10T13:57:33.234077Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07958006858825684, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.162499Z", "completed_at": "2024-05-10T13:57:33.164536Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.235082Z", "completed_at": "2024-05-10T13:57:33.235082Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08055686950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.164536Z", "completed_at": "2024-05-10T13:57:33.227679Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.235082Z", "completed_at": "2024-05-10T13:57:33.235082Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.08159875869750977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.230090Z", "completed_at": "2024-05-10T13:57:33.230090Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.237154Z", "completed_at": "2024-05-10T13:57:33.237154Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.08255553245544434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.232655Z", "completed_at": "2024-05-10T13:57:33.233663Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.239127Z", "completed_at": "2024-05-10T13:57:33.239127Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08255434036254883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.247082Z", "completed_at": "2024-05-10T13:57:33.248593Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.257605Z", "completed_at": "2024-05-10T13:57:33.257605Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0164947509765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.248593Z", "completed_at": "2024-05-10T13:57:33.249599Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.258605Z", "completed_at": "2024-05-10T13:57:33.258605Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01652216911315918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.250607Z", "completed_at": "2024-05-10T13:57:33.251624Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.258605Z", "completed_at": "2024-05-10T13:57:33.258605Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01752305030822754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.252605Z", "completed_at": "2024-05-10T13:57:33.253604Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.259604Z", "completed_at": "2024-05-10T13:57:33.259604Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017501115798950195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.254604Z", "completed_at": "2024-05-10T13:57:33.256604Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.261605Z", "completed_at": "2024-05-10T13:57:33.261605Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018520355224609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.269778Z", "completed_at": "2024-05-10T13:57:33.270779Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.279327Z", "completed_at": "2024-05-10T13:57:33.279327Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016731977462768555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.271779Z", "completed_at": "2024-05-10T13:57:33.272779Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.279327Z", "completed_at": "2024-05-10T13:57:33.279327Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017069101333618164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.273779Z", "completed_at": "2024-05-10T13:57:33.274811Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.280336Z", "completed_at": "2024-05-10T13:57:33.280336Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016070842742919922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.275778Z", "completed_at": "2024-05-10T13:57:33.276781Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.281841Z", "completed_at": "2024-05-10T13:57:33.281841Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01707601547241211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.277778Z", "completed_at": "2024-05-10T13:57:33.278802Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.283875Z", "completed_at": "2024-05-10T13:57:33.283875Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017078161239624023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.291461Z", "completed_at": "2024-05-10T13:57:33.292479Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.300732Z", "completed_at": "2024-05-10T13:57:33.300732Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01585841178894043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.293158Z", "completed_at": "2024-05-10T13:57:33.294198Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.301712Z", "completed_at": "2024-05-10T13:57:33.301712Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016857147216796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.294198Z", "completed_at": "2024-05-10T13:57:33.296177Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.302715Z", "completed_at": "2024-05-10T13:57:33.302715Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016857147216796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.297176Z", "completed_at": "2024-05-10T13:57:33.298702Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.303711Z", "completed_at": "2024-05-10T13:57:33.303711Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01759505271911621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.299707Z", "completed_at": "2024-05-10T13:57:33.300732Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.305715Z", "completed_at": "2024-05-10T13:57:33.305715Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01737213134765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.312716Z", "completed_at": "2024-05-10T13:57:33.313734Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.321555Z", "completed_at": "2024-05-10T13:57:33.321555Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01511383056640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.314712Z", "completed_at": "2024-05-10T13:57:33.315784Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.322553Z", "completed_at": "2024-05-10T13:57:33.322553Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015146970748901367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.316141Z", "completed_at": "2024-05-10T13:57:33.317154Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.322553Z", "completed_at": "2024-05-10T13:57:33.322553Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01615619659423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.317540Z", "completed_at": "2024-05-10T13:57:33.318553Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.324859Z", "completed_at": "2024-05-10T13:57:33.324859Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016137361526489258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.319538Z", "completed_at": "2024-05-10T13:57:33.321555Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.325868Z", "completed_at": "2024-05-10T13:57:33.325868Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017115354537963867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.334368Z", "completed_at": "2024-05-10T13:57:33.335365Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.343386Z", "completed_at": "2024-05-10T13:57:33.343386Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016515493392944336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.336365Z", "completed_at": "2024-05-10T13:57:33.337364Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.344366Z", "completed_at": "2024-05-10T13:57:33.344366Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016516447067260742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.338365Z", "completed_at": "2024-05-10T13:57:33.339384Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.344366Z", "completed_at": "2024-05-10T13:57:33.344366Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016516923904418945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.340364Z", "completed_at": "2024-05-10T13:57:33.341368Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.346365Z", "completed_at": "2024-05-10T13:57:33.346365Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01651597023010254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.342366Z", "completed_at": "2024-05-10T13:57:33.343386Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.347870Z", "completed_at": "2024-05-10T13:57:33.347870Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015733718872070312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.355373Z", "completed_at": "2024-05-10T13:57:33.356377Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.364916Z", "completed_at": "2024-05-10T13:57:33.364916Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015424251556396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.357373Z", "completed_at": "2024-05-10T13:57:33.358376Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.365929Z", "completed_at": "2024-05-10T13:57:33.365929Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01590728759765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.358376Z", "completed_at": "2024-05-10T13:57:33.360389Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.365929Z", "completed_at": "2024-05-10T13:57:33.365929Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016928434371948242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.361372Z", "completed_at": "2024-05-10T13:57:33.362375Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.367927Z", "completed_at": "2024-05-10T13:57:33.367927Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01656961441040039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.363376Z", "completed_at": "2024-05-10T13:57:33.364916Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.368948Z", "completed_at": "2024-05-10T13:57:33.368948Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01755499839782715, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.376030Z", "completed_at": "2024-05-10T13:57:33.378033Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.385674Z", "completed_at": "2024-05-10T13:57:33.385674Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01555490493774414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.378033Z", "completed_at": "2024-05-10T13:57:33.379540Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.386672Z", "completed_at": "2024-05-10T13:57:33.386672Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01604175567626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.379540Z", "completed_at": "2024-05-10T13:57:33.380544Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.387673Z", "completed_at": "2024-05-10T13:57:33.387673Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01703786849975586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.381561Z", "completed_at": "2024-05-10T13:57:33.382588Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.389052Z", "completed_at": "2024-05-10T13:57:33.389052Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015996456146240234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__loinc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.383661Z", "completed_at": "2024-05-10T13:57:33.385674Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.390048Z", "completed_at": "2024-05-10T13:57:33.390048Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016997814178466797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.398027Z", "completed_at": "2024-05-10T13:57:33.398552Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.407095Z", "completed_at": "2024-05-10T13:57:33.407095Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016063213348388672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.399555Z", "completed_at": "2024-05-10T13:57:33.400561Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.408093Z", "completed_at": "2024-05-10T13:57:33.408093Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016064167022705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.401560Z", "completed_at": "2024-05-10T13:57:33.402579Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.408093Z", "completed_at": "2024-05-10T13:57:33.408093Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01606273651123047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.403560Z", "completed_at": "2024-05-10T13:57:33.404560Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.410092Z", "completed_at": "2024-05-10T13:57:33.410092Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01706552505493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.405078Z", "completed_at": "2024-05-10T13:57:33.406095Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.412092Z", "completed_at": "2024-05-10T13:57:33.412092Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016064167022705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.418610Z", "completed_at": "2024-05-10T13:57:33.420611Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.429772Z", "completed_at": "2024-05-10T13:57:33.429772Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016676902770996094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ndc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.421609Z", "completed_at": "2024-05-10T13:57:33.422610Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.429772Z", "completed_at": "2024-05-10T13:57:33.429772Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017342805862426758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.422610Z", "completed_at": "2024-05-10T13:57:33.424628Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.429772Z", "completed_at": "2024-05-10T13:57:33.429772Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017064809799194336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.425622Z", "completed_at": "2024-05-10T13:57:33.426612Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.432281Z", "completed_at": "2024-05-10T13:57:33.432281Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01778125762939453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.427766Z", "completed_at": "2024-05-10T13:57:33.428772Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.434374Z", "completed_at": "2024-05-10T13:57:33.434374Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017780780792236328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.441392Z", "completed_at": "2024-05-10T13:57:33.442395Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.450942Z", "completed_at": "2024-05-10T13:57:33.450942Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01653432846069336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.443391Z", "completed_at": "2024-05-10T13:57:33.444395Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.451929Z", "completed_at": "2024-05-10T13:57:33.451929Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016553878784179688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.444395Z", "completed_at": "2024-05-10T13:57:33.445392Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.451929Z", "completed_at": "2024-05-10T13:57:33.451929Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016554594039916992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.446407Z", "completed_at": "2024-05-10T13:57:33.447915Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.453948Z", "completed_at": "2024-05-10T13:57:33.453948Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017534971237182617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.448921Z", "completed_at": "2024-05-10T13:57:33.450942Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.455927Z", "completed_at": "2024-05-10T13:57:33.455927Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018119096755981445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.463878Z", "completed_at": "2024-05-10T13:57:33.464897Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.507831Z", "completed_at": "2024-05-10T13:57:33.507831Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05018115043640137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.465422Z", "completed_at": "2024-05-10T13:57:33.466451Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.508688Z", "completed_at": "2024-05-10T13:57:33.508688Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04992842674255371, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.value_set_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.467427Z", "completed_at": "2024-05-10T13:57:33.507831Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.512472Z", "completed_at": "2024-05-10T13:57:33.512472Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05433511734008789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.484199Z", "completed_at": "2024-05-10T13:57:33.508688Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.513352Z", "completed_at": "2024-05-10T13:57:33.513352Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05431365966796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.494845Z", "completed_at": "2024-05-10T13:57:33.510459Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.514866Z", "completed_at": "2024-05-10T13:57:33.514866Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0550227165222168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.519876Z", "completed_at": "2024-05-10T13:57:33.540181Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.567798Z", "completed_at": "2024-05-10T13:57:33.567798Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.057138681411743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.528876Z", "completed_at": "2024-05-10T13:57:33.549266Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.568797Z", "completed_at": "2024-05-10T13:57:33.568797Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05561947822570801, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.540181Z", "completed_at": "2024-05-10T13:57:33.566801Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.572490Z", "completed_at": "2024-05-10T13:57:33.572490Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04659295082092285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.551271Z", "completed_at": "2024-05-10T13:57:33.569472Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.573490Z", "completed_at": "2024-05-10T13:57:33.573490Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.037766456604003906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.561318Z", "completed_at": "2024-05-10T13:57:33.570491Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.575788Z", "completed_at": "2024-05-10T13:57:33.575788Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03878068923950195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.579715Z", "completed_at": "2024-05-10T13:57:33.593394Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.607933Z", "completed_at": "2024-05-10T13:57:33.607933Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03466653823852539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.589283Z", "completed_at": "2024-05-10T13:57:33.596410Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.608932Z", "completed_at": "2024-05-10T13:57:33.608932Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0347599983215332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.593394Z", "completed_at": "2024-05-10T13:57:33.606935Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.611936Z", "completed_at": "2024-05-10T13:57:33.611936Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03572416305541992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.597920Z", "completed_at": "2024-05-10T13:57:33.608932Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.613932Z", "completed_at": "2024-05-10T13:57:33.613932Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.025463581085205078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.601930Z", "completed_at": "2024-05-10T13:57:33.610953Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.615435Z", "completed_at": "2024-05-10T13:57:33.615435Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02638983726501465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.620766Z", "completed_at": "2024-05-10T13:57:33.636133Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.649644Z", "completed_at": "2024-05-10T13:57:33.649644Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03822946548461914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.624783Z", "completed_at": "2024-05-10T13:57:33.637134Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.650648Z", "completed_at": "2024-05-10T13:57:33.650648Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0378880500793457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.637134Z", "completed_at": "2024-05-10T13:57:33.650648Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.655648Z", "completed_at": "2024-05-10T13:57:33.655648Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03810882568359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.642133Z", "completed_at": "2024-05-10T13:57:33.651648Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.656856Z", "completed_at": "2024-05-10T13:57:33.656856Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.02579212188720703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.647135Z", "completed_at": "2024-05-10T13:57:33.654649Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.658878Z", "completed_at": "2024-05-10T13:57:33.658878Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02575969696044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.662892Z", "completed_at": "2024-05-10T13:57:33.679453Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.699635Z", "completed_at": "2024-05-10T13:57:33.699635Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0437617301940918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.670487Z", "completed_at": "2024-05-10T13:57:33.687100Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.699635Z", "completed_at": "2024-05-10T13:57:33.700640Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04376053810119629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.680524Z", "completed_at": "2024-05-10T13:57:33.696084Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.702638Z", "completed_at": "2024-05-10T13:57:33.702638Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.036183834075927734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.688083Z", "completed_at": "2024-05-10T13:57:33.700640Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.705639Z", "completed_at": "2024-05-10T13:57:33.705639Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.030169010162353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.697084Z", "completed_at": "2024-05-10T13:57:33.702638Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.707640Z", "completed_at": "2024-05-10T13:57:33.707640Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030185699462890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.value_set_member_relevant_fields"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.711639Z", "completed_at": "2024-05-10T13:57:33.722180Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.733819Z", "completed_at": "2024-05-10T13:57:33.733819Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02911829948425293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.717176Z", "completed_at": "2024-05-10T13:57:33.725194Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.734308Z", "completed_at": "2024-05-10T13:57:33.734308Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02911829948425293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.723177Z", "completed_at": "2024-05-10T13:57:33.730194Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.736755Z", "completed_at": "2024-05-10T13:57:33.736755Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.029269695281982422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.727176Z", "completed_at": "2024-05-10T13:57:33.734743Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.739928Z", "completed_at": "2024-05-10T13:57:33.739928Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.02174544334411621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.749453Z", "completed_at": "2024-05-10T13:57:33.758972Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.768383Z", "completed_at": "2024-05-10T13:57:33.768383Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.029875516891479492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.medical_claim_expanded"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.820816Z", "completed_at": "2024-05-10T13:57:33.840375Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.867083Z", "completed_at": "2024-05-10T13:57:33.867083Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05613827705383301, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.877655Z", "completed_at": "2024-05-10T13:57:33.991360Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.996041Z", "completed_at": "2024-05-10T13:57:33.996041Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.12441158294677734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.892334Z", "completed_at": "2024-05-10T13:57:33.991360Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.996563Z", "completed_at": "2024-05-10T13:57:33.996563Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.12465214729309082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.903116Z", "completed_at": "2024-05-10T13:57:33.992360Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.996563Z", "completed_at": "2024-05-10T13:57:33.996563Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.12466645240783691, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.925174Z", "completed_at": "2024-05-10T13:57:33.993360Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.998068Z", "completed_at": "2024-05-10T13:57:33.998068Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.12666630744934082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:33.935936Z", "completed_at": "2024-05-10T13:57:33.994361Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:33.999308Z", "completed_at": "2024-05-10T13:57:33.999308Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.12666583061218262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.009327Z", "completed_at": "2024-05-10T13:57:34.053944Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.062945Z", "completed_at": "2024-05-10T13:57:34.062945Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05959916114807129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.021841Z", "completed_at": "2024-05-10T13:57:34.060926Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.064924Z", "completed_at": "2024-05-10T13:57:34.064924Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.061071157455444336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.031363Z", "completed_at": "2024-05-10T13:57:34.061926Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.066396Z", "completed_at": "2024-05-10T13:57:34.066396Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.062071800231933594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.041389Z", "completed_at": "2024-05-10T13:57:34.061926Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.066396Z", "completed_at": "2024-05-10T13:57:34.066396Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06234550476074219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.053944Z", "completed_at": "2024-05-10T13:57:34.063927Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.068397Z", "completed_at": "2024-05-10T13:57:34.068397Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06306838989257812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.075080Z", "completed_at": "2024-05-10T13:57:34.163154Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.244683Z", "completed_at": "2024-05-10T13:57:34.244683Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.1757678985595703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.116104Z", "completed_at": "2024-05-10T13:57:34.243699Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.248166Z", "completed_at": "2024-05-10T13:57:34.248166Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.17920804023742676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.163154Z", "completed_at": "2024-05-10T13:57:34.244683Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.250286Z", "completed_at": "2024-05-10T13:57:34.250286Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.17983555793762207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.204713Z", "completed_at": "2024-05-10T13:57:34.245681Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.250286Z", "completed_at": "2024-05-10T13:57:34.250286Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.17960000038146973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.211638Z", "completed_at": "2024-05-10T13:57:34.247164Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.252264Z", "completed_at": "2024-05-10T13:57:34.252264Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.13966584205627441, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.256689Z", "completed_at": "2024-05-10T13:57:34.278488Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.340709Z", "completed_at": "2024-05-10T13:57:34.341710Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09244632720947266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.278488Z", "completed_at": "2024-05-10T13:57:34.340709Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.345709Z", "completed_at": "2024-05-10T13:57:34.345709Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09152007102966309, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.296235Z", "completed_at": "2024-05-10T13:57:34.341710Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.346705Z", "completed_at": "2024-05-10T13:57:34.346705Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0745859146118164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.300853Z", "completed_at": "2024-05-10T13:57:34.343711Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.348209Z", "completed_at": "2024-05-10T13:57:34.348209Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07461428642272949, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.310861Z", "completed_at": "2024-05-10T13:57:34.344706Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.349866Z", "completed_at": "2024-05-10T13:57:34.349866Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07459664344787598, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.354052Z", "completed_at": "2024-05-10T13:57:34.363076Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.404097Z", "completed_at": "2024-05-10T13:57:34.404097Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05645918846130371, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.364581Z", "completed_at": "2024-05-10T13:57:34.399089Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.406720Z", "completed_at": "2024-05-10T13:57:34.406720Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.055938005447387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.388354Z", "completed_at": "2024-05-10T13:57:34.404683Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.407866Z", "completed_at": "2024-05-10T13:57:34.407866Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04997420310974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.394355Z", "completed_at": "2024-05-10T13:57:34.404683Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.410039Z", "completed_at": "2024-05-10T13:57:34.410039Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05000138282775879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.399089Z", "completed_at": "2024-05-10T13:57:34.406720Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.411025Z", "completed_at": "2024-05-10T13:57:34.411025Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04996967315673828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.415555Z", "completed_at": "2024-05-10T13:57:34.426886Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.442988Z", "completed_at": "2024-05-10T13:57:34.442988Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0351107120513916, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.423872Z", "completed_at": "2024-05-10T13:57:34.437400Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.446155Z", "completed_at": "2024-05-10T13:57:34.446155Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03411078453063965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.427870Z", "completed_at": "2024-05-10T13:57:34.443598Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.448661Z", "completed_at": "2024-05-10T13:57:34.448661Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.031126976013183594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.433395Z", "completed_at": "2024-05-10T13:57:34.444040Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.449692Z", "completed_at": "2024-05-10T13:57:34.449692Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031124591827392578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.437400Z", "completed_at": "2024-05-10T13:57:34.446155Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.450707Z", "completed_at": "2024-05-10T13:57:34.450707Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03084731101989746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.455704Z", "completed_at": "2024-05-10T13:57:34.462018Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.484667Z", "completed_at": "2024-05-10T13:57:34.484667Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03797507286071777, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.462018Z", "completed_at": "2024-05-10T13:57:34.483666Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.488667Z", "completed_at": "2024-05-10T13:57:34.488667Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03596234321594238, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.468570Z", "completed_at": "2024-05-10T13:57:34.485673Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.489666Z", "completed_at": "2024-05-10T13:57:34.489666Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03298521041870117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.474593Z", "completed_at": "2024-05-10T13:57:34.485673Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.489666Z", "completed_at": "2024-05-10T13:57:34.489666Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03296256065368652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.479629Z", "completed_at": "2024-05-10T13:57:34.486670Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.491686Z", "completed_at": "2024-05-10T13:57:34.491686Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03396201133728027, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.496667Z", "completed_at": "2024-05-10T13:57:34.504595Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.527899Z", "completed_at": "2024-05-10T13:57:34.527899Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.038213253021240234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.505854Z", "completed_at": "2024-05-10T13:57:34.526899Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.531404Z", "completed_at": "2024-05-10T13:57:34.531404Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03774595260620117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.511831Z", "completed_at": "2024-05-10T13:57:34.527899Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.533414Z", "completed_at": "2024-05-10T13:57:34.533414Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03389096260070801, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.518925Z", "completed_at": "2024-05-10T13:57:34.528899Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.533414Z", "completed_at": "2024-05-10T13:57:34.533414Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03363943099975586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.521916Z", "completed_at": "2024-05-10T13:57:34.529899Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.535688Z", "completed_at": "2024-05-10T13:57:34.535688Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03383517265319824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.539862Z", "completed_at": "2024-05-10T13:57:34.547864Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.571032Z", "completed_at": "2024-05-10T13:57:34.571032Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0392000675201416, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.548900Z", "completed_at": "2024-05-10T13:57:34.571032Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.576310Z", "completed_at": "2024-05-10T13:57:34.576310Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03995251655578613, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.553908Z", "completed_at": "2024-05-10T13:57:34.572304Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.577311Z", "completed_at": "2024-05-10T13:57:34.577311Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03646421432495117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.584893Z", "completed_at": "2024-05-10T13:57:34.602296Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.620690Z", "completed_at": "2024-05-10T13:57:34.620690Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04287219047546387, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.588910Z", "completed_at": "2024-05-10T13:57:34.610151Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.620690Z", "completed_at": "2024-05-10T13:57:34.620690Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04135465621948242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.603303Z", "completed_at": "2024-05-10T13:57:34.619690Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.623687Z", "completed_at": "2024-05-10T13:57:34.623687Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04178977012634277, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.610151Z", "completed_at": "2024-05-10T13:57:34.621688Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.625686Z", "completed_at": "2024-05-10T13:57:34.625686Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03877758979797363, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.635210Z", "completed_at": "2024-05-10T13:57:34.645208Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.652286Z", "completed_at": "2024-05-10T13:57:34.652286Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02857828140258789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.641209Z", "completed_at": "2024-05-10T13:57:34.651285Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.657284Z", "completed_at": "2024-05-10T13:57:34.657284Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02960038185119629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.646208Z", "completed_at": "2024-05-10T13:57:34.653284Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.658284Z", "completed_at": "2024-05-10T13:57:34.658284Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.024075031280517578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.659287Z", "completed_at": "2024-05-10T13:57:34.665834Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.672835Z", "completed_at": "2024-05-10T13:57:34.672835Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031026601791381836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.666834Z", "completed_at": "2024-05-10T13:57:34.672835Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.688296Z", "completed_at": "2024-05-10T13:57:34.688296Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.026992082595825195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.672835Z", "completed_at": "2024-05-10T13:57:34.687294Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.691294Z", "completed_at": "2024-05-10T13:57:34.691294Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.029475688934326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.679838Z", "completed_at": "2024-05-10T13:57:34.688296Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.692293Z", "completed_at": "2024-05-10T13:57:34.692293Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02744150161743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.692293Z", "completed_at": "2024-05-10T13:57:34.699806Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.704812Z", "completed_at": "2024-05-10T13:57:34.704812Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07471466064453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.700814Z", "completed_at": "2024-05-10T13:57:34.731444Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.928014Z", "completed_at": "2024-05-10T13:57:34.928014Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.23724031448364258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.705811Z", "completed_at": "2024-05-10T13:57:34.930023Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.941364Z", "completed_at": "2024-05-10T13:57:34.941364Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.24255681037902832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.936350Z", "completed_at": "2024-05-10T13:57:34.942363Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.946365Z", "completed_at": "2024-05-10T13:57:34.946365Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.018857955932617188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.951922Z", "completed_at": "2024-05-10T13:57:34.962036Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.965546Z", "completed_at": "2024-05-10T13:57:34.965546Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03115248680114746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.956909Z", "completed_at": "2024-05-10T13:57:34.963036Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.974562Z", "completed_at": "2024-05-10T13:57:34.974562Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03216052055358887, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.965546Z", "completed_at": "2024-05-10T13:57:34.978549Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:34.988370Z", "completed_at": "2024-05-10T13:57:34.988370Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029340028762817383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.980059Z", "completed_at": "2024-05-10T13:57:34.990380Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.008100Z", "completed_at": "2024-05-10T13:57:35.008100Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03518509864807129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.991376Z", "completed_at": "2024-05-10T13:57:35.009099Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.013070Z", "completed_at": "2024-05-10T13:57:35.013070Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03414011001586914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.015581Z", "completed_at": "2024-05-10T13:57:35.023846Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.032376Z", "completed_at": "2024-05-10T13:57:35.032376Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029690980911254883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.023846Z", "completed_at": "2024-05-10T13:57:35.032376Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.040874Z", "completed_at": "2024-05-10T13:57:35.040874Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02220892906188965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.033380Z", "completed_at": "2024-05-10T13:57:35.041851Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.045057Z", "completed_at": "2024-05-10T13:57:35.045057Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03483939170837402, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.045057Z", "completed_at": "2024-05-10T13:57:35.071706Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.074708Z", "completed_at": "2024-05-10T13:57:35.074708Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04279804229736328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.067706Z", "completed_at": "2024-05-10T13:57:35.074708Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.086279Z", "completed_at": "2024-05-10T13:57:35.086279Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04318404197692871, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.075707Z", "completed_at": "2024-05-10T13:57:35.088241Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.091243Z", "completed_at": "2024-05-10T13:57:35.091243Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02674102783203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.092241Z", "completed_at": "2024-05-10T13:57:35.101453Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.110467Z", "completed_at": "2024-05-10T13:57:35.110467Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025686264038085938, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.102477Z", "completed_at": "2024-05-10T13:57:35.110467Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.117012Z", "completed_at": "2024-05-10T13:57:35.117012Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025771379470825195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.127013Z", "completed_at": "2024-05-10T13:57:35.137715Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.139714Z", "completed_at": "2024-05-10T13:57:35.139714Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0157012939453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.130016Z", "completed_at": "2024-05-10T13:57:35.138717Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.141716Z", "completed_at": "2024-05-10T13:57:35.141716Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.035221099853515625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.142713Z", "completed_at": "2024-05-10T13:57:35.168747Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.177747Z", "completed_at": "2024-05-10T13:57:35.177747Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.045830488204956055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.171747Z", "completed_at": "2024-05-10T13:57:35.185544Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.190507Z", "completed_at": "2024-05-10T13:57:35.190507Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03220415115356445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.178752Z", "completed_at": "2024-05-10T13:57:35.187507Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.193511Z", "completed_at": "2024-05-10T13:57:35.193511Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.029267549514770508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.194527Z", "completed_at": "2024-05-10T13:57:35.203281Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.210296Z", "completed_at": "2024-05-10T13:57:35.210296Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02825927734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.205279Z", "completed_at": "2024-05-10T13:57:35.218679Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.222719Z", "completed_at": "2024-05-10T13:57:35.222719Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.020396709442138672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.210296Z", "completed_at": "2024-05-10T13:57:35.220681Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.223678Z", "completed_at": "2024-05-10T13:57:35.223678Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06835579872131348, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.224697Z", "completed_at": "2024-05-10T13:57:35.275686Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.282538Z", "completed_at": "2024-05-10T13:57:35.282538Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06629204750061035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.278245Z", "completed_at": "2024-05-10T13:57:35.289038Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.291996Z", "completed_at": "2024-05-10T13:57:35.291996Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.018372774124145508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.282538Z", "completed_at": "2024-05-10T13:57:35.289980Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.292978Z", "completed_at": "2024-05-10T13:57:35.292978Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.023039579391479492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.294210Z", "completed_at": "2024-05-10T13:57:35.301812Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.313814Z", "completed_at": "2024-05-10T13:57:35.313814Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.023830175399780273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.561930Z", "completed_at": "2024-05-10T13:57:35.171747Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.186525Z", "completed_at": "2024-05-10T13:57:35.186525Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.849829912185669, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.302813Z", "completed_at": "2024-05-10T13:57:35.316006Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.399203Z", "completed_at": "2024-05-10T13:57:35.399203Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.10073971748352051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.307834Z", "completed_at": "2024-05-10T13:57:35.396693Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.401208Z", "completed_at": "2024-05-10T13:57:35.401208Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.10675191879272461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.401553Z", "completed_at": "2024-05-10T13:57:35.413571Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.417079Z", "completed_at": "2024-05-10T13:57:35.417079Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029129981994628906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.408566Z", "completed_at": "2024-05-10T13:57:35.416075Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.428152Z", "completed_at": "2024-05-10T13:57:35.428152Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029412269592285156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.417079Z", "completed_at": "2024-05-10T13:57:35.428606Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.432698Z", "completed_at": "2024-05-10T13:57:35.432698Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025137901306152344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.422818Z", "completed_at": "2024-05-10T13:57:35.429621Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.433704Z", "completed_at": "2024-05-10T13:57:35.433704Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.025635957717895508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.433704Z", "completed_at": "2024-05-10T13:57:35.446703Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.450838Z", "completed_at": "2024-05-10T13:57:35.450838Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02800607681274414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.441703Z", "completed_at": "2024-05-10T13:57:35.450451Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.464645Z", "completed_at": "2024-05-10T13:57:35.464645Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03346109390258789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.451862Z", "completed_at": "2024-05-10T13:57:35.466159Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.469158Z", "completed_at": "2024-05-10T13:57:35.469158Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.027952194213867188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.459647Z", "completed_at": "2024-05-10T13:57:35.467163Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.475159Z", "completed_at": "2024-05-10T13:57:35.475159Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02794814109802246, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.470158Z", "completed_at": "2024-05-10T13:57:35.478159Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.485979Z", "completed_at": "2024-05-10T13:57:35.485979Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025870323181152344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.478936Z", "completed_at": "2024-05-10T13:57:35.485979Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.498327Z", "completed_at": "2024-05-10T13:57:35.498327Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029718637466430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.486980Z", "completed_at": "2024-05-10T13:57:35.499359Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.503041Z", "completed_at": "2024-05-10T13:57:35.503041Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.027953147888183594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.494060Z", "completed_at": "2024-05-10T13:57:35.500918Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.510689Z", "completed_at": "2024-05-10T13:57:35.510689Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.029947996139526367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.504137Z", "completed_at": "2024-05-10T13:57:35.517164Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.527177Z", "completed_at": "2024-05-10T13:57:35.527177Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.034667015075683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.517660Z", "completed_at": "2024-05-10T13:57:35.526176Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.541935Z", "completed_at": "2024-05-10T13:57:35.541935Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04035782814025879, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.528180Z", "completed_at": "2024-05-10T13:57:35.542919Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.546917Z", "completed_at": "2024-05-10T13:57:35.546917Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02768397331237793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.535898Z", "completed_at": "2024-05-10T13:57:35.544917Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.551883Z", "completed_at": "2024-05-10T13:57:35.551883Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.027729034423828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.547917Z", "completed_at": "2024-05-10T13:57:35.553905Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.574867Z", "completed_at": "2024-05-10T13:57:35.574867Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03697061538696289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.554905Z", "completed_at": "2024-05-10T13:57:35.574867Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.587921Z", "completed_at": "2024-05-10T13:57:35.587921Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0429835319519043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.575868Z", "completed_at": "2024-05-10T13:57:35.588902Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.592902Z", "completed_at": "2024-05-10T13:57:35.592902Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.027863025665283203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.581888Z", "completed_at": "2024-05-10T13:57:35.590901Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.600725Z", "completed_at": "2024-05-10T13:57:35.600725Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02985358238220215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.594157Z", "completed_at": "2024-05-10T13:57:35.604727Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.627332Z", "completed_at": "2024-05-10T13:57:35.627332Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.042943716049194336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.604727Z", "completed_at": "2024-05-10T13:57:35.626332Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.638093Z", "completed_at": "2024-05-10T13:57:35.638093Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04648876190185547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.628330Z", "completed_at": "2024-05-10T13:57:35.639116Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.645114Z", "completed_at": "2024-05-10T13:57:35.645114Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030228376388549805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.632844Z", "completed_at": "2024-05-10T13:57:35.641116Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.646114Z", "completed_at": "2024-05-10T13:57:35.646114Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0299835205078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.647116Z", "completed_at": "2024-05-10T13:57:35.662124Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.665659Z", "completed_at": "2024-05-10T13:57:35.665659Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.039582252502441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.656308Z", "completed_at": "2024-05-10T13:57:35.663148Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.681203Z", "completed_at": "2024-05-10T13:57:35.681203Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03709578514099121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.666657Z", "completed_at": "2024-05-10T13:57:35.682209Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.689215Z", "completed_at": "2024-05-10T13:57:35.689215Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.039583683013916016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.672660Z", "completed_at": "2024-05-10T13:57:35.684219Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.690217Z", "completed_at": "2024-05-10T13:57:35.690217Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.040583133697509766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.691217Z", "completed_at": "2024-05-10T13:57:35.709731Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.713772Z", "completed_at": "2024-05-10T13:57:35.713772Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.034641265869140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.705737Z", "completed_at": "2024-05-10T13:57:35.712732Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.722860Z", "completed_at": "2024-05-10T13:57:35.722860Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.035645246505737305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.714733Z", "completed_at": "2024-05-10T13:57:35.724860Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.728860Z", "completed_at": "2024-05-10T13:57:35.728860Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02464604377746582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.718860Z", "completed_at": "2024-05-10T13:57:35.725860Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.734378Z", "completed_at": "2024-05-10T13:57:35.734378Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02464604377746582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:34.996472Z", "completed_at": "2024-05-10T13:57:35.626332Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.638093Z", "completed_at": "2024-05-10T13:57:35.638093Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.7550075054168701, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.729860Z", "completed_at": "2024-05-10T13:57:35.737378Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.744377Z", "completed_at": "2024-05-10T13:57:35.744377Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.024034738540649414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.737378Z", "completed_at": "2024-05-10T13:57:35.744377Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.760902Z", "completed_at": "2024-05-10T13:57:35.760902Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03404116630554199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.746378Z", "completed_at": "2024-05-10T13:57:35.761901Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.770004Z", "completed_at": "2024-05-10T13:57:35.770004Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03363323211669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.750906Z", "completed_at": "2024-05-10T13:57:35.762901Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.771004Z", "completed_at": "2024-05-10T13:57:35.771004Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0336306095123291, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.764902Z", "completed_at": "2024-05-10T13:57:35.771004Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.785528Z", "completed_at": "2024-05-10T13:57:35.785528Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02962470054626465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.772004Z", "completed_at": "2024-05-10T13:57:35.784528Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.790528Z", "completed_at": "2024-05-10T13:57:35.790528Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03163313865661621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.778003Z", "completed_at": "2024-05-10T13:57:35.788528Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.805075Z", "completed_at": "2024-05-10T13:57:35.805075Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.039073944091796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.792528Z", "completed_at": "2024-05-10T13:57:35.808077Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.823606Z", "completed_at": "2024-05-10T13:57:35.823606Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0467376708984375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.796538Z", "completed_at": "2024-05-10T13:57:35.810074Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.825789Z", "completed_at": "2024-05-10T13:57:35.825789Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04874444007873535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.813072Z", "completed_at": "2024-05-10T13:57:35.834272Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.849098Z", "completed_at": "2024-05-10T13:57:35.849098Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04903268814086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.943764Z", "completed_at": "2024-05-10T13:57:35.951297Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:35.959317Z", "completed_at": "2024-05-10T13:57:35.959317Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0792856216430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.952322Z", "completed_at": "2024-05-10T13:57:35.959317Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.085268Z", "completed_at": "2024-05-10T13:57:36.085268Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.14450478553771973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:35.960303Z", "completed_at": "2024-05-10T13:57:36.038631Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.089258Z", "completed_at": "2024-05-10T13:57:36.089258Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.13996052742004395, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.004935Z", "completed_at": "2024-05-10T13:57:36.088259Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.093258Z", "completed_at": "2024-05-10T13:57:36.093258Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.1530146598815918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.014523Z", "completed_at": "2024-05-10T13:57:36.090258Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.110337Z", "completed_at": "2024-05-10T13:57:36.110337Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.154221773147583, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.093258Z", "completed_at": "2024-05-10T13:57:36.113539Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.132773Z", "completed_at": "2024-05-10T13:57:36.132773Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04751896858215332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.113539Z", "completed_at": "2024-05-10T13:57:36.131767Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.142082Z", "completed_at": "2024-05-10T13:57:36.142082Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05593991279602051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.127260Z", "completed_at": "2024-05-10T13:57:36.134779Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.149205Z", "completed_at": "2024-05-10T13:57:36.149205Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.038681745529174805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.135778Z", "completed_at": "2024-05-10T13:57:36.148199Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.153210Z", "completed_at": "2024-05-10T13:57:36.153210Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04853940010070801, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.142673Z", "completed_at": "2024-05-10T13:57:36.150210Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.173775Z", "completed_at": "2024-05-10T13:57:36.173775Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04500865936279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.154236Z", "completed_at": "2024-05-10T13:57:36.179796Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.187348Z", "completed_at": "2024-05-10T13:57:36.187348Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.040303945541381836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.176776Z", "completed_at": "2024-05-10T13:57:36.183344Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.195507Z", "completed_at": "2024-05-10T13:57:36.195507Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04830050468444824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.183344Z", "completed_at": "2024-05-10T13:57:36.189509Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.203117Z", "completed_at": "2024-05-10T13:57:36.203117Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030360937118530273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.190509Z", "completed_at": "2024-05-10T13:57:36.202032Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.207138Z", "completed_at": "2024-05-10T13:57:36.207138Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03079676628112793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.215646Z", "completed_at": "2024-05-10T13:57:36.229650Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.304895Z", "completed_at": "2024-05-10T13:57:36.304895Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.10073733329772949, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.225651Z", "completed_at": "2024-05-10T13:57:36.235166Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.306875Z", "completed_at": "2024-05-10T13:57:36.306875Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.16133666038513184, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.229650Z", "completed_at": "2024-05-10T13:57:36.254324Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.363958Z", "completed_at": "2024-05-10T13:57:36.363958Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.1618359088897705, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.237167Z", "completed_at": "2024-05-10T13:57:36.307873Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.378475Z", "completed_at": "2024-05-10T13:57:36.378475Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.15482687950134277, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.307873Z", "completed_at": "2024-05-10T13:57:36.377473Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.388509Z", "completed_at": "2024-05-10T13:57:36.388509Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.15734171867370605, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.381477Z", "completed_at": "2024-05-10T13:57:36.394535Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.399019Z", "completed_at": "2024-05-10T13:57:36.399019Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0365450382232666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.389508Z", "completed_at": "2024-05-10T13:57:36.396509Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.414527Z", "completed_at": "2024-05-10T13:57:36.414527Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04117107391357422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.400023Z", "completed_at": "2024-05-10T13:57:36.419622Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.422515Z", "completed_at": "2024-05-10T13:57:36.422515Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028981685638427734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.408050Z", "completed_at": "2024-05-10T13:57:36.421117Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.423517Z", "completed_at": "2024-05-10T13:57:36.423517Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030002832412719727, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.415533Z", "completed_at": "2024-05-10T13:57:36.421504Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.424540Z", "completed_at": "2024-05-10T13:57:36.424540Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.027502775192260742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.429031Z", "completed_at": "2024-05-10T13:57:36.438592Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.440565Z", "completed_at": "2024-05-10T13:57:36.440565Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.014052152633666992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.433566Z", "completed_at": "2024-05-10T13:57:36.439566Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.440565Z", "completed_at": "2024-05-10T13:57:36.440565Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.014072895050048828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.445567Z", "completed_at": "2024-05-10T13:57:36.487822Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.487822Z", "completed_at": "2024-05-10T13:57:36.487822Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04525423049926758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.466069Z", "completed_at": "2024-05-10T13:57:36.489903Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.492275Z", "completed_at": "2024-05-10T13:57:36.492275Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04869556427001953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.493280Z", "completed_at": "2024-05-10T13:57:36.503393Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.513471Z", "completed_at": "2024-05-10T13:57:36.513471Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0233614444732666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.504393Z", "completed_at": "2024-05-10T13:57:36.515992Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.518999Z", "completed_at": "2024-05-10T13:57:36.518999Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.029210805892944336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.519996Z", "completed_at": "2024-05-10T13:57:36.541493Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.544767Z", "completed_at": "2024-05-10T13:57:36.544767Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0445559024810791, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.525013Z", "completed_at": "2024-05-10T13:57:36.542479Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.545946Z", "completed_at": "2024-05-10T13:57:36.545946Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06117606163024902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.533473Z", "completed_at": "2024-05-10T13:57:36.543498Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.561553Z", "completed_at": "2024-05-10T13:57:36.561553Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06253671646118164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.546971Z", "completed_at": "2024-05-10T13:57:36.580533Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.585809Z", "completed_at": "2024-05-10T13:57:36.585809Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05908060073852539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.562550Z", "completed_at": "2024-05-10T13:57:36.582038Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.600577Z", "completed_at": "2024-05-10T13:57:36.600577Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06715822219848633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.586219Z", "completed_at": "2024-05-10T13:57:36.611766Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.622258Z", "completed_at": "2024-05-10T13:57:36.622258Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.042220115661621094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.602560Z", "completed_at": "2024-05-10T13:57:36.620257Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.625257Z", "completed_at": "2024-05-10T13:57:36.625257Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.09205484390258789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.611766Z", "completed_at": "2024-05-10T13:57:36.622258Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.673820Z", "completed_at": "2024-05-10T13:57:36.673820Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09203815460205078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.626287Z", "completed_at": "2024-05-10T13:57:36.678766Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.688684Z", "completed_at": "2024-05-10T13:57:36.688684Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.069427490234375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.633663Z", "completed_at": "2024-05-10T13:57:36.679766Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.689687Z", "completed_at": "2024-05-10T13:57:36.689687Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07342886924743652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.682277Z", "completed_at": "2024-05-10T13:57:36.694685Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.706208Z", "completed_at": "2024-05-10T13:57:36.706208Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03144049644470215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.691683Z", "completed_at": "2024-05-10T13:57:36.705211Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.710230Z", "completed_at": "2024-05-10T13:57:36.710230Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04547762870788574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.695704Z", "completed_at": "2024-05-10T13:57:36.706208Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.719729Z", "completed_at": "2024-05-10T13:57:36.719729Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04645109176635742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.711210Z", "completed_at": "2024-05-10T13:57:36.728728Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.743246Z", "completed_at": "2024-05-10T13:57:36.743246Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.041033029556274414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.720728Z", "completed_at": "2024-05-10T13:57:36.729728Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.744244Z", "completed_at": "2024-05-10T13:57:36.744244Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04356098175048828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.732237Z", "completed_at": "2024-05-10T13:57:36.745243Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.759124Z", "completed_at": "2024-05-10T13:57:36.759124Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.034380197525024414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.802712Z", "completed_at": "2024-05-10T13:57:36.813713Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.837453Z", "completed_at": "2024-05-10T13:57:36.837453Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.044241905212402344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.820795Z", "completed_at": "2024-05-10T13:57:36.841435Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.850161Z", "completed_at": "2024-05-10T13:57:36.850161Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.040450096130371094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.824796Z", "completed_at": "2024-05-10T13:57:36.841435Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.850161Z", "completed_at": "2024-05-10T13:57:36.850161Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0404658317565918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.845444Z", "completed_at": "2024-05-10T13:57:36.853182Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.867688Z", "completed_at": "2024-05-10T13:57:36.867688Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030248403549194336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.854165Z", "completed_at": "2024-05-10T13:57:36.867688Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.879684Z", "completed_at": "2024-05-10T13:57:36.879684Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03725624084472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.861162Z", "completed_at": "2024-05-10T13:57:36.869685Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.881188Z", "completed_at": "2024-05-10T13:57:36.881188Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.033544063568115234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.870686Z", "completed_at": "2024-05-10T13:57:36.882194Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.889705Z", "completed_at": "2024-05-10T13:57:36.889705Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03454780578613281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.874685Z", "completed_at": "2024-05-10T13:57:36.883732Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.890705Z", "completed_at": "2024-05-10T13:57:36.890705Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03454279899597168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.891706Z", "completed_at": "2024-05-10T13:57:36.903228Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.920811Z", "completed_at": "2024-05-10T13:57:36.920811Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05002641677856445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.903228Z", "completed_at": "2024-05-10T13:57:36.919814Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.937753Z", "completed_at": "2024-05-10T13:57:36.937753Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05104970932006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.911226Z", "completed_at": "2024-05-10T13:57:36.920811Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.938752Z", "completed_at": "2024-05-10T13:57:36.938752Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04353189468383789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.934761Z", "completed_at": "2024-05-10T13:57:36.941754Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.946754Z", "completed_at": "2024-05-10T13:57:36.946754Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.035477638244628906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.949267Z", "completed_at": "2024-05-10T13:57:36.963272Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.977786Z", "completed_at": "2024-05-10T13:57:36.977786Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04304361343383789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:36.956272Z", "completed_at": "2024-05-10T13:57:36.973787Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:36.985815Z", "completed_at": "2024-05-10T13:57:36.985815Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.043062448501586914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.001330Z", "completed_at": "2024-05-10T13:57:37.040363Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.070839Z", "completed_at": "2024-05-10T13:57:37.070839Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08102059364318848, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.005334Z", "completed_at": "2024-05-10T13:57:37.066839Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.072838Z", "completed_at": "2024-05-10T13:57:37.072838Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08102250099182129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.018848Z", "completed_at": "2024-05-10T13:57:37.068843Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.073840Z", "completed_at": "2024-05-10T13:57:37.073840Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.08102703094482422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.041365Z", "completed_at": "2024-05-10T13:57:37.069839Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.074840Z", "completed_at": "2024-05-10T13:57:37.074840Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09472846984863281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.076842Z", "completed_at": "2024-05-10T13:57:37.104087Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.120608Z", "completed_at": "2024-05-10T13:57:37.120608Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.10689187049865723, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.106087Z", "completed_at": "2024-05-10T13:57:37.120608Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.181236Z", "completed_at": "2024-05-10T13:57:37.181236Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08235359191894531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.111087Z", "completed_at": "2024-05-10T13:57:37.178731Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.185441Z", "completed_at": "2024-05-10T13:57:37.185441Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08437824249267578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.121612Z", "completed_at": "2024-05-10T13:57:37.179732Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.185441Z", "completed_at": "2024-05-10T13:57:37.185441Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0958709716796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.155109Z", "completed_at": "2024-05-10T13:57:37.181236Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.186443Z", "completed_at": "2024-05-10T13:57:37.186443Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09686827659606934, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.187466Z", "completed_at": "2024-05-10T13:57:37.203957Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.216465Z", "completed_at": "2024-05-10T13:57:37.216465Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.1157233715057373, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.206957Z", "completed_at": "2024-05-10T13:57:37.217469Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.338719Z", "completed_at": "2024-05-10T13:57:37.338719Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.14120697975158691, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.217469Z", "completed_at": "2024-05-10T13:57:37.339727Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.345173Z", "completed_at": "2024-05-10T13:57:37.345173Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.1816394329071045, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.303966Z", "completed_at": "2024-05-10T13:57:37.341321Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.384587Z", "completed_at": "2024-05-10T13:57:37.384587Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.17218589782714844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.246656Z", "completed_at": "2024-05-10T13:57:37.341771Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.385582Z", "completed_at": "2024-05-10T13:57:37.385582Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.18269944190979004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.345173Z", "completed_at": "2024-05-10T13:57:37.388660Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.488135Z", "completed_at": "2024-05-10T13:57:37.488135Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.15051555633544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.392659Z", "completed_at": "2024-05-10T13:57:37.490231Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.662438Z", "completed_at": "2024-05-10T13:57:37.662438Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.2793698310852051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.491805Z", "completed_at": "2024-05-10T13:57:37.661438Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.666964Z", "completed_at": "2024-05-10T13:57:37.666964Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.26794958114624023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.552130Z", "completed_at": "2024-05-10T13:57:37.662438Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.668972Z", "completed_at": "2024-05-10T13:57:37.668972Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.23700189590454102, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.608269Z", "completed_at": "2024-05-10T13:57:37.663442Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.720562Z", "completed_at": "2024-05-10T13:57:37.720562Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.23847532272338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.668972Z", "completed_at": "2024-05-10T13:57:37.726558Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.739637Z", "completed_at": "2024-05-10T13:57:37.739637Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08975625038146973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.730556Z", "completed_at": "2024-05-10T13:57:37.740637Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.771723Z", "completed_at": "2024-05-10T13:57:37.771723Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.052164316177368164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.741637Z", "completed_at": "2024-05-10T13:57:37.769722Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.776725Z", "completed_at": "2024-05-10T13:57:37.776725Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05511975288391113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.754194Z", "completed_at": "2024-05-10T13:57:37.770724Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.777726Z", "completed_at": "2024-05-10T13:57:37.777726Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.049097537994384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.761195Z", "completed_at": "2024-05-10T13:57:37.772772Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.778724Z", "completed_at": "2024-05-10T13:57:37.778724Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.050112247467041016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.779724Z", "completed_at": "2024-05-10T13:57:37.790751Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.801272Z", "completed_at": "2024-05-10T13:57:37.801272Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04501938819885254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.793755Z", "completed_at": "2024-05-10T13:57:37.808317Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.838495Z", "completed_at": "2024-05-10T13:57:37.838495Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05468392372131348, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.804276Z", "completed_at": "2024-05-10T13:57:37.835462Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.843461Z", "completed_at": "2024-05-10T13:57:37.843461Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.054709672927856445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.809273Z", "completed_at": "2024-05-10T13:57:37.837457Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.844456Z", "completed_at": "2024-05-10T13:57:37.844456Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06023097038269043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.818795Z", "completed_at": "2024-05-10T13:57:37.838495Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.845455Z", "completed_at": "2024-05-10T13:57:37.845455Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05571579933166504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.846460Z", "completed_at": "2024-05-10T13:57:37.856984Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.871078Z", "completed_at": "2024-05-10T13:57:37.871078Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06022381782531738, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.859985Z", "completed_at": "2024-05-10T13:57:37.872056Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.917720Z", "completed_at": "2024-05-10T13:57:37.917720Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06773877143859863, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.873059Z", "completed_at": "2024-05-10T13:57:37.915713Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.922719Z", "completed_at": "2024-05-10T13:57:37.922719Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07833266258239746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.878057Z", "completed_at": "2024-05-10T13:57:37.916722Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.923740Z", "completed_at": "2024-05-10T13:57:37.923740Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.07930231094360352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.901657Z", "completed_at": "2024-05-10T13:57:37.918719Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.936280Z", "completed_at": "2024-05-10T13:57:37.936280Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07122945785522461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.924720Z", "completed_at": "2024-05-10T13:57:37.941278Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:37.959841Z", "completed_at": "2024-05-10T13:57:37.959841Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04411578178405762, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.946281Z", "completed_at": "2024-05-10T13:57:38.112722Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.124245Z", "completed_at": "2024-05-10T13:57:38.124245Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.188920259475708, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.092180Z", "completed_at": "2024-05-10T13:57:38.119199Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.126174Z", "completed_at": "2024-05-10T13:57:38.126174Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.18939948081970215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:37.963839Z", "completed_at": "2024-05-10T13:57:38.121174Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.128170Z", "completed_at": "2024-05-10T13:57:38.128170Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.19343113899230957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.113643Z", "completed_at": "2024-05-10T13:57:38.123203Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.135773Z", "completed_at": "2024-05-10T13:57:38.135773Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.18086028099060059, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.129247Z", "completed_at": "2024-05-10T13:57:38.141701Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.150223Z", "completed_at": "2024-05-10T13:57:38.150223Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.13127923011779785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.151224Z", "completed_at": "2024-05-10T13:57:38.298321Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.348063Z", "completed_at": "2024-05-10T13:57:38.348063Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.20939302444458008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.211954Z", "completed_at": "2024-05-10T13:57:38.344006Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.350079Z", "completed_at": "2024-05-10T13:57:38.350079Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.27011823654174805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.253640Z", "completed_at": "2024-05-10T13:57:38.345556Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.352082Z", "completed_at": "2024-05-10T13:57:38.352082Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.26976895332336426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.299402Z", "completed_at": "2024-05-10T13:57:38.349071Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.417480Z", "completed_at": "2024-05-10T13:57:38.417480Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.2722628116607666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.353148Z", "completed_at": "2024-05-10T13:57:38.419480Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.462781Z", "completed_at": "2024-05-10T13:57:38.462781Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.17374348640441895, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.425479Z", "completed_at": "2024-05-10T13:57:38.521380Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.635925Z", "completed_at": "2024-05-10T13:57:38.635925Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.2194509506225586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.465390Z", "completed_at": "2024-05-10T13:57:38.572778Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.639013Z", "completed_at": "2024-05-10T13:57:38.639013Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.24733328819274902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.522311Z", "completed_at": "2024-05-10T13:57:38.607328Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.666805Z", "completed_at": "2024-05-10T13:57:38.666805Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.2473306655883789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.574100Z", "completed_at": "2024-05-10T13:57:38.640112Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.673672Z", "completed_at": "2024-05-10T13:57:38.673672Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.21180367469787598, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.640587Z", "completed_at": "2024-05-10T13:57:38.672561Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.684578Z", "completed_at": "2024-05-10T13:57:38.684578Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08849072456359863, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.677679Z", "completed_at": "2024-05-10T13:57:38.695861Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.706144Z", "completed_at": "2024-05-10T13:57:38.706144Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04100775718688965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.686575Z", "completed_at": "2024-05-10T13:57:38.703185Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.711147Z", "completed_at": "2024-05-10T13:57:38.711147Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.048897743225097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.696504Z", "completed_at": "2024-05-10T13:57:38.706144Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.722880Z", "completed_at": "2024-05-10T13:57:38.722880Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04998373985290527, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.707147Z", "completed_at": "2024-05-10T13:57:38.722205Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.727691Z", "completed_at": "2024-05-10T13:57:38.727691Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.034157514572143555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.713609Z", "completed_at": "2024-05-10T13:57:38.725700Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.731691Z", "completed_at": "2024-05-10T13:57:38.731691Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03371787071228027, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.732852Z", "completed_at": "2024-05-10T13:57:38.744861Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.763468Z", "completed_at": "2024-05-10T13:57:38.763468Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04431605339050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.739860Z", "completed_at": "2024-05-10T13:57:38.752986Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.764981Z", "completed_at": "2024-05-10T13:57:38.764981Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04332756996154785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.745939Z", "completed_at": "2024-05-10T13:57:38.761985Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.774006Z", "completed_at": "2024-05-10T13:57:38.774006Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04631519317626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.754986Z", "completed_at": "2024-05-10T13:57:38.765999Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.779008Z", "completed_at": "2024-05-10T13:57:38.779008Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03866124153137207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.767004Z", "completed_at": "2024-05-10T13:57:38.777006Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.784035Z", "completed_at": "2024-05-10T13:57:38.784035Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04105806350708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.786044Z", "completed_at": "2024-05-10T13:57:38.798097Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.812107Z", "completed_at": "2024-05-10T13:57:38.812107Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04464244842529297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.791043Z", "completed_at": "2024-05-10T13:57:38.804260Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.812107Z", "completed_at": "2024-05-10T13:57:38.812107Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04464292526245117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.800077Z", "completed_at": "2024-05-10T13:57:38.811084Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.825655Z", "completed_at": "2024-05-10T13:57:38.825655Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04360651969909668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.806272Z", "completed_at": "2024-05-10T13:57:38.822724Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.828650Z", "completed_at": "2024-05-10T13:57:38.828650Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.034514665603637695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.813110Z", "completed_at": "2024-05-10T13:57:38.827650Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.832717Z", "completed_at": "2024-05-10T13:57:38.832717Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04145383834838867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.834722Z", "completed_at": "2024-05-10T13:57:38.862268Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.886192Z", "completed_at": "2024-05-10T13:57:38.886192Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06507205963134766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.848251Z", "completed_at": "2024-05-10T13:57:38.872873Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.887271Z", "completed_at": "2024-05-10T13:57:38.887271Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06502294540405273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.863155Z", "completed_at": "2024-05-10T13:57:38.885273Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.896585Z", "completed_at": "2024-05-10T13:57:38.896585Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06638360023498535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.874901Z", "completed_at": "2024-05-10T13:57:38.888095Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.900105Z", "completed_at": "2024-05-10T13:57:38.900105Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04283785820007324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.888095Z", "completed_at": "2024-05-10T13:57:38.898093Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:38.904126Z", "completed_at": "2024-05-10T13:57:38.904126Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04429125785827637, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.906105Z", "completed_at": "2024-05-10T13:57:38.931664Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.055590Z", "completed_at": "2024-05-10T13:57:39.055590Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.16351866722106934, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.919114Z", "completed_at": "2024-05-10T13:57:38.942717Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.056097Z", "completed_at": "2024-05-10T13:57:39.056097Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.16401076316833496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.931664Z", "completed_at": "2024-05-10T13:57:38.964892Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.067137Z", "completed_at": "2024-05-10T13:57:39.067137Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.16504955291748047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:38.945702Z", "completed_at": "2024-05-10T13:57:39.065608Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.072176Z", "completed_at": "2024-05-10T13:57:39.072176Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.14600729942321777, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.057605Z", "completed_at": "2024-05-10T13:57:39.068149Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.074146Z", "completed_at": "2024-05-10T13:57:39.074146Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.13907670974731445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.076143Z", "completed_at": "2024-05-10T13:57:39.094196Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.110724Z", "completed_at": "2024-05-10T13:57:39.110724Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04632425308227539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.085287Z", "completed_at": "2024-05-10T13:57:39.102726Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.116324Z", "completed_at": "2024-05-10T13:57:39.116324Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04730081558227539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.094196Z", "completed_at": "2024-05-10T13:57:39.105725Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.120337Z", "completed_at": "2024-05-10T13:57:39.120337Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04719996452331543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.105725Z", "completed_at": "2024-05-10T13:57:39.118551Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.124360Z", "completed_at": "2024-05-10T13:57:39.124360Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03404569625854492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.111805Z", "completed_at": "2024-05-10T13:57:39.120337Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.125342Z", "completed_at": "2024-05-10T13:57:39.125342Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025633811950683594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.130367Z", "completed_at": "2024-05-10T13:57:39.157130Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.171721Z", "completed_at": "2024-05-10T13:57:39.171721Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05335688591003418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.158137Z", "completed_at": "2024-05-10T13:57:39.169720Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.178661Z", "completed_at": "2024-05-10T13:57:39.178661Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.051459312438964844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.163135Z", "completed_at": "2024-05-10T13:57:39.177716Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.182333Z", "completed_at": "2024-05-10T13:57:39.182333Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.029265642166137695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.172718Z", "completed_at": "2024-05-10T13:57:39.179813Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.183840Z", "completed_at": "2024-05-10T13:57:39.183840Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.032720327377319336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.185847Z", "completed_at": "2024-05-10T13:57:39.193169Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.276698Z", "completed_at": "2024-05-10T13:57:39.276698Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.13541340827941895, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.193169Z", "completed_at": "2024-05-10T13:57:39.243746Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.317737Z", "completed_at": "2024-05-10T13:57:39.317737Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.13589048385620117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.231651Z", "completed_at": "2024-05-10T13:57:39.316738Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.322740Z", "completed_at": "2024-05-10T13:57:39.322740Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.133209228515625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.277698Z", "completed_at": "2024-05-10T13:57:39.318737Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.323740Z", "completed_at": "2024-05-10T13:57:39.323740Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.09763336181640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.327740Z", "completed_at": "2024-05-10T13:57:39.399660Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.424188Z", "completed_at": "2024-05-10T13:57:39.424188Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11393356323242188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.370765Z", "completed_at": "2024-05-10T13:57:39.423187Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.436672Z", "completed_at": "2024-05-10T13:57:39.436672Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.11389446258544922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.417188Z", "completed_at": "2024-05-10T13:57:39.435670Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.441713Z", "completed_at": "2024-05-10T13:57:39.441713Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07286500930786133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.424188Z", "completed_at": "2024-05-10T13:57:39.437677Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.442632Z", "completed_at": "2024-05-10T13:57:39.442632Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03196406364440918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__list"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.445630Z", "completed_at": "2024-05-10T13:57:39.468667Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.479667Z", "completed_at": "2024-05-10T13:57:39.479667Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05889558792114258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.459143Z", "completed_at": "2024-05-10T13:57:39.470667Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.500615Z", "completed_at": "2024-05-10T13:57:39.500615Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.058306217193603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.471667Z", "completed_at": "2024-05-10T13:57:39.501315Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.506843Z", "completed_at": "2024-05-10T13:57:39.506843Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.042188167572021484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.481282Z", "completed_at": "2024-05-10T13:57:39.504010Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.507910Z", "completed_at": "2024-05-10T13:57:39.507910Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04895639419555664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.509854Z", "completed_at": "2024-05-10T13:57:39.520157Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.536642Z", "completed_at": "2024-05-10T13:57:39.536642Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03926348686218262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.521124Z", "completed_at": "2024-05-10T13:57:39.537643Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.546759Z", "completed_at": "2024-05-10T13:57:39.546759Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.040505409240722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.538643Z", "completed_at": "2024-05-10T13:57:39.547863Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.550420Z", "completed_at": "2024-05-10T13:57:39.550420Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.026302099227905273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.551438Z", "completed_at": "2024-05-10T13:57:39.556457Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.557442Z", "completed_at": "2024-05-10T13:57:39.557442Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.010053873062133789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:39.134454Z", "completed_at": "2024-05-10T13:57:39.975971Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:39.975971Z", "completed_at": "2024-05-10T13:57:39.976953Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.9607236385345459, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:40.092343Z", "completed_at": "2024-05-10T13:57:40.100994Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:40.102955Z", "completed_at": "2024-05-10T13:57:40.102955Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.013915777206420898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-10T13:57:40.096438Z", "completed_at": "2024-05-10T13:57:40.101972Z"}, {"name": "execute", "started_at": "2024-05-10T13:57:40.103954Z", "completed_at": "2024-05-10T13:57:40.103954Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.014124155044555664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}], "elapsed_time": 11.0877366065979, "args": {"populate_cache": true, "write_json": true, "use_colors_file": true, "cache_selected_only": false, "partial_parse": true, "static_parser": true, "enable_legacy_logger": false, "quiet": false, "profiles_dir": "C:\\Users\\thuxuan\\PycharmProjects", "log_level_file": "debug", "log_format_file": "debug", "select": [], "vars": {}, "macro_debugging": false, "print": true, "which": "generate", "log_format": "default", "log_level": "info", "use_colors": true, "log_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate\\..\\logs", "warn_error_options": {"include": [], "exclude": []}, "printer_width": 80, "defer": false, "strict_mode": false, "indirect_selection": "eager", "compile": true, "exclude": [], "project_dir": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "introspect": true, "version_check": true, "send_anonymous_usage_stats": true, "favor_state": false}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.5.0", "generated_at": "2024-05-16T18:33:12.615831Z", "invocation_id": "fb3eb4b0-505e-4191-84ff-ade431f461ad", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.101409Z", "completed_at": "2024-05-16T18:33:05.207003Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.211150Z", "completed_at": "2024-05-16T18:33:05.211150Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.11649298667907715, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.111499Z", "completed_at": "2024-05-16T18:33:05.208142Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.212147Z", "completed_at": "2024-05-16T18:33:05.212147Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11799407005310059, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.192729Z", "completed_at": "2024-05-16T18:33:05.209148Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.212147Z", "completed_at": "2024-05-16T18:33:05.212147Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.11599421501159668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.172949Z", "completed_at": "2024-05-16T18:33:05.209148Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.213383Z", "completed_at": "2024-05-16T18:33:05.213383Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.11800861358642578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.200743Z", "completed_at": "2024-05-16T18:33:05.210149Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.214431Z", "completed_at": "2024-05-16T18:33:05.214431Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.11851263046264648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.223412Z", "completed_at": "2024-05-16T18:33:05.261103Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.265633Z", "completed_at": "2024-05-16T18:33:05.265633Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0482182502746582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.230428Z", "completed_at": "2024-05-16T18:33:05.261805Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.266633Z", "completed_at": "2024-05-16T18:33:05.266633Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0483250617980957, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.236014Z", "completed_at": "2024-05-16T18:33:05.262542Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.266633Z", "completed_at": "2024-05-16T18:33:05.266633Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04932975769042969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.240000Z", "completed_at": "2024-05-16T18:33:05.262542Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.267630Z", "completed_at": "2024-05-16T18:33:05.267630Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04932832717895508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.246001Z", "completed_at": "2024-05-16T18:33:05.264106Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.268737Z", "completed_at": "2024-05-16T18:33:05.268737Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04933452606201172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.278780Z", "completed_at": "2024-05-16T18:33:05.280780Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.288321Z", "completed_at": "2024-05-16T18:33:05.288321Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0165865421295166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.eligibility_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.281782Z", "completed_at": "2024-05-16T18:33:05.282781Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.289329Z", "completed_at": "2024-05-16T18:33:05.289329Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.017551898956298828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.lab_result_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.282781Z", "completed_at": "2024-05-16T18:33:05.284305Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.289329Z", "completed_at": "2024-05-16T18:33:05.289329Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016546964645385742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.medical_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.284305Z", "completed_at": "2024-05-16T18:33:05.285313Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.290328Z", "completed_at": "2024-05-16T18:33:05.290328Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.017548084259033203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.observation_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.286319Z", "completed_at": "2024-05-16T18:33:05.287322Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.291327Z", "completed_at": "2024-05-16T18:33:05.291327Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01754474639892578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.302016Z", "completed_at": "2024-05-16T18:33:05.303035Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.312586Z", "completed_at": "2024-05-16T18:33:05.312586Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01678180694580078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.304038Z", "completed_at": "2024-05-16T18:33:05.305103Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.312586Z", "completed_at": "2024-05-16T18:33:05.312586Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01677703857421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.306103Z", "completed_at": "2024-05-16T18:33:05.308026Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.313583Z", "completed_at": "2024-05-16T18:33:05.313583Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016777515411376953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.308026Z", "completed_at": "2024-05-16T18:33:05.309131Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.314250Z", "completed_at": "2024-05-16T18:33:05.314250Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016777515411376953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.310188Z", "completed_at": "2024-05-16T18:33:05.310188Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.314627Z", "completed_at": "2024-05-16T18:33:05.314627Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01678156852722168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.324057Z", "completed_at": "2024-05-16T18:33:05.325055Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.332163Z", "completed_at": "2024-05-16T18:33:05.333178Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014122724533081055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.clinical_concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.326054Z", "completed_at": "2024-05-16T18:33:05.327055Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.333178Z", "completed_at": "2024-05-16T18:33:05.333178Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.014570474624633789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.327055Z", "completed_at": "2024-05-16T18:33:05.328088Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.334179Z", "completed_at": "2024-05-16T18:33:05.334179Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015575408935546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.329062Z", "completed_at": "2024-05-16T18:33:05.329062Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.334179Z", "completed_at": "2024-05-16T18:33:05.334179Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015573740005493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.330058Z", "completed_at": "2024-05-16T18:33:05.331057Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.335625Z", "completed_at": "2024-05-16T18:33:05.335625Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015574216842651367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.343805Z", "completed_at": "2024-05-16T18:33:05.346821Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.354433Z", "completed_at": "2024-05-16T18:33:05.354433Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01680302619934082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.346821Z", "completed_at": "2024-05-16T18:33:05.347806Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.354433Z", "completed_at": "2024-05-16T18:33:05.354433Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016478776931762695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.348821Z", "completed_at": "2024-05-16T18:33:05.349809Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.355452Z", "completed_at": "2024-05-16T18:33:05.355452Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016478776931762695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.349809Z", "completed_at": "2024-05-16T18:33:05.350829Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.355452Z", "completed_at": "2024-05-16T18:33:05.355452Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01617574691772461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.350829Z", "completed_at": "2024-05-16T18:33:05.352277Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.356432Z", "completed_at": "2024-05-16T18:33:05.356432Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016450881958007812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.364753Z", "completed_at": "2024-05-16T18:33:05.365754Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.374810Z", "completed_at": "2024-05-16T18:33:05.374810Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015561580657958984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.367258Z", "completed_at": "2024-05-16T18:33:05.368263Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.374810Z", "completed_at": "2024-05-16T18:33:05.374810Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015561103820800781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.coding_systems"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.368791Z", "completed_at": "2024-05-16T18:33:05.369814Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.375823Z", "completed_at": "2024-05-16T18:33:05.375823Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015561103820800781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.data_quality__test_catalog"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.370811Z", "completed_at": "2024-05-16T18:33:05.371839Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.375823Z", "completed_at": "2024-05-16T18:33:05.375823Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015572071075439453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.371839Z", "completed_at": "2024-05-16T18:33:05.372811Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.376814Z", "completed_at": "2024-05-16T18:33:05.376814Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01607346534729004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.385322Z", "completed_at": "2024-05-16T18:33:05.386329Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.393918Z", "completed_at": "2024-05-16T18:33:05.393918Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014108896255493164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.387494Z", "completed_at": "2024-05-16T18:33:05.388535Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.394917Z", "completed_at": "2024-05-16T18:33:05.394917Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.014104843139648438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.388535Z", "completed_at": "2024-05-16T18:33:05.389508Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.394917Z", "completed_at": "2024-05-16T18:33:05.394917Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015104532241821289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__clinical_concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.390506Z", "completed_at": "2024-05-16T18:33:05.391527Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.395919Z", "completed_at": "2024-05-16T18:33:05.395919Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016106128692626953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__hcc_descriptions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.391903Z", "completed_at": "2024-05-16T18:33:05.392936Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.396917Z", "completed_at": "2024-05-16T18:33:05.396917Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015598297119140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.hcc_suspecting__icd_10_cm_mappings"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.405180Z", "completed_at": "2024-05-16T18:33:05.407203Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.415181Z", "completed_at": "2024-05-16T18:33:05.415181Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01626276969909668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.pqi__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.408180Z", "completed_at": "2024-05-16T18:33:05.409199Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.415181Z", "completed_at": "2024-05-16T18:33:05.415181Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015516042709350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.pqi__value_sets"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.409199Z", "completed_at": "2024-05-16T18:33:05.410181Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.416180Z", "completed_at": "2024-05-16T18:33:05.416180Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016543865203857422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.411179Z", "completed_at": "2024-05-16T18:33:05.411179Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.416180Z", "completed_at": "2024-05-16T18:33:05.416180Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016314029693603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.412199Z", "completed_at": "2024-05-16T18:33:05.413202Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.417682Z", "completed_at": "2024-05-16T18:33:05.417682Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016026973724365234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.426468Z", "completed_at": "2024-05-16T18:33:05.427472Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.436001Z", "completed_at": "2024-05-16T18:33:05.436001Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.015770435333251953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.428468Z", "completed_at": "2024-05-16T18:33:05.429496Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.436001Z", "completed_at": "2024-05-16T18:33:05.436001Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015980958938598633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.429496Z", "completed_at": "2024-05-16T18:33:05.431468Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.437001Z", "completed_at": "2024-05-16T18:33:05.437001Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.014975309371948242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.431468Z", "completed_at": "2024-05-16T18:33:05.432468Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.437001Z", "completed_at": "2024-05-16T18:33:05.437001Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.015575170516967773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.432468Z", "completed_at": "2024-05-16T18:33:05.433972Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.438003Z", "completed_at": "2024-05-16T18:33:05.438003Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016552209854125977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.446963Z", "completed_at": "2024-05-16T18:33:05.447982Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.455636Z", "completed_at": "2024-05-16T18:33:05.455636Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014685392379760742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.448964Z", "completed_at": "2024-05-16T18:33:05.449992Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.456636Z", "completed_at": "2024-05-16T18:33:05.456636Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01666998863220215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.449992Z", "completed_at": "2024-05-16T18:33:05.450965Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.456636Z", "completed_at": "2024-05-16T18:33:05.456636Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015672922134399414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.452123Z", "completed_at": "2024-05-16T18:33:05.453124Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.457650Z", "completed_at": "2024-05-16T18:33:05.457650Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01566910743713379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.453630Z", "completed_at": "2024-05-16T18:33:05.454638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.458635Z", "completed_at": "2024-05-16T18:33:05.458635Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016668319702148438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.467395Z", "completed_at": "2024-05-16T18:33:05.470424Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.477406Z", "completed_at": "2024-05-16T18:33:05.478403Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016772031784057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.471405Z", "completed_at": "2024-05-16T18:33:05.471405Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.478403Z", "completed_at": "2024-05-16T18:33:05.478403Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01695537567138672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.472421Z", "completed_at": "2024-05-16T18:33:05.473405Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.479410Z", "completed_at": "2024-05-16T18:33:05.479410Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017507314682006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.473405Z", "completed_at": "2024-05-16T18:33:05.474403Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.479410Z", "completed_at": "2024-05-16T18:33:05.479410Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016779184341430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.475403Z", "completed_at": "2024-05-16T18:33:05.476427Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.480406Z", "completed_at": "2024-05-16T18:33:05.480406Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016779184341430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.489174Z", "completed_at": "2024-05-16T18:33:05.490179Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.499174Z", "completed_at": "2024-05-16T18:33:05.499174Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016513586044311523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.491178Z", "completed_at": "2024-05-16T18:33:05.492199Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.499174Z", "completed_at": "2024-05-16T18:33:05.499174Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016514301300048828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.493174Z", "completed_at": "2024-05-16T18:33:05.494175Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.499174Z", "completed_at": "2024-05-16T18:33:05.499174Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017514705657958984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__calendar"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.495175Z", "completed_at": "2024-05-16T18:33:05.496194Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.500678Z", "completed_at": "2024-05-16T18:33:05.500678Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016513824462890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.497178Z", "completed_at": "2024-05-16T18:33:05.497178Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.501684Z", "completed_at": "2024-05-16T18:33:05.501684Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01653313636779785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__code_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.510687Z", "completed_at": "2024-05-16T18:33:05.511713Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.519195Z", "completed_at": "2024-05-16T18:33:05.519195Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014510631561279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.512688Z", "completed_at": "2024-05-16T18:33:05.513708Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.520199Z", "completed_at": "2024-05-16T18:33:05.520199Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015514135360717773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.513708Z", "completed_at": "2024-05-16T18:33:05.514689Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.520199Z", "completed_at": "2024-05-16T18:33:05.520199Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015514135360717773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.515689Z", "completed_at": "2024-05-16T18:33:05.515689Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.521199Z", "completed_at": "2024-05-16T18:33:05.521199Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01553034782409668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.517192Z", "completed_at": "2024-05-16T18:33:05.518198Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.522200Z", "completed_at": "2024-05-16T18:33:05.522200Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.01629161834716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.530996Z", "completed_at": "2024-05-16T18:33:05.533012Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.541244Z", "completed_at": "2024-05-16T18:33:05.541244Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01616501808166504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.534011Z", "completed_at": "2024-05-16T18:33:05.535236Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.541244Z", "completed_at": "2024-05-16T18:33:05.541244Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016284465789794922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.535236Z", "completed_at": "2024-05-16T18:33:05.536243Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.542241Z", "completed_at": "2024-05-16T18:33:05.542241Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.017298221588134766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.537243Z", "completed_at": "2024-05-16T18:33:05.538261Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.542778Z", "completed_at": "2024-05-16T18:33:05.542778Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016298294067382812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.538261Z", "completed_at": "2024-05-16T18:33:05.539241Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.543890Z", "completed_at": "2024-05-16T18:33:05.543890Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.017301082611083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.551804Z", "completed_at": "2024-05-16T18:33:05.553308Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.561314Z", "completed_at": "2024-05-16T18:33:05.561314Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01502227783203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__loinc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.554313Z", "completed_at": "2024-05-16T18:33:05.555313Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.562315Z", "completed_at": "2024-05-16T18:33:05.562315Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01557159423828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.555313Z", "completed_at": "2024-05-16T18:33:05.557315Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.562315Z", "completed_at": "2024-05-16T18:33:05.562315Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.01628279685974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__mdc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.557315Z", "completed_at": "2024-05-16T18:33:05.558313Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.563316Z", "completed_at": "2024-05-16T18:33:05.563316Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01628279685974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.559330Z", "completed_at": "2024-05-16T18:33:05.560334Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.564497Z", "completed_at": "2024-05-16T18:33:05.564497Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015790939331054688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.573006Z", "completed_at": "2024-05-16T18:33:05.574009Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.581005Z", "completed_at": "2024-05-16T18:33:05.581005Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.014302253723144531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.575006Z", "completed_at": "2024-05-16T18:33:05.576009Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.582009Z", "completed_at": "2024-05-16T18:33:05.582009Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.01432180404663086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.576009Z", "completed_at": "2024-05-16T18:33:05.577026Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.582009Z", "completed_at": "2024-05-16T18:33:05.582009Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.015434503555297852, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ndc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.577026Z", "completed_at": "2024-05-16T18:33:05.578006Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.583005Z", "completed_at": "2024-05-16T18:33:05.583005Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.014155387878417969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.579006Z", "completed_at": "2024-05-16T18:33:05.580006Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.584029Z", "completed_at": "2024-05-16T18:33:05.584029Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.015167951583862305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.591819Z", "completed_at": "2024-05-16T18:33:05.593835Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.600999Z", "completed_at": "2024-05-16T18:33:05.600999Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.01551198959350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.594835Z", "completed_at": "2024-05-16T18:33:05.595841Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.602443Z", "completed_at": "2024-05-16T18:33:05.602443Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.015558481216430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.595841Z", "completed_at": "2024-05-16T18:33:05.596820Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.602443Z", "completed_at": "2024-05-16T18:33:05.602443Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016556978225708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__provider"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.597979Z", "completed_at": "2024-05-16T18:33:05.597979Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.603666Z", "completed_at": "2024-05-16T18:33:05.603666Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016346454620361328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__race"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.599000Z", "completed_at": "2024-05-16T18:33:05.599998Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.604713Z", "completed_at": "2024-05-16T18:33:05.604713Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.016896486282348633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.612687Z", "completed_at": "2024-05-16T18:33:05.614702Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.623199Z", "completed_at": "2024-05-16T18:33:05.623199Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.016294479370117188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__rxnorm_to_atc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.614702Z", "completed_at": "2024-05-16T18:33:05.615686Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.623199Z", "completed_at": "2024-05-16T18:33:05.623199Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.016478538513183594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__snomed_ct"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.615686Z", "completed_at": "2024-05-16T18:33:05.618195Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.624224Z", "completed_at": "2024-05-16T18:33:05.624224Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.016499042510986328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__snomed_ct_transitive_closures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.619194Z", "completed_at": "2024-05-16T18:33:05.620218Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.624594Z", "completed_at": "2024-05-16T18:33:05.624594Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.016499042510986328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__snomed_icd_10_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.620218Z", "completed_at": "2024-05-16T18:33:05.621199Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.625752Z", "completed_at": "2024-05-16T18:33:05.625752Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0164794921875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.634407Z", "completed_at": "2024-05-16T18:33:05.635455Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.679710Z", "completed_at": "2024-05-16T18:33:05.679710Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05252504348754883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.the_tuva_project.value_set_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.636533Z", "completed_at": "2024-05-16T18:33:05.678710Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.685107Z", "completed_at": "2024-05-16T18:33:05.685107Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05643200874328613, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.649052Z", "completed_at": "2024-05-16T18:33:05.680718Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.686744Z", "completed_at": "2024-05-16T18:33:05.686744Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05727124214172363, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.660104Z", "completed_at": "2024-05-16T18:33:05.681709Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.686744Z", "completed_at": "2024-05-16T18:33:05.686744Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05778670310974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.667700Z", "completed_at": "2024-05-16T18:33:05.682708Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.689044Z", "completed_at": "2024-05-16T18:33:05.689044Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05818438529968262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.693058Z", "completed_at": "2024-05-16T18:33:05.705581Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.740825Z", "completed_at": "2024-05-16T18:33:05.740825Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05462145805358887, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.705581Z", "completed_at": "2024-05-16T18:33:05.739440Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.743773Z", "completed_at": "2024-05-16T18:33:05.743773Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05273127555847168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.715599Z", "completed_at": "2024-05-16T18:33:05.740825Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.744794Z", "completed_at": "2024-05-16T18:33:05.744794Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04520869255065918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.725752Z", "completed_at": "2024-05-16T18:33:05.741868Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.745790Z", "completed_at": "2024-05-16T18:33:05.745790Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04520821571350098, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.731767Z", "completed_at": "2024-05-16T18:33:05.741868Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.746810Z", "completed_at": "2024-05-16T18:33:05.746810Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04521059989929199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.751896Z", "completed_at": "2024-05-16T18:33:05.757119Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.774630Z", "completed_at": "2024-05-16T18:33:05.774630Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029748916625976562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.757119Z", "completed_at": "2024-05-16T18:33:05.773631Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.777176Z", "completed_at": "2024-05-16T18:33:05.777176Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028636932373046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.761135Z", "completed_at": "2024-05-16T18:33:05.773631Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.777176Z", "completed_at": "2024-05-16T18:33:05.777176Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.025514841079711914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.input_layer.pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.763135Z", "completed_at": "2024-05-16T18:33:05.774630Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.778278Z", "completed_at": "2024-05-16T18:33:05.778278Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.026329994201660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.768626Z", "completed_at": "2024-05-16T18:33:05.775553Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.780449Z", "completed_at": "2024-05-16T18:33:05.780449Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026328086853027344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.785961Z", "completed_at": "2024-05-16T18:33:05.800962Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.820757Z", "completed_at": "2024-05-16T18:33:05.820757Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04231619834899902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.796986Z", "completed_at": "2024-05-16T18:33:05.809653Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.823764Z", "completed_at": "2024-05-16T18:33:05.823764Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.041809797286987305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.802318Z", "completed_at": "2024-05-16T18:33:05.819458Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.823764Z", "completed_at": "2024-05-16T18:33:05.823764Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04180622100830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.805884Z", "completed_at": "2024-05-16T18:33:05.820058Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.824763Z", "completed_at": "2024-05-16T18:33:05.824763Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.032784461975097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.810702Z", "completed_at": "2024-05-16T18:33:05.821769Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.826763Z", "completed_at": "2024-05-16T18:33:05.826763Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03380012512207031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.832762Z", "completed_at": "2024-05-16T18:33:05.854574Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.870373Z", "completed_at": "2024-05-16T18:33:05.870373Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04461026191711426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.841175Z", "completed_at": "2024-05-16T18:33:05.863700Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.871372Z", "completed_at": "2024-05-16T18:33:05.871372Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04260873794555664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.848245Z", "completed_at": "2024-05-16T18:33:05.864797Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.872372Z", "completed_at": "2024-05-16T18:33:05.872372Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.044609785079956055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.855693Z", "completed_at": "2024-05-16T18:33:05.869376Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.874373Z", "completed_at": "2024-05-16T18:33:05.874373Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04460954666137695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.865702Z", "completed_at": "2024-05-16T18:33:05.871372Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.876372Z", "completed_at": "2024-05-16T18:33:05.876372Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03949761390686035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.value_set_member_relevant_fields"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.882483Z", "completed_at": "2024-05-16T18:33:05.898154Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.910555Z", "completed_at": "2024-05-16T18:33:05.910555Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03519320487976074, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.887171Z", "completed_at": "2024-05-16T18:33:05.904157Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.910555Z", "completed_at": "2024-05-16T18:33:05.910555Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03519487380981445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__lab_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.893154Z", "completed_at": "2024-05-16T18:33:05.904978Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.912565Z", "completed_at": "2024-05-16T18:33:05.912565Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03519248962402344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medication"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.898154Z", "completed_at": "2024-05-16T18:33:05.909745Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.913567Z", "completed_at": "2024-05-16T18:33:05.913567Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.036108970642089844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__observation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:05.926819Z", "completed_at": "2024-05-16T18:33:05.941214Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:05.945691Z", "completed_at": "2024-05-16T18:33:05.945691Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.027907609939575195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.medical_claim_expanded"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.002704Z", "completed_at": "2024-05-16T18:33:06.036207Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.041509Z", "completed_at": "2024-05-16T18:33:06.041509Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05354595184326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_eligibility_dates_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.056020Z", "completed_at": "2024-05-16T18:33:06.093664Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.110833Z", "completed_at": "2024-05-16T18:33:06.110833Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06733560562133789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.067729Z", "completed_at": "2024-05-16T18:33:06.094613Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.111886Z", "completed_at": "2024-05-16T18:33:06.111886Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.061777353286743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.080968Z", "completed_at": "2024-05-16T18:33:06.108006Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.113858Z", "completed_at": "2024-05-16T18:33:06.113858Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.10684800148010254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.094613Z", "completed_at": "2024-05-16T18:33:06.111886Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.159906Z", "completed_at": "2024-05-16T18:33:06.159906Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.10752487182617188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.114836Z", "completed_at": "2024-05-16T18:33:06.163115Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.178689Z", "completed_at": "2024-05-16T18:33:06.178689Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08861875534057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.166122Z", "completed_at": "2024-05-16T18:33:06.199652Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.216183Z", "completed_at": "2024-05-16T18:33:06.216183Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05763959884643555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.190605Z", "completed_at": "2024-05-16T18:33:06.200643Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.217185Z", "completed_at": "2024-05-16T18:33:06.217185Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05540966987609863, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_npi_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.180054Z", "completed_at": "2024-05-16T18:33:06.201993Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.218190Z", "completed_at": "2024-05-16T18:33:06.218190Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06439876556396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_claim_date_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.202984Z", "completed_at": "2024-05-16T18:33:06.218190Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.230541Z", "completed_at": "2024-05-16T18:33:06.230541Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.053849220275878906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.220531Z", "completed_at": "2024-05-16T18:33:06.231547Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.236089Z", "completed_at": "2024-05-16T18:33:06.236089Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.17432689666748047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_place_of_service_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.236089Z", "completed_at": "2024-05-16T18:33:06.391866Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.401763Z", "completed_at": "2024-05-16T18:33:06.401763Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.17222189903259277, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.275540Z", "completed_at": "2024-05-16T18:33:06.391866Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.401763Z", "completed_at": "2024-05-16T18:33:06.401763Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.17223119735717773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.323206Z", "completed_at": "2024-05-16T18:33:06.392932Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.402770Z", "completed_at": "2024-05-16T18:33:06.402770Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.20005178451538086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.393886Z", "completed_at": "2024-05-16T18:33:06.402770Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.435550Z", "completed_at": "2024-05-16T18:33:06.435550Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.11769294738769531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_revenue_center_normalize"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.404769Z", "completed_at": "2024-05-16T18:33:06.438600Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.463908Z", "completed_at": "2024-05-16T18:33:06.463908Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07146358489990234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_undetermined_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.441554Z", "completed_at": "2024-05-16T18:33:06.472101Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.480218Z", "completed_at": "2024-05-16T18:33:06.480218Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.044672489166259766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.459831Z", "completed_at": "2024-05-16T18:33:06.472546Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.481231Z", "completed_at": "2024-05-16T18:33:06.481231Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04462766647338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.464817Z", "completed_at": "2024-05-16T18:33:06.473552Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.483227Z", "completed_at": "2024-05-16T18:33:06.483227Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.052193403244018555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_primary_dx"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.474552Z", "completed_at": "2024-05-16T18:33:06.482230Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.493724Z", "completed_at": "2024-05-16T18:33:06.493724Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.030907869338989258, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_transfer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.484231Z", "completed_at": "2024-05-16T18:33:06.493724Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.512970Z", "completed_at": "2024-05-16T18:33:06.512970Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0398101806640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_ungroupable_drg"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.496724Z", "completed_at": "2024-05-16T18:33:06.519505Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.562255Z", "completed_at": "2024-05-16T18:33:06.562255Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07279419898986816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.513983Z", "completed_at": "2024-05-16T18:33:06.531780Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.563337Z", "completed_at": "2024-05-16T18:33:06.563337Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07079315185546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.520505Z", "completed_at": "2024-05-16T18:33:06.561185Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.566579Z", "completed_at": "2024-05-16T18:33:06.566579Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.07716608047485352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.532848Z", "completed_at": "2024-05-16T18:33:06.564495Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.573899Z", "completed_at": "2024-05-16T18:33:06.573899Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.057402849197387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_egfr_labs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.567515Z", "completed_at": "2024-05-16T18:33:06.574895Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.604637Z", "completed_at": "2024-05-16T18:33:06.604637Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0440366268157959, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.577897Z", "completed_at": "2024-05-16T18:33:06.607300Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.619812Z", "completed_at": "2024-05-16T18:33:06.619812Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04891157150268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.599123Z", "completed_at": "2024-05-16T18:33:06.611297Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.620811Z", "completed_at": "2024-05-16T18:33:06.620811Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04891824722290039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.608296Z", "completed_at": "2024-05-16T18:33:06.614315Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.623813Z", "completed_at": "2024-05-16T18:33:06.623813Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.05168867111206055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_source_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.614315Z", "completed_at": "2024-05-16T18:33:06.621811Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.630617Z", "completed_at": "2024-05-16T18:33:06.630617Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026956558227539062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_admit_type_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.623813Z", "completed_at": "2024-05-16T18:33:06.631712Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.639160Z", "completed_at": "2024-05-16T18:33:06.639160Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02635359764099121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_apr_drg_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.635155Z", "completed_at": "2024-05-16T18:33:06.645160Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.656248Z", "completed_at": "2024-05-16T18:33:06.656248Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.028270959854125977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_bill_type_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.639160Z", "completed_at": "2024-05-16T18:33:06.649175Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.657239Z", "completed_at": "2024-05-16T18:33:06.657239Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.028179168701171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.646159Z", "completed_at": "2024-05-16T18:33:06.656248Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.659891Z", "completed_at": "2024-05-16T18:33:06.659891Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03174853324890137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_discharge_disposition_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.651691Z", "completed_at": "2024-05-16T18:33:06.657871Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.665887Z", "completed_at": "2024-05-16T18:33:06.665887Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02423715591430664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_medical_date_aggregation"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.659891Z", "completed_at": "2024-05-16T18:33:06.667391Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.676417Z", "completed_at": "2024-05-16T18:33:06.676417Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.026915311813354492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_ms_drg_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.670400Z", "completed_at": "2024-05-16T18:33:06.683163Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.697090Z", "completed_at": "2024-05-16T18:33:06.697090Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.033200740814208984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.677099Z", "completed_at": "2024-05-16T18:33:06.691082Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.698088Z", "completed_at": "2024-05-16T18:33:06.698088Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03169655799865723, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.684200Z", "completed_at": "2024-05-16T18:33:06.696091Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.700592Z", "completed_at": "2024-05-16T18:33:06.700592Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03620004653930664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_voting"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.692090Z", "completed_at": "2024-05-16T18:33:06.698088Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.706600Z", "completed_at": "2024-05-16T18:33:06.706600Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026831388473510742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.701596Z", "completed_at": "2024-05-16T18:33:06.708977Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.723736Z", "completed_at": "2024-05-16T18:33:06.723736Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.028218746185302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_line_numbers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.711984Z", "completed_at": "2024-05-16T18:33:06.726314Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.736442Z", "completed_at": "2024-05-16T18:33:06.736442Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031106948852539062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_claim_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.717490Z", "completed_at": "2024-05-16T18:33:06.730326Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.737691Z", "completed_at": "2024-05-16T18:33:06.737691Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03210878372192383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_pharmacy_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.726314Z", "completed_at": "2024-05-16T18:33:06.735438Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.739709Z", "completed_at": "2024-05-16T18:33:06.739709Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.034720420837402344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.732309Z", "completed_at": "2024-05-16T18:33:06.738707Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.746708Z", "completed_at": "2024-05-16T18:33:06.746708Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02443552017211914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.740707Z", "completed_at": "2024-05-16T18:33:06.747706Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.755400Z", "completed_at": "2024-05-16T18:33:06.755400Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.024282217025756836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.750706Z", "completed_at": "2024-05-16T18:33:06.760724Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.776243Z", "completed_at": "2024-05-16T18:33:06.776243Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.033080339431762695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.755925Z", "completed_at": "2024-05-16T18:33:06.765724Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.778767Z", "completed_at": "2024-05-16T18:33:06.778767Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.033570289611816406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_time_requirement"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.781684Z", "completed_at": "2024-05-16T18:33:06.790218Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.808307Z", "completed_at": "2024-05-16T18:33:06.808307Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04120326042175293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.791215Z", "completed_at": "2024-05-16T18:33:06.816402Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.820863Z", "completed_at": "2024-05-16T18:33:06.820863Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.035608768463134766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.802291Z", "completed_at": "2024-05-16T18:33:06.818819Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.822826Z", "completed_at": "2024-05-16T18:33:06.822826Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.035607337951660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.809308Z", "completed_at": "2024-05-16T18:33:06.819823Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.823825Z", "completed_at": "2024-05-16T18:33:06.823825Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03560614585876465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.832824Z", "completed_at": "2024-05-16T18:33:06.847343Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.851859Z", "completed_at": "2024-05-16T18:33:06.851859Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.027545690536499023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_diagnosis_code_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.838343Z", "completed_at": "2024-05-16T18:33:06.849343Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.857371Z", "completed_at": "2024-05-16T18:33:06.857371Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.028545379638671875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_present_on_admit_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.844353Z", "completed_at": "2024-05-16T18:33:06.850853Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.859369Z", "completed_at": "2024-05-16T18:33:06.859369Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0285491943359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_code_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.851859Z", "completed_at": "2024-05-16T18:33:06.860370Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.865370Z", "completed_at": "2024-05-16T18:33:06.865370Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.019027233123779297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__int_procedure_date_final"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.867876Z", "completed_at": "2024-05-16T18:33:06.884394Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.887408Z", "completed_at": "2024-05-16T18:33:06.887408Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.030041217803955078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.871889Z", "completed_at": "2024-05-16T18:33:06.886407Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.895407Z", "completed_at": "2024-05-16T18:33:06.895407Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.033037662506103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_crude"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.878888Z", "completed_at": "2024-05-16T18:33:06.887408Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.896407Z", "completed_at": "2024-05-16T18:33:06.896407Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03303718566894531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.888407Z", "completed_at": "2024-05-16T18:33:06.895407Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:06.900922Z", "completed_at": "2024-05-16T18:33:06.900922Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.018538951873779297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.902933Z", "completed_at": "2024-05-16T18:33:06.962976Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.122730Z", "completed_at": "2024-05-16T18:33:07.122730Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.2342674732208252, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.909931Z", "completed_at": "2024-05-16T18:33:07.131733Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.134732Z", "completed_at": "2024-05-16T18:33:07.134732Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.2336750030517578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.normalized_input__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.127658Z", "completed_at": "2024-05-16T18:33:07.134191Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.136344Z", "completed_at": "2024-05-16T18:33:07.136344Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.1121976375579834, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__index_admission"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.219427Z", "completed_at": "2024-05-16T18:33:07.237218Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.240493Z", "completed_at": "2024-05-16T18:33:07.240493Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.10263538360595703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_mapping_failures"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.223516Z", "completed_at": "2024-05-16T18:33:07.238728Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.242498Z", "completed_at": "2024-05-16T18:33:07.242498Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.10363125801086426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_claim_type_unmapped"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.227405Z", "completed_at": "2024-05-16T18:33:07.240493Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.243517Z", "completed_at": "2024-05-16T18:33:07.243517Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11318445205688477, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_institutional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.245497Z", "completed_at": "2024-05-16T18:33:07.257915Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.273538Z", "completed_at": "2024-05-16T18:33:07.273538Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.039465904235839844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.258916Z", "completed_at": "2024-05-16T18:33:07.281013Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.285053Z", "completed_at": "2024-05-16T18:33:07.285053Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03248167037963867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_dates_inst"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.274499Z", "completed_at": "2024-05-16T18:33:07.283009Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.288057Z", "completed_at": "2024-05-16T18:33:07.288057Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.032183170318603516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_duplicates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.291060Z", "completed_at": "2024-05-16T18:33:07.299058Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.324617Z", "completed_at": "2024-05-16T18:33:07.324617Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03916287422180176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_inst_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.300659Z", "completed_at": "2024-05-16T18:33:07.323539Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.326981Z", "completed_at": "2024-05-16T18:33:07.326981Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03196430206298828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_npi"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.307709Z", "completed_at": "2024-05-16T18:33:07.325061Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.329025Z", "completed_at": "2024-05-16T18:33:07.329025Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03192853927612305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_invalid_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.331985Z", "completed_at": "2024-05-16T18:33:07.347449Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.353965Z", "completed_at": "2024-05-16T18:33:07.353965Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.027532339096069336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_line_numbers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.337154Z", "completed_at": "2024-05-16T18:33:07.349455Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.358518Z", "completed_at": "2024-05-16T18:33:07.358518Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03557157516479492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_plausibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.349455Z", "completed_at": "2024-05-16T18:33:07.357518Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.367521Z", "completed_at": "2024-05-16T18:33:07.367521Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03451991081237793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_prof_missing_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.371694Z", "completed_at": "2024-05-16T18:33:07.379714Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.391212Z", "completed_at": "2024-05-16T18:33:07.391212Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02665877342224121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_professional_header_fail_details"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.399212Z", "completed_at": "2024-05-16T18:33:07.425634Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.428550Z", "completed_at": "2024-05-16T18:33:07.428550Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03429770469665527, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_normalized_input__medical_claim__claim_id_claim_line_number_.7102b4fe4f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.402788Z", "completed_at": "2024-05-16T18:33:07.426549Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.429620Z", "completed_at": "2024-05-16T18:33:07.429620Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03530001640319824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.410772Z", "completed_at": "2024-05-16T18:33:07.427559Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.431600Z", "completed_at": "2024-05-16T18:33:07.431600Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0368349552154541, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.438050Z", "completed_at": "2024-05-16T18:33:07.454580Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.457859Z", "completed_at": "2024-05-16T18:33:07.457859Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.022807598114013672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.444051Z", "completed_at": "2024-05-16T18:33:07.455581Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.458858Z", "completed_at": "2024-05-16T18:33:07.458858Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.023805618286132812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.449068Z", "completed_at": "2024-05-16T18:33:07.456865Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.459857Z", "completed_at": "2024-05-16T18:33:07.459857Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.023807287216186523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:06.767228Z", "completed_at": "2024-05-16T18:33:07.367521Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.376772Z", "completed_at": "2024-05-16T18:33:07.376772Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.7577767372131348, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_eligibility_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.465857Z", "completed_at": "2024-05-16T18:33:07.515920Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.520490Z", "completed_at": "2024-05-16T18:33:07.520490Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.059613943099975586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.472376Z", "completed_at": "2024-05-16T18:33:07.518486Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.523574Z", "completed_at": "2024-05-16T18:33:07.523574Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06168675422668457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.479379Z", "completed_at": "2024-05-16T18:33:07.519491Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.524491Z", "completed_at": "2024-05-16T18:33:07.524491Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.06574368476867676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.526494Z", "completed_at": "2024-05-16T18:33:07.534175Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.542010Z", "completed_at": "2024-05-16T18:33:07.542010Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03206133842468262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.535989Z", "completed_at": "2024-05-16T18:33:07.547019Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.557036Z", "completed_at": "2024-05-16T18:33:07.557036Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.027388572692871094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.543001Z", "completed_at": "2024-05-16T18:33:07.555567Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.559035Z", "completed_at": "2024-05-16T18:33:07.559035Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.026860952377319336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.548038Z", "completed_at": "2024-05-16T18:33:07.557036Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.560038Z", "completed_at": "2024-05-16T18:33:07.560038Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030567646026611328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.562035Z", "completed_at": "2024-05-16T18:33:07.568584Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.576767Z", "completed_at": "2024-05-16T18:33:07.576767Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03329610824584961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.569589Z", "completed_at": "2024-05-16T18:33:07.576767Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.593801Z", "completed_at": "2024-05-16T18:33:07.593801Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.029746532440185547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.580765Z", "completed_at": "2024-05-16T18:33:07.593801Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.596800Z", "completed_at": "2024-05-16T18:33:07.596800Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03336739540100098, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.586329Z", "completed_at": "2024-05-16T18:33:07.593801Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.597797Z", "completed_at": "2024-05-16T18:33:07.597797Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.029153108596801758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.597797Z", "completed_at": "2024-05-16T18:33:07.605779Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.612778Z", "completed_at": "2024-05-16T18:33:07.612778Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026196956634521484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.606778Z", "completed_at": "2024-05-16T18:33:07.613777Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.628804Z", "completed_at": "2024-05-16T18:33:07.628804Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.027009010314941406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.613777Z", "completed_at": "2024-05-16T18:33:07.627767Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.631767Z", "completed_at": "2024-05-16T18:33:07.631767Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03267359733581543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.621921Z", "completed_at": "2024-05-16T18:33:07.629767Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.637945Z", "completed_at": "2024-05-16T18:33:07.637945Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02833724021911621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.631767Z", "completed_at": "2024-05-16T18:33:07.640682Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.649012Z", "completed_at": "2024-05-16T18:33:07.649012Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025207996368408203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.642774Z", "completed_at": "2024-05-16T18:33:07.654012Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.661349Z", "completed_at": "2024-05-16T18:33:07.661349Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.024329423904418945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.649486Z", "completed_at": "2024-05-16T18:33:07.660328Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.664347Z", "completed_at": "2024-05-16T18:33:07.664347Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.028725385665893555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.655536Z", "completed_at": "2024-05-16T18:33:07.662349Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.670429Z", "completed_at": "2024-05-16T18:33:07.670429Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.024495363235473633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.665242Z", "completed_at": "2024-05-16T18:33:07.672420Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.681733Z", "completed_at": "2024-05-16T18:33:07.681733Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.027829885482788086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_detail"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.674420Z", "completed_at": "2024-05-16T18:33:07.689681Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.699185Z", "completed_at": "2024-05-16T18:33:07.699185Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030255556106567383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.682756Z", "completed_at": "2024-05-16T18:33:07.698191Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.702707Z", "completed_at": "2024-05-16T18:33:07.702707Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.030283689498901367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.691190Z", "completed_at": "2024-05-16T18:33:07.700691Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.704703Z", "completed_at": "2024-05-16T18:33:07.704703Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.033269643783569336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.705705Z", "completed_at": "2024-05-16T18:33:07.714706Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.738714Z", "completed_at": "2024-05-16T18:33:07.738714Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03843569755554199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.715703Z", "completed_at": "2024-05-16T18:33:07.737730Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.747401Z", "completed_at": "2024-05-16T18:33:07.747401Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03768348693847656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.721224Z", "completed_at": "2024-05-16T18:33:07.740134Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.749385Z", "completed_at": "2024-05-16T18:33:07.749385Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.036184072494506836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.742377Z", "completed_at": "2024-05-16T18:33:07.749385Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.755399Z", "completed_at": "2024-05-16T18:33:07.755399Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.040979623794555664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.756404Z", "completed_at": "2024-05-16T18:33:07.768357Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.774709Z", "completed_at": "2024-05-16T18:33:07.774709Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.026339292526245117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.762761Z", "completed_at": "2024-05-16T18:33:07.773449Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.776749Z", "completed_at": "2024-05-16T18:33:07.776749Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.026827335357666016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_use_case"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.769369Z", "completed_at": "2024-05-16T18:33:07.774709Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.781723Z", "completed_at": "2024-05-16T18:33:07.781723Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.021540403366088867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_source_table.cf991d30ab"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.776749Z", "completed_at": "2024-05-16T18:33:07.782723Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.790237Z", "completed_at": "2024-05-16T18:33:07.790237Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.023651123046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_category.ced96217c6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.785231Z", "completed_at": "2024-05-16T18:33:07.797931Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.806288Z", "completed_at": "2024-05-16T18:33:07.806288Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02656865119934082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_detail_test_name.dba1927ba6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.791236Z", "completed_at": "2024-05-16T18:33:07.805291Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.809293Z", "completed_at": "2024-05-16T18:33:07.809293Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03306269645690918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.799766Z", "completed_at": "2024-05-16T18:33:07.807291Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.817289Z", "completed_at": "2024-05-16T18:33:07.817289Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.02938532829284668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.810290Z", "completed_at": "2024-05-16T18:33:07.818618Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.830900Z", "completed_at": "2024-05-16T18:33:07.830900Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.035750389099121094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.821397Z", "completed_at": "2024-05-16T18:33:07.840078Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.847022Z", "completed_at": "2024-05-16T18:33:07.847022Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03171420097351074, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.831444Z", "completed_at": "2024-05-16T18:33:07.842005Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.850004Z", "completed_at": "2024-05-16T18:33:07.850004Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03154158592224121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.843083Z", "completed_at": "2024-05-16T18:33:07.850004Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.858180Z", "completed_at": "2024-05-16T18:33:07.858180Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.042870521545410156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.claims_preprocessing_pipeline_checks_data_quality__claims_preprocessing_summary_.b6e0d43468"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.853663Z", "completed_at": "2024-05-16T18:33:07.872802Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.881130Z", "completed_at": "2024-05-16T18:33:07.881130Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03902149200439453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_source_table.69a94b9930"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.875124Z", "completed_at": "2024-05-16T18:33:07.882140Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.890012Z", "completed_at": "2024-05-16T18:33:07.890012Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03883051872253418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_summary_test_category.096fbc6a15"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.882491Z", "completed_at": "2024-05-16T18:33:07.889016Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.897020Z", "completed_at": "2024-05-16T18:33:07.897020Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02423858642578125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_source_table.aa47c26a47"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.890012Z", "completed_at": "2024-05-16T18:33:07.898013Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.904296Z", "completed_at": "2024-05-16T18:33:07.904296Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.020280838012695312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_test_name.d9661e41fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.899378Z", "completed_at": "2024-05-16T18:33:07.905295Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.915100Z", "completed_at": "2024-05-16T18:33:07.915100Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02571415901184082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_use_case_use_case.50708d3a7d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.906294Z", "completed_at": "2024-05-16T18:33:07.919756Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.922724Z", "completed_at": "2024-05-16T18:33:07.922724Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.023453950881958008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.916096Z", "completed_at": "2024-05-16T18:33:07.921725Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.926726Z", "completed_at": "2024-05-16T18:33:07.926726Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.023429393768310547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.922724Z", "completed_at": "2024-05-16T18:33:07.927724Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.935235Z", "completed_at": "2024-05-16T18:33:07.935235Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.01748514175415039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__eligibility"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.928724Z", "completed_at": "2024-05-16T18:33:07.936241Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.941239Z", "completed_at": "2024-05-16T18:33:07.941239Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02138972282409668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__patient"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.937241Z", "completed_at": "2024-05-16T18:33:07.946198Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.950859Z", "completed_at": "2024-05-16T18:33:07.950859Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.022954940795898438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.941239Z", "completed_at": "2024-05-16T18:33:07.949861Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.957185Z", "completed_at": "2024-05-16T18:33:07.957185Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02294301986694336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:07.263929Z", "completed_at": "2024-05-16T18:33:07.878228Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:07.886013Z", "completed_at": "2024-05-16T18:33:07.886013Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.756479024887085, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_medical_claim_denominators"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.033103Z", "completed_at": "2024-05-16T18:33:08.076249Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.090255Z", "completed_at": "2024-05-16T18:33:08.090255Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.07374453544616699, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.036599Z", "completed_at": "2024-05-16T18:33:08.077389Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.090255Z", "completed_at": "2024-05-16T18:33:08.090255Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07319092750549316, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.078017Z", "completed_at": "2024-05-16T18:33:08.089256Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.098339Z", "completed_at": "2024-05-16T18:33:08.098339Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07418370246887207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.091256Z", "completed_at": "2024-05-16T18:33:08.099355Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.110181Z", "completed_at": "2024-05-16T18:33:08.110181Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.10337066650390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_age"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.100861Z", "completed_at": "2024-05-16T18:33:08.109181Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.191593Z", "completed_at": "2024-05-16T18:33:08.191593Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.11385679244995117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_missing_gender"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.111181Z", "completed_at": "2024-05-16T18:33:08.192611Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.208768Z", "completed_at": "2024-05-16T18:33:08.208768Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.10411977767944336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.177174Z", "completed_at": "2024-05-16T18:33:08.193591Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.209883Z", "completed_at": "2024-05-16T18:33:08.209883Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.1085822582244873, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ed_classification__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.194589Z", "completed_at": "2024-05-16T18:33:08.208768Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.217240Z", "completed_at": "2024-05-16T18:33:08.217240Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11415672302246094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male__unknown.e6adc9ce2b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.212237Z", "completed_at": "2024-05-16T18:33:08.223356Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.227337Z", "completed_at": "2024-05-16T18:33:08.227337Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.031398773193359375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.219334Z", "completed_at": "2024-05-16T18:33:08.226335Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.238441Z", "completed_at": "2024-05-16T18:33:08.238441Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03056955337524414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.228035Z", "completed_at": "2024-05-16T18:33:08.238441Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.262658Z", "completed_at": "2024-05-16T18:33:08.262658Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04230999946594238, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.232295Z", "completed_at": "2024-05-16T18:33:08.240453Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.265666Z", "completed_at": "2024-05-16T18:33:08.265666Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04892873764038086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result_stage_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.240453Z", "completed_at": "2024-05-16T18:33:08.264663Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.276262Z", "completed_at": "2024-05-16T18:33:08.276262Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05047345161437988, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_medications"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.290807Z", "completed_at": "2024-05-16T18:33:08.313986Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.332209Z", "completed_at": "2024-05-16T18:33:08.332209Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05087637901306152, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_shared_exclusion_union"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.313986Z", "completed_at": "2024-05-16T18:33:08.328138Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.335581Z", "completed_at": "2024-05-16T18:33:08.335581Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05056023597717285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.322130Z", "completed_at": "2024-05-16T18:33:08.328138Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.335581Z", "completed_at": "2024-05-16T18:33:08.335581Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.050606727600097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.329136Z", "completed_at": "2024-05-16T18:33:08.335581Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.342575Z", "completed_at": "2024-05-16T18:33:08.342575Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03161191940307617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.336585Z", "completed_at": "2024-05-16T18:33:08.342575Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.404345Z", "completed_at": "2024-05-16T18:33:08.404345Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1324920654296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.data_quality__claims_preprocessing_test_result"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.346204Z", "completed_at": "2024-05-16T18:33:08.405936Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.485464Z", "completed_at": "2024-05-16T18:33:08.485464Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.14639663696289062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.406933Z", "completed_at": "2024-05-16T18:33:08.485464Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.489468Z", "completed_at": "2024-05-16T18:33:08.489468Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.15551972389221191, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.465700Z", "completed_at": "2024-05-16T18:33:08.486471Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.490483Z", "completed_at": "2024-05-16T18:33:08.490483Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.15781092643737793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.477252Z", "completed_at": "2024-05-16T18:33:08.488469Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.501994Z", "completed_at": "2024-05-16T18:33:08.501994Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.10010051727294922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.491651Z", "completed_at": "2024-05-16T18:33:08.504001Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.516675Z", "completed_at": "2024-05-16T18:33:08.516675Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04037833213806152, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.505997Z", "completed_at": "2024-05-16T18:33:08.517686Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.546059Z", "completed_at": "2024-05-16T18:33:08.546059Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.047937870025634766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.517686Z", "completed_at": "2024-05-16T18:33:08.545112Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.550654Z", "completed_at": "2024-05-16T18:33:08.550654Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05974984169006348, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.527758Z", "completed_at": "2024-05-16T18:33:08.547236Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.564989Z", "completed_at": "2024-05-16T18:33:08.564989Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05261373519897461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.537059Z", "completed_at": "2024-05-16T18:33:08.547638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.565747Z", "completed_at": "2024-05-16T18:33:08.565747Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05261516571044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.551157Z", "completed_at": "2024-05-16T18:33:08.569290Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.581714Z", "completed_at": "2024-05-16T18:33:08.581714Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04560208320617676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.571572Z", "completed_at": "2024-05-16T18:33:08.582646Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.602962Z", "completed_at": "2024-05-16T18:33:08.602962Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03820228576660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.584151Z", "completed_at": "2024-05-16T18:33:08.598285Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.605962Z", "completed_at": "2024-05-16T18:33:08.605962Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04060053825378418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_denom"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.593421Z", "completed_at": "2024-05-16T18:33:08.602962Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.606964Z", "completed_at": "2024-05-16T18:33:08.606964Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.032288312911987305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.598285Z", "completed_at": "2024-05-16T18:33:08.605962Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.612963Z", "completed_at": "2024-05-16T18:33:08.612963Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03332114219665527, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.607961Z", "completed_at": "2024-05-16T18:33:08.614968Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.623395Z", "completed_at": "2024-05-16T18:33:08.623395Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.026443004608154297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.615968Z", "completed_at": "2024-05-16T18:33:08.624409Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.634920Z", "completed_at": "2024-05-16T18:33:08.634920Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.027966976165771484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.626406Z", "completed_at": "2024-05-16T18:33:08.634920Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.641000Z", "completed_at": "2024-05-16T18:33:08.641000Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.030014991760253906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors__patient_id_model_version_.21c6216400"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.630405Z", "completed_at": "2024-05-16T18:33:08.635924Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.641967Z", "completed_at": "2024-05-16T18:33:08.641967Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.025122642517089844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_source_table.6995ae2e57"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.635924Z", "completed_at": "2024-05-16T18:33:08.641967Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.648494Z", "completed_at": "2024-05-16T18:33:08.648494Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.025606393814086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_category.70042a7a27"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.642966Z", "completed_at": "2024-05-16T18:33:08.648494Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.660570Z", "completed_at": "2024-05-16T18:33:08.660570Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.026770591735839844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_data_quality__claims_preprocessing_test_result_test_name.745065a5e9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.651012Z", "completed_at": "2024-05-16T18:33:08.665711Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.673263Z", "completed_at": "2024-05-16T18:33:08.673263Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04128861427307129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.661025Z", "completed_at": "2024-05-16T18:33:08.672263Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.690287Z", "completed_at": "2024-05-16T18:33:08.690287Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.042775869369506836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.667226Z", "completed_at": "2024-05-16T18:33:08.686103Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.691284Z", "completed_at": "2024-05-16T18:33:08.691284Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04425549507141113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.674266Z", "completed_at": "2024-05-16T18:33:08.689285Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.702842Z", "completed_at": "2024-05-16T18:33:08.702842Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04013180732727051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_denom_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.693331Z", "completed_at": "2024-05-16T18:33:08.704843Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.718283Z", "completed_at": "2024-05-16T18:33:08.718283Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.044973134994506836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_01_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.707842Z", "completed_at": "2024-05-16T18:33:08.718283Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.734128Z", "completed_at": "2024-05-16T18:33:08.734128Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03893589973449707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_03_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.719287Z", "completed_at": "2024-05-16T18:33:08.734128Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.743816Z", "completed_at": "2024-05-16T18:33:08.743816Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03792881965637207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_14_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.728288Z", "completed_at": "2024-05-16T18:33:08.740774Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.743816Z", "completed_at": "2024-05-16T18:33:08.743816Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0301058292388916, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.735134Z", "completed_at": "2024-05-16T18:33:08.742776Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.745875Z", "completed_at": "2024-05-16T18:33:08.745875Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02848529815673828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.749827Z", "completed_at": "2024-05-16T18:33:08.791608Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.792509Z", "completed_at": "2024-05-16T18:33:08.792509Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04605674743652344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.769837Z", "completed_at": "2024-05-16T18:33:08.792509Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.795192Z", "completed_at": "2024-05-16T18:33:08.795192Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.048392295837402344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.798197Z", "completed_at": "2024-05-16T18:33:08.813867Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.814801Z", "completed_at": "2024-05-16T18:33:08.814801Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.019583463668823242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.806773Z", "completed_at": "2024-05-16T18:33:08.818293Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.826685Z", "completed_at": "2024-05-16T18:33:08.826685Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03573203086853027, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.820776Z", "completed_at": "2024-05-16T18:33:08.840517Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.844519Z", "completed_at": "2024-05-16T18:33:08.844519Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.030237913131713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.827225Z", "completed_at": "2024-05-16T18:33:08.842551Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.848801Z", "completed_at": "2024-05-16T18:33:08.848801Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.032442331314086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.834332Z", "completed_at": "2024-05-16T18:33:08.843517Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.849207Z", "completed_at": "2024-05-16T18:33:08.849207Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03248405456542969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.851740Z", "completed_at": "2024-05-16T18:33:08.883961Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.900994Z", "completed_at": "2024-05-16T18:33:08.900994Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.07098817825317383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.865921Z", "completed_at": "2024-05-16T18:33:08.885383Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.910891Z", "completed_at": "2024-05-16T18:33:08.910891Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.07030272483825684, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.886437Z", "completed_at": "2024-05-16T18:33:08.902001Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.921566Z", "completed_at": "2024-05-16T18:33:08.921566Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05764627456665039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.903036Z", "completed_at": "2024-05-16T18:33:08.920575Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.924568Z", "completed_at": "2024-05-16T18:33:08.924568Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04860424995422363, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.911500Z", "completed_at": "2024-05-16T18:33:08.920575Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.925566Z", "completed_at": "2024-05-16T18:33:08.925566Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04665565490722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.926568Z", "completed_at": "2024-05-16T18:33:08.973699Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.984082Z", "completed_at": "2024-05-16T18:33:08.984082Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06786656379699707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.934070Z", "completed_at": "2024-05-16T18:33:08.976051Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:08.991110Z", "completed_at": "2024-05-16T18:33:08.991110Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0770561695098877, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.977069Z", "completed_at": "2024-05-16T18:33:08.991110Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.002658Z", "completed_at": "2024-05-16T18:33:09.002658Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07209062576293945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__condition"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.985430Z", "completed_at": "2024-05-16T18:33:08.999120Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.003655Z", "completed_at": "2024-05-16T18:33:09.003655Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0376889705657959, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__medical_claim"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:08.991110Z", "completed_at": "2024-05-16T18:33:09.002658Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.013544Z", "completed_at": "2024-05-16T18:33:09.013544Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04264378547668457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.005658Z", "completed_at": "2024-05-16T18:33:09.017571Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.029004Z", "completed_at": "2024-05-16T18:33:09.029004Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03840804100036621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.019697Z", "completed_at": "2024-05-16T18:33:09.029004Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.043644Z", "completed_at": "2024-05-16T18:33:09.043644Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04500627517700195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__procedure"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.030028Z", "completed_at": "2024-05-16T18:33:09.042639Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.051727Z", "completed_at": "2024-05-16T18:33:09.051727Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03503274917602539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.emergency_department__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.099820Z", "completed_at": "2024-05-16T18:33:09.109898Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.121440Z", "completed_at": "2024-05-16T18:33:09.121440Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.032416582107543945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__condition_condition_id.ef1067e2f0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.114902Z", "completed_at": "2024-05-16T18:33:09.122440Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.139980Z", "completed_at": "2024-05-16T18:33:09.139980Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.040079593658447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.125439Z", "completed_at": "2024-05-16T18:33:09.140979Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.154129Z", "completed_at": "2024-05-16T18:33:09.154129Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04023313522338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.142978Z", "completed_at": "2024-05-16T18:33:09.154129Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.162649Z", "completed_at": "2024-05-16T18:33:09.162649Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.02966761589050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.147978Z", "completed_at": "2024-05-16T18:33:09.160648Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.167646Z", "completed_at": "2024-05-16T18:33:09.167646Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.02975177764892578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.155129Z", "completed_at": "2024-05-16T18:33:09.161650Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.168725Z", "completed_at": "2024-05-16T18:33:09.168725Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03475761413574219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.162649Z", "completed_at": "2024-05-16T18:33:09.169730Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.179736Z", "completed_at": "2024-05-16T18:33:09.179736Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.023085594177246094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.171737Z", "completed_at": "2024-05-16T18:33:09.179736Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.190249Z", "completed_at": "2024-05-16T18:33:09.190249Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03725147247314453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.182736Z", "completed_at": "2024-05-16T18:33:09.201895Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.206899Z", "completed_at": "2024-05-16T18:33:09.206899Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03814101219177246, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.190249Z", "completed_at": "2024-05-16T18:33:09.204899Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.215900Z", "completed_at": "2024-05-16T18:33:09.215900Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0386805534362793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.196772Z", "completed_at": "2024-05-16T18:33:09.205899Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.215900Z", "completed_at": "2024-05-16T18:33:09.215900Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0386805534362793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.220415Z", "completed_at": "2024-05-16T18:33:09.227022Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.237269Z", "completed_at": "2024-05-16T18:33:09.237269Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05447196960449219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.229748Z", "completed_at": "2024-05-16T18:33:09.244269Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.273371Z", "completed_at": "2024-05-16T18:33:09.273371Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05095338821411133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__location"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.238269Z", "completed_at": "2024-05-16T18:33:09.271374Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.277372Z", "completed_at": "2024-05-16T18:33:09.277372Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.05144381523132324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__practitioner"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.245268Z", "completed_at": "2024-05-16T18:33:09.272372Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.278669Z", "completed_at": "2024-05-16T18:33:09.278669Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.06738829612731934, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.257825Z", "completed_at": "2024-05-16T18:33:09.273371Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.278669Z", "completed_at": "2024-05-16T18:33:09.278669Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06937050819396973, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.280716Z", "completed_at": "2024-05-16T18:33:09.300606Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.309618Z", "completed_at": "2024-05-16T18:33:09.309618Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04738450050354004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.343271Z", "completed_at": "2024-05-16T18:33:09.357802Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.413664Z", "completed_at": "2024-05-16T18:33:09.413664Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08291912078857422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_core__procedure_procedure_id.feb1b6b4d5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.349267Z", "completed_at": "2024-05-16T18:33:09.412663Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.417662Z", "completed_at": "2024-05-16T18:33:09.417662Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0989387035369873, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.372541Z", "completed_at": "2024-05-16T18:33:09.413664Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.418684Z", "completed_at": "2024-05-16T18:33:09.418684Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.0992879867553711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.382556Z", "completed_at": "2024-05-16T18:33:09.414664Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.440205Z", "completed_at": "2024-05-16T18:33:09.440205Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.09606575965881348, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.419692Z", "completed_at": "2024-05-16T18:33:09.444361Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.456869Z", "completed_at": "2024-05-16T18:33:09.456869Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05293536186218262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_prep_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.447357Z", "completed_at": "2024-05-16T18:33:09.457868Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.520424Z", "completed_at": "2024-05-16T18:33:09.520424Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.08067870140075684, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.458582Z", "completed_at": "2024-05-16T18:33:09.519425Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.523685Z", "completed_at": "2024-05-16T18:33:09.523685Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0920259952545166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.468622Z", "completed_at": "2024-05-16T18:33:09.519425Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.524825Z", "completed_at": "2024-05-16T18:33:09.524825Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08451294898986816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.497144Z", "completed_at": "2024-05-16T18:33:09.520424Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.525241Z", "completed_at": "2024-05-16T18:33:09.525241Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.08550858497619629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.525241Z", "completed_at": "2024-05-16T18:33:09.542378Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.557886Z", "completed_at": "2024-05-16T18:33:09.557886Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06676149368286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_institutional_snp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.544377Z", "completed_at": "2024-05-16T18:33:09.560170Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.599132Z", "completed_at": "2024-05-16T18:33:09.599132Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.06327080726623535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_05_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.560654Z", "completed_at": "2024-05-16T18:33:09.599132Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.603651Z", "completed_at": "2024-05-16T18:33:09.603651Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0806417465209961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_15_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.569206Z", "completed_at": "2024-05-16T18:33:09.600637Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.604650Z", "completed_at": "2024-05-16T18:33:09.604650Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.08278250694274902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.589114Z", "completed_at": "2024-05-16T18:33:09.601646Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.625124Z", "completed_at": "2024-05-16T18:33:09.625124Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.07085013389587402, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.605651Z", "completed_at": "2024-05-16T18:33:09.627735Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.660181Z", "completed_at": "2024-05-16T18:33:09.661179Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.0774393081665039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.630347Z", "completed_at": "2024-05-16T18:33:09.677077Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.722670Z", "completed_at": "2024-05-16T18:33:09.722670Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09954285621643066, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.661537Z", "completed_at": "2024-05-16T18:33:09.721667Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.726667Z", "completed_at": "2024-05-16T18:33:09.726667Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.20476818084716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_16_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.678979Z", "completed_at": "2024-05-16T18:33:09.722670Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.727667Z", "completed_at": "2024-05-16T18:33:09.727667Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.17689919471740723, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.687092Z", "completed_at": "2024-05-16T18:33:09.723667Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.808956Z", "completed_at": "2024-05-16T18:33:09.808956Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.17790508270263672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.727667Z", "completed_at": "2024-05-16T18:33:09.840088Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:09.904808Z", "completed_at": "2024-05-16T18:33:09.904808Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.21213912963867188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055__denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.842089Z", "completed_at": "2024-05-16T18:33:09.905809Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.043394Z", "completed_at": "2024-05-16T18:33:10.043394Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.21097660064697266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.940466Z", "completed_at": "2024-05-16T18:33:10.042336Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.047046Z", "completed_at": "2024-05-16T18:33:10.047046Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.27786707878112793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.906809Z", "completed_at": "2024-05-16T18:33:10.043394Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.047046Z", "completed_at": "2024-05-16T18:33:10.047046Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.3410458564758301, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:09.976895Z", "completed_at": "2024-05-16T18:33:10.045033Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.181666Z", "completed_at": "2024-05-16T18:33:10.181666Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.2813529968261719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.048045Z", "completed_at": "2024-05-16T18:33:10.185629Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.240270Z", "completed_at": "2024-05-16T18:33:10.240270Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.23874592781066895, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.189635Z", "completed_at": "2024-05-16T18:33:10.282077Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.331306Z", "completed_at": "2024-05-16T18:33:10.331306Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.15217304229736328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.241269Z", "completed_at": "2024-05-16T18:33:10.330307Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.336415Z", "completed_at": "2024-05-16T18:33:10.336415Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.15177106857299805, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_frailty"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.283099Z", "completed_at": "2024-05-16T18:33:10.332308Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.338410Z", "completed_at": "2024-05-16T18:33:10.338410Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.1597740650177002, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_hospice_palliative"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.324305Z", "completed_at": "2024-05-16T18:33:10.332308Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.339409Z", "completed_at": "2024-05-16T18:33:10.339409Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1126558780670166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.340426Z", "completed_at": "2024-05-16T18:33:10.353924Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.366436Z", "completed_at": "2024-05-16T18:33:10.366436Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04421067237854004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__procedure_ccs"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.355924Z", "completed_at": "2024-05-16T18:33:10.366436Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.382516Z", "completed_at": "2024-05-16T18:33:10.382516Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0376129150390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.367436Z", "completed_at": "2024-05-16T18:33:10.381517Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.387038Z", "completed_at": "2024-05-16T18:33:10.387038Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03511190414428711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.373517Z", "completed_at": "2024-05-16T18:33:10.382516Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.389037Z", "completed_at": "2024-05-16T18:33:10.389037Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0329279899597168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.378517Z", "completed_at": "2024-05-16T18:33:10.384022Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.390036Z", "completed_at": "2024-05-16T18:33:10.390036Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.03171658515930176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.391269Z", "completed_at": "2024-05-16T18:33:10.398195Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.409694Z", "completed_at": "2024-05-16T18:33:10.409694Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.042641639709472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.399172Z", "completed_at": "2024-05-16T18:33:10.423120Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.438392Z", "completed_at": "2024-05-16T18:33:10.438392Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.044619083404541016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_all_conditions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.409694Z", "completed_at": "2024-05-16T18:33:10.428638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.440394Z", "completed_at": "2024-05-16T18:33:10.440394Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04321908950805664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.423615Z", "completed_at": "2024-05-16T18:33:10.437391Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.442391Z", "completed_at": "2024-05-16T18:33:10.442391Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04168057441711426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.429254Z", "completed_at": "2024-05-16T18:33:10.439390Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.447407Z", "completed_at": "2024-05-16T18:33:10.447407Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.042222023010253906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.444391Z", "completed_at": "2024-05-16T18:33:10.451934Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.473557Z", "completed_at": "2024-05-16T18:33:10.474558Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05252361297607422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.455932Z", "completed_at": "2024-05-16T18:33:10.489929Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.502987Z", "completed_at": "2024-05-16T18:33:10.502987Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.056079864501953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.474558Z", "completed_at": "2024-05-16T18:33:10.500916Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.506291Z", "completed_at": "2024-05-16T18:33:10.506291Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05538153648376465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.481347Z", "completed_at": "2024-05-16T18:33:10.501979Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.507315Z", "completed_at": "2024-05-16T18:33:10.507315Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.0654458999633789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.491913Z", "completed_at": "2024-05-16T18:33:10.502987Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.508311Z", "completed_at": "2024-05-16T18:33:10.508311Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.0487973690032959, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.509314Z", "completed_at": "2024-05-16T18:33:10.523354Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.536158Z", "completed_at": "2024-05-16T18:33:10.536158Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.051717281341552734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_07_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.525352Z", "completed_at": "2024-05-16T18:33:10.545175Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.573491Z", "completed_at": "2024-05-16T18:33:10.573491Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05643820762634277, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_08_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.537162Z", "completed_at": "2024-05-16T18:33:10.571939Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.576793Z", "completed_at": "2024-05-16T18:33:10.576793Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05548834800720215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_11_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.546822Z", "completed_at": "2024-05-16T18:33:10.573491Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.577694Z", "completed_at": "2024-05-16T18:33:10.577694Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.09536099433898926, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__int_pqi_12_num"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.557117Z", "completed_at": "2024-05-16T18:33:10.575774Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.618688Z", "completed_at": "2024-05-16T18:33:10.618688Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.08708047866821289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_exclusion_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.579891Z", "completed_at": "2024-05-16T18:33:10.623259Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.631352Z", "completed_at": "2024-05-16T18:33:10.631352Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.06629705429077148, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.626253Z", "completed_at": "2024-05-16T18:33:10.635908Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.670846Z", "completed_at": "2024-05-16T18:33:10.670846Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05337333679199219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.632346Z", "completed_at": "2024-05-16T18:33:10.665768Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.673042Z", "completed_at": "2024-05-16T18:33:10.673042Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05180835723876953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.636910Z", "completed_at": "2024-05-16T18:33:10.669316Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.675062Z", "completed_at": "2024-05-16T18:33:10.675062Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.08769869804382324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.641819Z", "completed_at": "2024-05-16T18:33:10.671854Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.677062Z", "completed_at": "2024-05-16T18:33:10.677062Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.08561158180236816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.677062Z", "completed_at": "2024-05-16T18:33:10.717439Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.800882Z", "completed_at": "2024-05-16T18:33:10.800882Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.16620421409606934, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclude_procedures_observations"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.720452Z", "completed_at": "2024-05-16T18:33:10.822515Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.896277Z", "completed_at": "2024-05-16T18:33:10.896277Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.18350434303283691, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.756042Z", "completed_at": "2024-05-16T18:33:10.853598Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.898440Z", "completed_at": "2024-05-16T18:33:10.898440Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.18505620956420898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.801898Z", "completed_at": "2024-05-16T18:33:10.896277Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.901998Z", "completed_at": "2024-05-16T18:33:10.901998Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.2207331657409668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclude_procedures_medications"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.838058Z", "completed_at": "2024-05-16T18:33:10.897433Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:10.903003Z", "completed_at": "2024-05-16T18:33:10.903003Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1854691505432129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.903003Z", "completed_at": "2024-05-16T18:33:10.941164Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.042201Z", "completed_at": "2024-05-16T18:33:11.042201Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.14678955078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.943183Z", "completed_at": "2024-05-16T18:33:11.043225Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.131577Z", "completed_at": "2024-05-16T18:33:11.131577Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.19707536697387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:10.995059Z", "completed_at": "2024-05-16T18:33:11.056182Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.134210Z", "completed_at": "2024-05-16T18:33:11.134210Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.19707965850830078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.045637Z", "completed_at": "2024-05-16T18:33:11.132614Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.138243Z", "completed_at": "2024-05-16T18:33:11.138243Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.15321135520935059, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_advanced_illness"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.104878Z", "completed_at": "2024-05-16T18:33:11.134210Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.145257Z", "completed_at": "2024-05-16T18:33:11.145257Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.15418624877929688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_shared_exclusions_dementia"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.139262Z", "completed_at": "2024-05-16T18:33:11.148243Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.165939Z", "completed_at": "2024-05-16T18:33:11.165939Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03685259819030762, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.150785Z", "completed_at": "2024-05-16T18:33:11.167455Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.182546Z", "completed_at": "2024-05-16T18:33:11.182546Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04080820083618164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.160698Z", "completed_at": "2024-05-16T18:33:11.169467Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.185059Z", "completed_at": "2024-05-16T18:33:11.185059Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04082059860229492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.170530Z", "completed_at": "2024-05-16T18:33:11.184052Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.189911Z", "completed_at": "2024-05-16T18:33:11.189911Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03657841682434082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.174546Z", "completed_at": "2024-05-16T18:33:11.186065Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.194911Z", "completed_at": "2024-05-16T18:33:11.194911Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.033334970474243164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_patient_hcc_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.189911Z", "completed_at": "2024-05-16T18:33:11.197908Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.213367Z", "completed_at": "2024-05-16T18:33:11.213367Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.031322479248046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.200910Z", "completed_at": "2024-05-16T18:33:11.214373Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.238300Z", "completed_at": "2024-05-16T18:33:11.238300Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04639482498168945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.205863Z", "completed_at": "2024-05-16T18:33:11.215374Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.240310Z", "completed_at": "2024-05-16T18:33:11.240310Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04739189147949219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.216376Z", "completed_at": "2024-05-16T18:33:11.238300Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.245354Z", "completed_at": "2024-05-16T18:33:11.245354Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04670214653015137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.222455Z", "completed_at": "2024-05-16T18:33:11.240310Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.249384Z", "completed_at": "2024-05-16T18:33:11.249384Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04104423522949219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_num_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.245354Z", "completed_at": "2024-05-16T18:33:11.254901Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.266194Z", "completed_at": "2024-05-16T18:33:11.266194Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.03005671501159668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.256900Z", "completed_at": "2024-05-16T18:33:11.268358Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.282638Z", "completed_at": "2024-05-16T18:33:11.282638Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.03526186943054199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.263173Z", "completed_at": "2024-05-16T18:33:11.275638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.285151Z", "completed_at": "2024-05-16T18:33:11.285151Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03447771072387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.269363Z", "completed_at": "2024-05-16T18:33:11.282638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.289433Z", "completed_at": "2024-05-16T18:33:11.289433Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04660940170288086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.276639Z", "completed_at": "2024-05-16T18:33:11.282638Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.290439Z", "completed_at": "2024-05-16T18:33:11.290439Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04699587821960449, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.290439Z", "completed_at": "2024-05-16T18:33:11.312492Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.348764Z", "completed_at": "2024-05-16T18:33:11.349764Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.08160233497619629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.316585Z", "completed_at": "2024-05-16T18:33:11.350770Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.383273Z", "completed_at": "2024-05-16T18:33:11.383273Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0782930850982666, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.334247Z", "completed_at": "2024-05-16T18:33:11.363745Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.384272Z", "completed_at": "2024-05-16T18:33:11.384272Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.07585024833679199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.350770Z", "completed_at": "2024-05-16T18:33:11.381285Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.388328Z", "completed_at": "2024-05-16T18:33:11.388328Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.07567310333251953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.365744Z", "completed_at": "2024-05-16T18:33:11.383273Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.390211Z", "completed_at": "2024-05-16T18:33:11.390211Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.06904268264770508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.392231Z", "completed_at": "2024-05-16T18:33:11.405251Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.422354Z", "completed_at": "2024-05-16T18:33:11.422354Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.05603957176208496, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.406251Z", "completed_at": "2024-05-16T18:33:11.423524Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.444306Z", "completed_at": "2024-05-16T18:33:11.444306Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.0455322265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.413250Z", "completed_at": "2024-05-16T18:33:11.432623Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.445306Z", "completed_at": "2024-05-16T18:33:11.445306Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04550433158874512, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_comorbidity_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.423524Z", "completed_at": "2024-05-16T18:33:11.443306Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.449313Z", "completed_at": "2024-05-16T18:33:11.449313Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.045575618743896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_lab_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.432623Z", "completed_at": "2024-05-16T18:33:11.445306Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.450819Z", "completed_at": "2024-05-16T18:33:11.450819Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1415853500366211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_medication_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.451826Z", "completed_at": "2024-05-16T18:33:11.557843Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.576221Z", "completed_at": "2024-05-16T18:33:11.576221Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.14522671699523926, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__int_observation_suspects"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.558861Z", "completed_at": "2024-05-16T18:33:11.575214Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.592534Z", "completed_at": "2024-05-16T18:33:11.593534Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.09144854545593262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.567354Z", "completed_at": "2024-05-16T18:33:11.577223Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.595530Z", "completed_at": "2024-05-16T18:33:11.595530Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.04363059997558594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.577721Z", "completed_at": "2024-05-16T18:33:11.593534Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.599544Z", "completed_at": "2024-05-16T18:33:11.599544Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.04384016990661621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.584443Z", "completed_at": "2024-05-16T18:33:11.594531Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.599544Z", "completed_at": "2024-05-16T18:33:11.599544Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.04089808464050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.602760Z", "completed_at": "2024-05-16T18:33:11.610830Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.623364Z", "completed_at": "2024-05-16T18:33:11.623364Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.04206538200378418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.610830Z", "completed_at": "2024-05-16T18:33:11.622367Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.640303Z", "completed_at": "2024-05-16T18:33:11.640303Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.04167914390563965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_payer_plan"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.615828Z", "completed_at": "2024-05-16T18:33:11.627968Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.641198Z", "completed_at": "2024-05-16T18:33:11.641198Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03602337837219238, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.623364Z", "completed_at": "2024-05-16T18:33:11.639137Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.644208Z", "completed_at": "2024-05-16T18:33:11.644208Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.031638145446777344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_rate"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.629021Z", "completed_at": "2024-05-16T18:33:11.640303Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.645961Z", "completed_at": "2024-05-16T18:33:11.645961Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.032654762268066406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.ahrq_measures__pqi_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.671862Z", "completed_at": "2024-05-16T18:33:11.682836Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.695307Z", "completed_at": "2024-05-16T18:33:11.695307Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05047774314880371, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.676838Z", "completed_at": "2024-05-16T18:33:11.692355Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.695918Z", "completed_at": "2024-05-16T18:33:11.695918Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.03161025047302246, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.685346Z", "completed_at": "2024-05-16T18:33:11.694357Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.699942Z", "completed_at": "2024-05-16T18:33:11.699942Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.03167605400085449, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.689353Z", "completed_at": "2024-05-16T18:33:11.695918Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.700943Z", "completed_at": "2024-05-16T18:33:11.700943Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.028653860092163086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.708510Z", "completed_at": "2024-05-16T18:33:11.796461Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.890266Z", "completed_at": "2024-05-16T18:33:11.890266Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.18979406356811523, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cbe0055_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.751109Z", "completed_at": "2024-05-16T18:33:11.848216Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.891261Z", "completed_at": "2024-05-16T18:33:11.891261Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.18977785110473633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_cqm236_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.797501Z", "completed_at": "2024-05-16T18:33:11.889264Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.894266Z", "completed_at": "2024-05-16T18:33:11.894266Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.18977856636047363, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.848216Z", "completed_at": "2024-05-16T18:33:11.892261Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:11.898339Z", "completed_at": "2024-05-16T18:33:11.898339Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.1496567726135254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0053_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.903804Z", "completed_at": "2024-05-16T18:33:11.991362Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.008910Z", "completed_at": "2024-05-16T18:33:12.008910Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.11348795890808105, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0059_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.947120Z", "completed_at": "2024-05-16T18:33:11.998303Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.009827Z", "completed_at": "2024-05-16T18:33:12.009827Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.11356902122497559, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.992300Z", "completed_at": "2024-05-16T18:33:12.008910Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.013839Z", "completed_at": "2024-05-16T18:33:12.013839Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.11302518844604492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.000811Z", "completed_at": "2024-05-16T18:33:12.010826Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.017363Z", "completed_at": "2024-05-16T18:33:12.017363Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.029144763946533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__list"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.022307Z", "completed_at": "2024-05-16T18:33:12.039285Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.065482Z", "completed_at": "2024-05-16T18:33:12.065482Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.05647611618041992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.029449Z", "completed_at": "2024-05-16T18:33:12.040284Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.066430Z", "completed_at": "2024-05-16T18:33:12.066430Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.05639481544494629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.041281Z", "completed_at": "2024-05-16T18:33:12.072928Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.077987Z", "completed_at": "2024-05-16T18:33:12.077987Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.043486833572387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__list_rollup"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.048283Z", "completed_at": "2024-05-16T18:33:12.073839Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.079004Z", "completed_at": "2024-05-16T18:33:12.079004Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.043712615966796875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.hcc_suspecting__summary"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.083985Z", "completed_at": "2024-05-16T18:33:12.099428Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.106279Z", "completed_at": "2024-05-16T18:33:12.106279Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.029284238815307617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.090339Z", "completed_at": "2024-05-16T18:33:12.099428Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.107286Z", "completed_at": "2024-05-16T18:33:12.107286Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.02929830551147461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.099428Z", "completed_at": "2024-05-16T18:33:12.106279Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.110285Z", "completed_at": "2024-05-16T18:33:12.110285Z"}], "thread_id": "Thread-2 (worker)", "execution_time": 0.014874696731567383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.113288Z", "completed_at": "2024-05-16T18:33:12.117289Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.118510Z", "completed_at": "2024-05-16T18:33:12.118510Z"}], "thread_id": "Thread-3 (worker)", "execution_time": 0.007224082946777344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:11.648483Z", "completed_at": "2024-05-16T18:33:12.490270Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.491280Z", "completed_at": "2024-05-16T18:33:12.491280Z"}], "thread_id": "Thread-4 (worker)", "execution_time": 0.9520859718322754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.599312Z", "completed_at": "2024-05-16T18:33:12.607850Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.608854Z", "completed_at": "2024-05-16T18:33:12.608854Z"}], "thread_id": "Thread-5 (worker)", "execution_time": 0.012447118759155273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-05-16T18:33:12.603834Z", "completed_at": "2024-05-16T18:33:12.608854Z"}, {"name": "execute", "started_at": "2024-05-16T18:33:12.610877Z", "completed_at": "2024-05-16T18:33:12.610877Z"}], "thread_id": "Thread-1 (worker)", "execution_time": 0.013564586639404297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586"}], "elapsed_time": 11.418060779571533, "args": {"version_check": true, "introspect": true, "defer": false, "profiles_dir": "C:\\Users\\thuxuan\\PycharmProjects", "static_parser": true, "select": [], "log_level": "info", "partial_parse": true, "exclude": [], "warn_error_options": {"include": [], "exclude": []}, "enable_legacy_logger": false, "favor_state": false, "use_colors": true, "log_path": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate\\..\\logs", "which": "generate", "quiet": false, "write_json": true, "send_anonymous_usage_stats": true, "log_format": "default", "strict_mode": false, "populate_cache": true, "indirect_selection": "eager", "print": true, "printer_width": 80, "log_format_file": "debug", "use_colors_file": true, "compile": true, "project_dir": "C:\\Users\\thuxuan\\the_tuva_project\\integration_tests\\docs_generate", "vars": {}, "cache_selected_only": false, "log_level_file": "debug", "macro_debugging": false}} \ No newline at end of file